1.0.0 • Published 3 years ago

@jswork/next-pick-by v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

next-pick-by

Pick value from object by callback.

version license size download

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.