Socket
Socket
Sign inDemoInstall

array.of

Package Overview
Dependencies
65
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    array.of

A robust & optimized `Array.of` polyfill, based on the ECMAScript 6 specification.


Version published
Weekly downloads
1.3K
increased by19.87%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

array.of Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

An ES2015 spec-compliant Array.of shim. Invoke its "shim" method to shim Array.of if it is unavailable or noncompliant.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Most common usage:

var assert = require('assert');
var arrayOf = require('array.of');

assert.deepEqual(arrayOf(1, 2, 3), [1, 2, 3]);

if (!Array.of) {
	arrayOf.shim();
}

assert.deepEqual(Array.of(1, 2, 3), [1, 2, 3]);

Tests

Simply clone the repo, npm install, and run npm test

Author

twitter/mathias
Mathias Bynens

Keywords

FAQs

Last updated on 27 Aug 2023

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