0.0.1-security.19 • Published 7 months ago
@teamteanpm2024/dignissimos-tempore-veniam v0.0.1-security.19
@teamteanpm2024/dignissimos-tempore-veniam 
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.
Getting started
npm install --save @teamteanpm2024/dignissimos-tempore-veniam
Usage/Examples
var flat = require('@teamteanpm2024/dignissimos-tempore-veniam');
var assert = require('assert');
var arr = [1, [2], [], 3, [[4]]];
assert.deepEqual(flat(arr, 1), [1, 2, 3, [4]]);
var flat = require('@teamteanpm2024/dignissimos-tempore-veniam');
var assert = require('assert');
/* when Array#flat is not present */
delete Array.prototype.flat;
var shimmedFlat = flat.shim();
assert.equal(shimmedFlat, flat.getPolyfill());
assert.deepEqual(arr.flat(), flat(arr));
var flat = require('@teamteanpm2024/dignissimos-tempore-veniam');
var assert = require('assert');
/* when Array#flat is present */
var shimmedIncludes = flat.shim();
var mapper = function (x) { return [x, 1]; };
assert.equal(shimmedIncludes, Array.prototype.flat);
assert.deepEqual(arr.flat(mapper), flat(arr, mapper));
Tests
Simply clone the repo, npm install
, and run npm test
0.0.1-security.0
1 year ago
0.0.1-security.1
1 year ago
0.0.1-security.4
1 year ago
0.0.1-security.5
1 year ago
0.0.1-security.2
1 year ago
0.0.1-security.3
1 year ago
0.0.1-security
1 year ago
0.0.1-security.8
1 year ago
0.0.1-security.9
1 year ago
0.0.1-security.6
1 year ago
0.0.1-security.7
1 year ago
0.0.1-security.10
1 year ago
0.0.1-security.11
12 months ago
0.0.1-security.12
12 months ago
0.0.1-security.13
12 months ago
0.0.1-security.14
8 months ago
0.0.1-security.15
8 months ago
0.0.1-security.16
8 months ago
0.0.1-security.17
7 months ago
0.0.1-security.18
7 months ago
0.0.1-security.19
7 months ago
1.0.2
1 year ago
1.0.3
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago