@codewell/and

1.0.0 • Public • Published

@codewell/and

Check if all conditions or booleans are true. First parameter should be an array of booleans. Second determines what should be returned if the input is [], undefied or null. Options are false, 'false' or throw.

Installation

npm install @codewell/and

Basic usage

import and from '@codewell/and';

and([true, true, true]) // => true
and([true, true, false]) // => false
and([]) // => true

and([], 'false') // => false
and([], false) // => false
and([], 'throw') // => throws error

and(undefined, 'false') // => false
and(undefined, false) // => false
and(undefined, 'throw') // => throws error

and(null, 'false') // => false
and(null, false) // => false
and(null, 'throw') // => throws error

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.02latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.02

Package Sidebar

Install

npm i @codewell/and

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

3.69 kB

Total Files

6

Last publish

Collaborators

  • fippli