modify-values
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.1
    30
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.1
    30
  • 2.1.0
    11
  • 2.0.0
    11
  • 1.0.1
    2,617,836
  • 1.0.0
    4,517

Package Sidebar

Install

npm i modify-values

Weekly Downloads

2,622,405

Version

2.1.1

License

MIT

Unpacked Size

3.62 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus