Package Exports
- key-replace
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (key-replace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
key-replace 
Replace object keys with String.prototype.replace
Install
$ npm install --save key-replaceUsage
const keyReplace = require('key-replace');
const obj = {
foo: 'bar'
};
keyReplace(obj, 'fo', 'y');
//=> {yo: 'bar'}
keyReplace(obj, 'fo', str => {
return str.toUpperCase();
});
//=> {FOo: bar}API
keyReplace(input, search, replace)
Returns a new object.
input
Required
Type: object
The object which keys will be replaced.
search
Required
Type: string or regexp
Search for mathching substring that will be replaced.
replace
Required
Type: string or function
Replacing the mathing substring.
License
MIT © Andreas Gillström