npm

Need private packages and team management tools?Check out npm Orgs. »

is-binary-array

1.0.1 • Public • Published

is-binary-array Build Status Node Version Required

The fastest way to check if an array contains binary digits only

Install

$ npm install is-binary-array

Usage

const isBinaryArray = require('is-binary-array');
 
isBinaryArray([0]);
//=> true
 
isBinaryArray([0, 1, 1, 0]);
//=> true
 
isBinaryArray([0, 1, 1, 8]);
//=> false
 
isBinaryArray([100]);
//=> false
 
isBinaryArray([-1, 0, 1]);
//=> false
 
isBinaryArray(123);
//=> 'Expected an array, got number'

License

MIT © JeffMinsungKim

install

npm i is-binary-array

Downloadsweekly downloads

1

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability