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

Function transformPushBodyForLocale

src/Push/utils.js:43–56  ·  view source on GitHub ↗
(body, locale)

Source from the content-addressed store, hash-verified

41}
42
43export function transformPushBodyForLocale(body, locale) {
44 const data = body.data;
45 if (!data) {
46 return body;
47 }
48 body = structuredClone(body);
49 localizableKeys.forEach(key => {
50 const localeValue = body.data[`${key}-${locale}`];
51 if (localeValue) {
52 body.data[key] = localeValue;
53 }
54 });
55 return stripLocalesFromBody(body);
56}
57
58export function stripLocalesFromBody(body) {
59 if (!body.data) {

Callers 1

bodiesPerLocalesFunction · 0.85

Calls 1

stripLocalesFromBodyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…