just-deep-map-values
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

just-deep-map-values

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-deep-map-values
yarn add just-deep-map-values

Returns an object with values at all depths mapped according to the provided function

import deepMapValues from 'just-deep-map-values';

const squareFn = (number) => number * number;
deepMapValues({ a: 1, b: { c: 2, d: { e: 3 } } }, squareFn); // => { a: 1, b: { c: 4, d: { e: 9 } } }

Package Sidebar

Install

npm i just-deep-map-values

Weekly Downloads

7,262

Version

1.2.0

License

MIT

Unpacked Size

5.18 kB

Total Files

9

Last publish

Collaborators

  • angus-c