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

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.

Current Tags

  • 2.1.1                                ...           latest (3 years ago)

5 Versions

  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2013 - present © cnpmjs.org | Home |