1.0.0 • Published 3 years ago

@jswork/next-pick v1.0.0

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

next-pick

Creates an object composed of the picked object properties.

version license size download

installation

npm install -S @jswork/next-pick

usage

import '@jswork/next-pick';

const object = {
  'a': 1,
  'c': 'c-value',
  some: {
    what: {
      and: {
        deep: {
          one: 1
        }
      }
    }
  }
};

const picked = nx.pick(object, ['a', 'c', 'some.what.and.deep.one']);

// {
//   "a": 1,
//   "c": "c-value",
//   "some": {
//     "what": {
//       "and": {
//         "deep": {
//           "one": 1
//         }
//       }
//     }
//   }
// }

license

Code released under the MIT license.