1.1.0 • Published 9 years ago

complement v1.1.0

Weekly downloads
26
License
ISC
Repository
github
Last release
9 years ago

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