blacklist

WebJar for blacklist

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

blacklist
Last Version

Last Version

1.1.4
Release Date

Release Date

Type

Type

jar
Description

Description

blacklist
WebJar for blacklist
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dcousens/blacklist

Download blacklist

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/blacklist/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>blacklist</artifactId>
    <version>1.1.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/blacklist/
implementation 'org.webjars.npm:blacklist:1.1.4'
// https://jarcasting.com/artifacts/org.webjars.npm/blacklist/
implementation ("org.webjars.npm:blacklist:1.1.4")
'org.webjars.npm:blacklist:jar:1.1.4'
<dependency org="org.webjars.npm" name="blacklist" rev="1.1.4">
  <artifact name="blacklist" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='blacklist', version='1.1.4')
)
libraryDependencies += "org.webjars.npm" % "blacklist" % "1.1.4"
[org.webjars.npm/blacklist "1.1.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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.

ESNext alternative

If you can, don't use this library. Use ESNext destructuring assignment instead.

let { a, ...filtered } = { a: 1, b: 2, c: 3 }
// filtered => { b: 2, c: 3 }

Example

var blacklist = require('blacklist')

// ...

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

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

Protip: you can also use a filter object

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 }

LICENSE MIT

Versions

Version
1.1.4
1.1.2