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

1.0.2 • Public • Published

transform-values-deep

build

Deeply convert object values using specified predicate.

const foo = () => true;
const actual = transformAnyValuesDeep(
  {
    a: 4,
    b: {
      c: '7',
      f: foo,
    },
    d: '9',
  },
  (s: string) => parseInt(s),
  (o: unknown): o is string => typeof o === 'string'
);
/*
=> {
  a: 4,
  b: {
    c: 7,
    f: foo,
  },
  d: 9,
}
*/

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i transform-values-deep

    Weekly Downloads

    1

    Version

    1.0.2

    License

    BSL-1.0

    Unpacked Size

    5.36 kB

    Total Files

    7

    Last publish

    Collaborators

    • yumetodo