Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

ness

0.0.0 • Public • Published

ness

Any value that is not null, undefined or false is true.

Install

npm install ness

Examples

Test for true or false:

var ness = require('ness');
var val;
 
val = ness(0);
val.test();  //=> true
 
val = ness('');
val.test();  //=> true
 
val = ness(NaN);
val.test();  //=> true
 
val = ness(false);
val.test();  //=> false
 
val = ness(null);
val.test();  //=> false
 
val = ness(undefined);
val.test();  //=> false

Logical and:

var ness = require('ness');
var val;
 
val = ness(false);
val.and(undefined);  //=> false
 
val = ness(true);
val.and(false);      //=> false
 
val = ness(0);
val.and(true);       //=> true

Logical or:

var ness = require('ness');
var val;
 
val = ness(NaN);
val.or(false);          //=> true
 
val = ness(undefined);
val.or('trueness');     //=> true
 
val = ness(null);
val.or(false);          //=> false

Logical not:

var ness = require('ness');
var val;
 
val = ness(true);
val.not();  //=> false
 
val = ness(false);
val.not();  //=> true

LICENSE

MIT

install

npm i ness

Downloadsweekly downloads

3

version

0.0.0

license

none

repository

githubgithub

last publish

collaborators

  • avatar