Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
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.
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.
With component do
$ component install juliangruber/isarray
(MIT)
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Array#isArray for older browsers
The npm package isarray receives a total of 101,588,560 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
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.