@hanse-kim/replace-keys
v1.0.1
Published
A simple util for replace an object's keys.
Downloads
6
Readme
replace-keys
A simple util for replace an object's keys.
Usage
const obj = {
foo: {
bar: 'baz'
}
};
replaceKeys(obj, {
foo: 'FOO',
bar: (key) => key.slice(1),
});
// result: { FOO: { ar: 'baz' } }