0.1.1 • Published 7 years ago
array-typeof v0.1.1
array-typeof
Checks the entries of an array for a specific type
Installing
Node.js environment
npm i array-typeof --saveBrowser 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"]));
//=> falseAPI
isNumeric(arr: Array<any>): boolean- Checks each entry of
arrif it's a number or not.
- Checks each entry of
isString(arr: Array<any>): boolean- Checks each entry of
arrif it's a string or not.
- Checks each entry of
isBoolean(arr: Array<any>): boolean- Checks each entry of
arrif it's a boolean or not.
- Checks each entry of
isObject(arr: Array<any>): boolean- Checks each entry of
arrif it's an object or not.
- Checks each entry of
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.