modify-values
Modify the values of an object
Last updated 7 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm
$ cnpm install modify-values 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.1                                ...           latest (7 years ago)

1 Versions

  • 1.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org