jtruthy
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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)[]

Readme

Keywords

none

Package Sidebar

Install

npm i jtruthy

Weekly Downloads

2

Version

0.0.7

License

MIT

Unpacked Size

1.12 kB

Total Files

7

Last publish

Collaborators

  • tranvansang