0.1.2 • Published 6 years ago

object-without-props v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

objectWithoutProps + objectWithProps

A package for SHALLOW removing of properties from an object or selecting properties from an object and creating a new object out of the result.

Installation

yarn add object-without-props or npm i object-without-props

Usage

import objectWithoutProps, {objectWithProps} from 'object-without-props'


const objectA = {foo: 'bar', bar: 'baz', baz: 'boz'}
const objectB = {foo: null}
const objectC = ['bar']

objectWithoutProps(objectA, objectB, objectC)
// {baz: 'boz'}

objectWithProps(objectA, objectB, objectC)
// {foo: 'bar', bar: 'baz'}