Skip to content

codewell/and

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

Check if all conditions or booleans are true

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •