object-picker
Pick only what you want in an object.
Last updated 4 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install object-picker 
SYNC missed versions from official npm registry.

object-picker NPM version NPM downloads Build Status

Pick only what you want in an object.

Install

$ npm install --save object-picker

Usage

const picker = require('object-picker')

const obj = {
  foo: undefined,
  bar: '',
  baz: 'lol',
  zip: 'leave me alone'
}

picker(obj, ['foo', 'bar', 'barbee'])
//=> {foo: undefined, bar: ''}

API

objectPicker(obj, selections)

obj

Type: Object

The input object.

selections

Type: Array
Default: []

The fields to select.

License

MIT © EGOIST

Current Tags

  • 0.2.0                                ...           latest (4 years ago)

2 Versions

  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (0)
None
Dev Dependencies (2)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |