Run Prettier JS #2 (#6796)

This commit is contained in:
Diamond Lewis
2020-07-13 17:13:08 -05:00
committed by GitHub
parent e6a6354b29
commit 142eaa71bd
40 changed files with 323 additions and 330 deletions

View File

@@ -76,7 +76,7 @@ export class PushWorker {
installations,
locales
);
const promises = Object.keys(grouppedInstallations).map((locale) => {
const promises = Object.keys(grouppedInstallations).map(locale => {
const installations = grouppedInstallations[locale];
const body = bodiesPerLocales[locale];
return this.sendToAdapter(
@@ -94,7 +94,7 @@ export class PushWorker {
logger.verbose(`Sending push to ${installations.length}`);
return this.adapter
.send(body, installations, pushStatus.objectId)
.then((results) => {
.then(results => {
return pushStatus.trackSent(results, UTCOffset).then(() => results);
});
}
@@ -103,7 +103,7 @@ export class PushWorker {
const badgeInstallationsMap = groupByBadge(installations);
// Map the on the badges count and return the send result
const promises = Object.keys(badgeInstallationsMap).map((badge) => {
const promises = Object.keys(badgeInstallationsMap).map(badge => {
const payload = deepcopy(body);
payload.data.badge = parseInt(badge);
const installations = badgeInstallationsMap[badge];

View File

@@ -29,7 +29,7 @@ export function getLocalesFromPush(body) {
return [
...new Set(
Object.keys(data).reduce((memo, key) => {
localizableKeys.forEach((localizableKey) => {
localizableKeys.forEach(localizableKey => {
if (key.indexOf(`${localizableKey}-`) == 0) {
memo.push(key.slice(localizableKey.length + 1));
}
@@ -46,7 +46,7 @@ export function transformPushBodyForLocale(body, locale) {
return body;
}
body = deepcopy(body);
localizableKeys.forEach((key) => {
localizableKeys.forEach(key => {
const localeValue = body.data[`${key}-${locale}`];
if (localeValue) {
body.data[key] = localeValue;
@@ -59,8 +59,8 @@ export function stripLocalesFromBody(body) {
if (!body.data) {
return body;
}
Object.keys(body.data).forEach((key) => {
localizableKeys.forEach((localizableKey) => {
Object.keys(body.data).forEach(key => {
localizableKeys.forEach(localizableKey => {
if (key.indexOf(`${localizableKey}-`) == 0) {
delete body.data[key];
}
@@ -84,7 +84,7 @@ export function groupByLocaleIdentifier(installations, locales = []) {
return installations.reduce(
(map, installation) => {
let added = false;
locales.forEach((locale) => {
locales.forEach(locale => {
if (added) {
return;
}