(installations, locales = [])
| 81 | } |
| 82 | |
| 83 | export 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. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…