GT2/GT2-iOS/node_modules/react-native/local-cli/link/android/patches/makeStringsPatch.js

20 lines
469 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
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,
};
};