mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 12:05:06 +00:00
107fc72dab
Differential Revision: D3752878 fbshipit-source-id: f248082effde9133dd6a9edf8a2f2cfc05279eab
20 lines
469 B
JavaScript
20 lines
469 B
JavaScript
const toCamelCase = require('lodash').camelCase;
|
|
|
|
module.exports = function makeStringsPatch(params, prefix) {
|
|
const values = Object.keys(params)
|
|
.map(param => {
|
|
const name = toCamelCase(prefix) + '_' + param;
|
|
return ' ' +
|
|
`<string moduleConfig="true" name="${name}">${params[param]}</string>`;
|
|
});
|
|
|
|
const patch = values.length > 0
|
|
? values.join('\n') + '\n'
|
|
: '';
|
|
|
|
return {
|
|
pattern: '<resources>\n',
|
|
patch,
|
|
};
|
|
};
|