Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mathiasbynens/Array.of
A robust & optimized ES3-compatible polyfill for the `Array.of` method in ECMAScript 6.
https://github.com/mathiasbynens/Array.of
Last synced: 3 months ago
JSON representation
A robust & optimized ES3-compatible polyfill for the `Array.of` method in ECMAScript 6.
- Host: GitHub
- URL: https://github.com/mathiasbynens/Array.of
- Owner: mathiasbynens
- License: mit
- Created: 2013-12-20T15:49:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T19:22:11.000Z (6 months ago)
- Last Synced: 2024-07-19T08:16:56.511Z (4 months ago)
- Language: JavaScript
- Homepage: https://mths.be/array-of
- Size: 68.4 KB
- Stars: 15
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
- es6-tools - `Array.of`
README
# array.of [![Version Badge][npm-version-svg]][package-url]
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url][![npm badge][npm-badge-png]][package-url]
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](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://tc39.es/ecma262/#sec-array.of).
Most common usage:
```js
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](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |[package-url]: https://npmjs.com/package/array.of
[npm-version-svg]: http://versionbadg.es/mathiasbynens/Array.of.svg
[travis-svg]: https://travis-ci.org/mathiasbynens/Array.of.svg
[travis-url]: https://travis-ci.org/mathiasbynens/Array.of
[deps-svg]: https://david-dm.org/mathiasbynens/Array.of.svg
[deps-url]: https://david-dm.org/mathiasbynens/Array.of
[dev-deps-svg]: https://david-dm.org/mathiasbynens/Array.of/dev-status.svg
[dev-deps-url]: https://david-dm.org/mathiasbynens/Array.of#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/array.of.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/array.of.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/array.of.svg
[downloads-url]: http://npm-stat.com/charts.html?package=array.of