react-native/local-cli/rnpm/link/src/android/patches/makeStringsPatch.js

15 lines
401 B
JavaScript
Raw Normal View History

const toCamelCase = require('to-camel-case');
module.exports = function makeStringsPatch(params, prefix) {
const patch = Object.keys(params).map(param => {
const name = toCamelCase(prefix) + '_' + param;
return ' ' +
`<string moduleConfig="true" name="${name}">${params[param]}</string>`;
}).join('\n') + '\n';
return {
pattern: '<resources>\n',
patch: patch,
};
};