Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-truthy

miguelmota9MIT0.0.1

Predicate that returns true for "truthy" values.

predicate, existy

readme

is-truthy

Predicate that returns true for truthy values.

Install

npm install is-truthy
bower install is-truthy

Usage

var isTruthy = require('is-truthy');

console.log(isTruthy('')); // false
console.log(isTruthy(0)); // false
console.log(isTruthy(null)); // false
console.log(isTruthy(undefined)); // false
console.log(isTruthy(1)); // true
console.log(isTruthy({})); // true
console.log(isTruthy([])); // true
console.log(isTruthy(function() { })); // true

License

MIT

changelog

Change Log

All notable changes to this project will be documented in this file.