Gathering detailed insights and metrics for @hishprorg/optio-incidunt
Gathering detailed insights and metrics for @hishprorg/optio-incidunt
npm install @hishprorg/optio-incidunt
Typescript
Module System
Node Version
NPM Version
63
Supply Chain
82.2
Quality
85.4
Maintenance
100
Vulnerability
99.6
License
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
22
Last Day
1
Last Week
2
Last Month
5
Last Year
22
Latest Version
2.5.32
Package Id
@hishprorg/optio-incidunt@2.5.32
Unpacked Size
76.48 kB
Size
38.58 kB
File Count
183
NPM Version
10.7.0
Node Version
20.15.0
Published on
Jul 03, 2024
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
66.7%
5
Compared to previous month
Last Year
0%
22
Compared to previous year
43
An ES2019 spec-compliant Array.prototype.flat
shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.
Because Array.prototype.flat
depends on a receiver (the this
value), the main export takes the array to operate on as the first argument.
1npm install --save @hishprorg/optio-incidunt
1var flat = require('@hishprorg/optio-incidunt'); 2var assert = require('assert'); 3 4var arr = [1, [2], [], 3, [[4]]]; 5 6assert.deepEqual(flat(arr, 1), [1, 2, 3, [4]]);
1var flat = require('@hishprorg/optio-incidunt'); 2var assert = require('assert'); 3/* when Array#flat is not present */ 4delete Array.prototype.flat; 5var shimmedFlat = flat.shim(); 6 7assert.equal(shimmedFlat, flat.getPolyfill()); 8assert.deepEqual(arr.flat(), flat(arr));
1var flat = require('@hishprorg/optio-incidunt'); 2var assert = require('assert'); 3/* when Array#flat is present */ 4var shimmedIncludes = flat.shim(); 5 6var mapper = function (x) { return [x, 1]; }; 7 8assert.equal(shimmedIncludes, Array.prototype.flat); 9assert.deepEqual(arr.flat(mapper), flat(arr, mapper));
Simply clone the repo, npm install
, and run npm test
No vulnerabilities found.
No security vulnerabilities found.