modify-values
v2.1.1
Published
Modify the values of an object
Downloads
13,147,032
Maintainers
Readme
modify-values
Modify the values of an object
Install
$ npm install modify-values
Usage
import modifyValues from 'modify-values';
modifyValues({foo: 'UNICORN'}, (value, key) => value.toLowerCase());
//=> {foo: 'unicorn'}
API
modifyValues(object, transformer)
Modifies the values and returns a new object.
object
Type: object
transformer(value, key)
Type: Function
Gets the value and key for each item and is expected to return the new value.
Related
See modify-keys
for modifying the keys of an object.