Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
The isarray package is a minimalistic npm package used to determine if a given value is an array. It is particularly useful when you need to support older browsers or environments that do not have Array.isArray available.
Check if a value is an array
This feature allows you to check if a value is an array. It returns true if the value is an array, and false otherwise.
var isArray = require('isarray');
console.log(isArray([])); // true
console.log(isArray({})); // false
This package is a part of the Lodash library, which is a more comprehensive utility toolkit. Lodash's isArray function is similar to isarray, but it comes within a larger set of utility functions. Lodash is generally larger in size compared to the standalone isarray package.
is-arrayish checks if a value is array-like, meaning it's not strictly an array but can be treated like one (e.g., arguments object, NodeList). This is different from isarray, which strictly checks for actual Array instances.
Array#isArray
for older browsers and deprecated Node.js versions.
Just use Array.isArray directly, unless you need to support those older versions.
var isArray = require('isarray');
console.log(isArray([])); // => true
console.log(isArray({})); // => false
With npm do
$ npm install isarray
Then bundle for the browser with browserify.
This module is proudly supported by my Sponsors!
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my Patreon. Not sure how much of my modules you're using? Try feross/thanks!
FAQs
Array#isArray for older browsers
The npm package isarray receives a total of 85,826,328 weekly downloads. As such, isarray popularity was classified as popular.
We found that isarray 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.