Wondering what’s next for npm?Check out our public roadmap! »

this-is-truthy

1.0.1 • Public • Published

Coveralls – test coverage Travis – build status David – status of dependencies Stability: stable Code style: airbnb

::isTruthy()

Check if this is truthy.

 

Installation

$ npm install this-is-truthy
 

Usage

import isTruthy from 'this-is-truthy/module';
// or:
const isTruthy = require('this-is-truthy');

These are all true:

true::isTruthy();
5::isTruthy();
'a'::isTruthy();
[]::isTruthy();
{}::isTruthy();
() => {}::isTruthy();

These are false:

false::isTruthy();
null::isTruthy();
undefined::isTruthy();
0::isTruthy();
NaN::isTruthy();
''::isTruthy();

It works great with trine:

const take = require('trine/iterable/take');
 
[1, 3, , 5, 0, 7]::take(isTruthy);
// yields [1, 3, 5, 7]
 

License

MIT © Tomek Wiszniewski

Install

npm i this-is-truthy

DownloadsWeekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar