Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-limits

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-limits

A way of telling that everything is possible

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

array-limits

NPM Version Downloads Stats

Just another way of telling that everything is possible.

Usage

Setting limit

const arr = [0, 0, 0, 0];  
  
arr.limit(4);  // if not set, defaults to 1000000
  
arr.push(0); // should throw an error since 4 is the limit of the array

Checking array's free space

const arr = [0, 0, 0];

console.log(arr.availableSpace()); // should return the available space of an array

checking if array is full

const arr = [0, 0, 0, 0];

console.log(arr.isFull()); // should return a boolean that tells if array is full or not

Note

  • This is not intended for something serious, the only reason of it's existence is to prove a point. Yes, everything is possible.

Keywords

FAQs

Package last updated on 22 Oct 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc