Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.