Nth Permutation Mathematics
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

modify-values

1.0.1 • Public • Published

modify-values Build Status

Modify the values of an object

Install

$ npm install --save modify-values

Usage

var modifyValues = require('modify-values');
 
modifyValues({foo: 'UNICORN'}, function (value, key) {
    return value.toLowerCase();
});
//=> {foo: 'unicorn'}

API

modifyValues(input, modifier)

Modifies the values and returns a new object.

input

Required
Type: object

modifier(value, key)

Required
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.

License

MIT © Sindre Sorhus

install

npm i modify-values

Downloadsweekly downloads

431,509

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability