@jswork/next-pick-by
v1.0.0
Published
Pick value from object by callback.
Downloads
10
Readme
next-pick-by
Pick value from object by callback.
installation
npm install -S @jswork/next-pick-by
usage
import '@jswork/next-pick-by';
const object = {
'a': 1,
'c': 'c-value',
'k1': 111,
'k2': 222,
'k3': 333,
some: {
what: {
and: {
deep: {
one: 1
}
}
}
}
};
const res = nx.pickBy(object, function (key, value, item) {
return typeof(value) === 'number';
});
// { a: 1, k1: 111, k2: 222, k3: 333 }
license
Code released under the MIT license.