Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
is-arrayish
Advanced tools
The is-arrayish npm package is used to determine if a value is array-like, meaning it can be iterated over like an array. This can include actual arrays, array-like objects (such as arguments or NodeList objects), or objects with a length property that are not functions.
Check if a value is array-like
This feature allows you to check if a given value is array-like. It returns true for actual arrays, array-like objects, and objects with a length property that are not functions. It returns false for other types of values, such as strings or functions.
var isArrayish = require('is-arrayish');
console.log(isArrayish([])); // true
console.log(isArrayish({ length: 1, 0: 'a' })); // true
console.log(isArrayish('string')); // false
console.log(isArrayish(function(){})); // false
The isarray package provides a simple utility for determining whether a given value is an array. It is similar to is-arrayish but is more strict, as it only returns true for actual Array instances.
The is-arguments package is designed to check if a value is an arguments object. While is-arrayish can also identify arguments objects as array-like, is-arguments is specifically tailored for this purpose and does not consider other array-like objects.
Determines if an object can be used like an Array
var isArrayish = require('is-arrayish');
isArrayish([]); // true
isArrayish({__proto__: []}); // true
isArrayish({}); // false
isArrayish({length:10}); // false
Licensed under the MIT License. You can find a copy of it in LICENSE.
FAQs
Determines if an object can be used as an array
The npm package is-arrayish receives a total of 47,090,377 weekly downloads. As such, is-arrayish popularity was classified as popular.
We found that is-arrayish demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.