blacklist
[![Version](http://img.shields.io/npm/v/blacklist.svg)](https://www.npmjs.org/package/blacklist)
Last updated 12 years ago by dcousens .
MIT · Original npm · Tarball · package.json
$ npm install blacklist 
SYNC missed versions from official npm registry.

blacklist

Build Status Version

This module shallow copies an object, ignoring keys depending on the filter object passed to it.

Filters can be provided as an object (truthy keys are blacklisted) or string arguments.

ES next alternative

If you can, use

var { a, ... bc } = { a: 1, b: 2, c: 3 }

Example

var someInput = { a: 1, b: 2, c: 3 }

// ...

var blacklist = require('blacklist')

blacklist(someInput, 'b', 'c')
// => { a: 1 }

blacklist(someInput, {
	a: true,   // a will not be in the result
	b: false,  // b will be in the result
	c: 1 > 2   // false, therefore c will be in the result
})
// => { b: 2, c: 3 }

Current Tags

  • 1.1.4                                ...           latest (10 years ago)

6 Versions

  • 1.1.4                                ...           10 years ago
  • 1.1.2                                ...           12 years ago
  • 1.1.1                                ...           12 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 12
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE