(body)
| 22 | const localizableKeys = ['alert', 'title']; |
| 23 | |
| 24 | export 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 | |
| 43 | export function transformPushBodyForLocale(body, locale) { |
| 44 | const data = body.data; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…