npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

array-typeof

0.1.1 • Public • Published

array-typeof

Checks the entries of an array for a specific type

Installing

Node.js environment

npm i array-typeof --save

Browser environment

Download the latest version of array-typeof here.

Usage

Node.js environment

const arrayTypeof = require("array-typeof");
 
console.log(arrayTypeof.isNumeric([1, 2.3, 4]));
//=> true
 
console.log(arrayTypeof.isNumeric([1, "2.3", 3]));
//=> false
 
console.log(arrayTypeof.isString(["Hello", "World"]));
//=> true
 
console.log(arrayTypeof.isString([true, "World"]));
//=> false

API

  • isNumeric(arr: Array<any>): boolean
    • Checks each entry of arr if it's a number or not.
  • isString(arr: Array<any>): boolean
    • Checks each entry of arr if it's a string or not.
  • isBoolean(arr: Array<any>): boolean
    • Checks each entry of arr if it's a boolean or not.
  • isObject(arr: Array<any>): boolean
    • Checks each entry of arr if it's an object or not.

Changelog

You can read the changelog here.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the GPL-3.0 License - see here for more details.

install

npm i array-typeof

Downloadsweekly downloads

2

version

0.1.1

license

GPL-3.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability