JSPM

object-picker

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q38164F
  • License MIT

Pick only what you want in an object.

Package Exports

  • object-picker

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (object-picker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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