modify-values

Modify the values of an object

MIT 5 个版本
安装
npm install modify-values
yarn add modify-values
pnpm add modify-values
bun add modify-values
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.

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.
版本列表
2.1.1 2021-09-10
2.1.0 2021-05-08
2.0.0 2021-05-03
1.0.1 2018-03-23
1.0.0 2015-01-25