MCPcopy Create free account
hub / github.com/parse-community/parse-server / getLocalesFromPush

Function getLocalesFromPush

src/Push/utils.js:24–41  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

22const localizableKeys = ['alert', 'title'];
23
24export function getLocalesFromPush(body) {
25 const data = body.data;
26 if (!data) {
27 return [];
28 }
29 return [
30 ...new Set(
31 Object.keys(data).reduce((memo, key) => {
32 localizableKeys.forEach(localizableKey => {
33 if (key.indexOf(`${localizableKey}-`) == 0) {
34 memo.push(key.slice(localizableKey.length + 1));
35 }
36 });
37 return memo;
38 }, [])
39 ),
40 ];
41}
42
43export function transformPushBodyForLocale(body, locale) {
44 const data = body.data;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…