(previous, next, keys)
| 21 | |
| 22 | // TODO: relocate as a utility function |
| 23 | function getChangedProps(previous, next, keys) { |
| 24 | const propNames = keys || uniq(Object.keys(previous), Object.keys(next)); |
| 25 | const changedProps = propNames.reduce((acc, prop) => { |
| 26 | if (previous[prop] !== next[prop]) { |
| 27 | acc[prop] = next[prop]; |
| 28 | } |
| 29 | return acc; |
| 30 | }, {}); |
| 31 | if (!isEmpty(changedProps)) { |
| 32 | return changedProps; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | const languages = languageData.map(lang => ({ |
| 37 | label: lang.label, |
no test coverage detected