$ npm install 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.
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 } } }
© 2010 - cnpmjs.org x YWFE | Home | YWFE