Need private packages and team management tools?Check out npm Teams »

complement

1.1.0 • Public • Published

Complement

A stand-alone version of the common 'complement' or 'not' found in functional libraries

var complement = require('./index');
 
function isDog (string) {
  return string === 'dog'
}
 
var isNotDog = complement(isDog);
 
assert(isDog('dog'));
assert(isNotDog('cat'));
assert(isNotDog('dog') === false);

Related

FAQ

Q: Why even is this a module?

a. I wanted to play around with tweaking my publishing process and this was a great excuse to publish something b. I wanted this without bringing in a library c. I hate util.js files littered with things that can be found elsewhere

Install

npm i complement

DownloadsWeekly Downloads

1

Version

1.1.0

License

ISC

Last publish

Collaborators

  • avatar