Socket
Socket
Sign inDemoInstall

is-arrayish

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-arrayish

Determines if an object can be used as an array


Version published
Weekly downloads
50M
increased by0.99%
Maintainers
1
Install size
54.4 kB
Created
Weekly downloads
 

Package description

What is is-arrayish?

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.

What are is-arrayish's main functionalities?

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

Other packages similar to is-arrayish

Readme

Source

node-is-arrayish Travis-CI.org Build Status Coveralls.io Coverage Rating

Determines if an object can be used like an Array

Example

var isArrayish = require('is-arrayish');

isArrayish([]); // true
isArrayish({__proto__: []}); // true
isArrayish({}); // false
isArrayish({length:10}); // false

License

Licensed under the MIT License. You can find a copy of it in LICENSE.

Keywords

FAQs

Last updated on 19 Jun 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc