jtruthy
v0.0.7
Published
typescript-typed Boolean()
Downloads
2
Readme
jtruthy: typescript-typed Boolean() function
Install
Install via npm package:
yarn add jtruthy
Usage
import truthy from 'jtruthy'
// or
const truthy = require('jtruthy')
const arr = [1, 2, false && 3] as const
const a = arr.filter(truthy) // type: (1 | 2)[]
const b = arr.filter(Boolean) // type: (false | 1 | 2)[]