transform-values-deep
v1.0.2
Published
Deeply convert object values
Downloads
2
Readme
transform-values-deep
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,
}
*/