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

Function groupByLocaleIdentifier

src/Push/utils.js:83–104  ·  view source on GitHub ↗
(installations, locales = [])

Source from the content-addressed store, hash-verified

81}
82
83export function groupByLocaleIdentifier(installations, locales = []) {
84 return installations.reduce(
85 (map, installation) => {
86 let added = false;
87 locales.forEach(locale => {
88 if (added) {
89 return;
90 }
91 if (installation.localeIdentifier && installation.localeIdentifier.indexOf(locale) === 0) {
92 added = true;
93 map[locale] = map[locale] || [];
94 map[locale].push(installation);
95 }
96 });
97 if (!added) {
98 map.default.push(installation);
99 }
100 return map;
101 },
102 { default: [] }
103 );
104}
105
106/**
107 * Check whether the deviceType parameter in qury condition is valid or not.

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…