Regenerating node_modules
This commit is contained in:
parent
09b4a82c83
commit
c96f84308a
5488 changed files with 487362 additions and 60779 deletions
20
node_modules/array.prototype.flat/.editorconfig
generated
vendored
Normal file
20
node_modules/array.prototype.flat/.editorconfig
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 150
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
||||
40
node_modules/array.prototype.flat/.eslintrc
generated
vendored
Normal file
40
node_modules/array.prototype.flat/.eslintrc
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"array-bracket-newline": 0,
|
||||
"array-element-newline": 0,
|
||||
"func-name-matching": 0,
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
"multiline-comment-style": 0,
|
||||
"new-cap": [2, {
|
||||
"capIsNewExceptions": [
|
||||
"ArraySpeciesCreate",
|
||||
"Call",
|
||||
"CreateDataPropertyOrThrow",
|
||||
"FlattenIntoArray",
|
||||
"Get",
|
||||
"HasProperty",
|
||||
"IsArray",
|
||||
"Set",
|
||||
"ToInteger",
|
||||
"ToLength",
|
||||
"ToObject",
|
||||
"ToString"
|
||||
]
|
||||
}],
|
||||
"no-magic-numbers": 0,
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"max-params": 0,
|
||||
"no-invalid-this": [1],
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
12
node_modules/array.prototype.flat/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/array.prototype.flat/.github/FUNDING.yml
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/array.prototype.flat
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
15
node_modules/array.prototype.flat/.github/workflows/rebase.yml
generated
vendored
Normal file
15
node_modules/array.prototype.flat/.github/workflows/rebase.yml
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
name: Automatic Rebase
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
_:
|
||||
name: "Automatic Rebase"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: ljharb/rebase@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
13
node_modules/array.prototype.flat/.nycrc
generated
vendored
Normal file
13
node_modules/array.prototype.flat/.nycrc
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"all": true,
|
||||
"check-coverage": true,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"lines": 96,
|
||||
"statements": 96,
|
||||
"functions": 80,
|
||||
"branches": 87,
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
9
node_modules/array.prototype.flat/.travis.yml
generated
vendored
Normal file
9
node_modules/array.prototype.flat/.travis.yml
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
version: ~> 1.0
|
||||
language: node_js
|
||||
os:
|
||||
- linux
|
||||
import:
|
||||
- ljharb/travis-ci:node/all.yml
|
||||
- ljharb/travis-ci:node/pretest.yml
|
||||
- ljharb/travis-ci:node/posttest.yml
|
||||
- ljharb/travis-ci:node/coverage.yml
|
||||
53
node_modules/array.prototype.flat/CHANGELOG.md
generated
vendored
Normal file
53
node_modules/array.prototype.flat/CHANGELOG.md
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
1.2.3 / 2019-12-12
|
||||
=================
|
||||
* [Refactor] use split-up `es-abstract` (65% bundle size decrease)
|
||||
* [Deps] update `es-abstract`
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `object-inspect`
|
||||
* [meta] ESnext -> ES2019
|
||||
* [meta] add `funding` field
|
||||
* [Tests] use shared travis-ci configs
|
||||
* [actions] add automatic rebasing / merge commit blocking
|
||||
|
||||
1.2.2 / 2019-10-10
|
||||
=================
|
||||
* [Deps] update `es-abstract`, `define-properties`
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `evalmd`, `object-inspect`, `safe-publish-latest`, `tape`
|
||||
* [meta] create FUNDING.yml
|
||||
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
|
||||
* [Tests] up to `node` `v12.11`, `v11.15`, `v10.16`, `v9.11`, `v8.16`, `v6.17`, `v4.9`; use `nvm install-latest-npm`
|
||||
|
||||
1.2.1 / 2018-02-23
|
||||
=================
|
||||
* [Fix] Temporarily hack main entry, so it's compatible with other resolvers (#3)
|
||||
* [Dev Deps] update `eslint`, `nsp`, `tape`
|
||||
* [Tests] up to `node` `v9.6`, `v6.13`
|
||||
|
||||
1.2.0 / 2018-01-18
|
||||
=================
|
||||
* [New] add "auto" entry point
|
||||
* [Fix] Move the receiver length check higher
|
||||
* [Fix] spec adjustments
|
||||
* [Refactor] adjust shouldFlatten logic
|
||||
* [Dev Deps] update `eslint`
|
||||
* [Tests] up to `node` `v9.4`
|
||||
|
||||
1.1.1 / 2017-11-29
|
||||
=================
|
||||
* [Fix] avoid an extra hole in the array (https://github.com/es-shims/Array.prototype.flatMap/issues/1)
|
||||
* [Deps] update `es-abstract`
|
||||
* [Dev Deps] update `eslint`, `nsp`
|
||||
* [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; pin included builds to LTS.
|
||||
|
||||
1.1.0 / 2017-10-03
|
||||
=================
|
||||
* [New] add explicit setting of “length” on target array
|
||||
* [Fix] `FlattenIntoArray`: add assertion that `thisArg` and `mapperFunction` are both passed together
|
||||
* [Tests] make coverage required
|
||||
|
||||
1.0.1 / 2017-10-02
|
||||
=================
|
||||
* Add readme
|
||||
|
||||
1.0.0 / 2017-10-01
|
||||
=================
|
||||
* Initial release
|
||||
21
node_modules/array.prototype.flat/LICENSE
generated
vendored
Normal file
21
node_modules/array.prototype.flat/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 ECMAScript Shims
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
72
node_modules/array.prototype.flat/README.md
generated
vendored
Normal file
72
node_modules/array.prototype.flat/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
# array.prototype.flat <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![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 ES2019 spec-compliant `Array.prototype.flat` shim/polyfill/replacement that works as far down as ES3.
|
||||
|
||||
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 proposed [spec](https://tc39.github.io/proposal-flatMap/).
|
||||
|
||||
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
|
||||
|
||||
```sh
|
||||
npm install --save array.prototype.flat
|
||||
```
|
||||
|
||||
## Usage/Examples
|
||||
|
||||
```js
|
||||
var flat = require('array.prototype.flat');
|
||||
var assert = require('assert');
|
||||
|
||||
var arr = [1, [2], [], 3, [[4]]];
|
||||
|
||||
assert.deepEqual(flat(arr, 1), [1, 2, 3, [4]]);
|
||||
```
|
||||
|
||||
```js
|
||||
var flat = require('array.prototype.flat');
|
||||
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));
|
||||
```
|
||||
|
||||
```js
|
||||
var flat = require('array.prototype.flat');
|
||||
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`
|
||||
|
||||
[package-url]: https://npmjs.org/package/array.prototype.flat
|
||||
[npm-version-svg]: http://versionbadg.es/es-shims/Array.prototype.flat.svg
|
||||
[travis-svg]: https://travis-ci.org/es-shims/Array.prototype.flat.svg
|
||||
[travis-url]: https://travis-ci.org/es-shims/Array.prototype.flat
|
||||
[deps-svg]: https://david-dm.org/es-shims/Array.prototype.flat.svg
|
||||
[deps-url]: https://david-dm.org/es-shims/Array.prototype.flat
|
||||
[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.flat/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.flat#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/array.prototype.flat.png?downloads=true&stars=true
|
||||
[license-image]: http://img.shields.io/npm/l/array.prototype.flat.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: http://img.shields.io/npm/dm/array.prototype.flat.svg
|
||||
[downloads-url]: http://npm-stat.com/charts.html?package=array.prototype.flat
|
||||
3
node_modules/array.prototype.flat/auto.js
generated
vendored
Normal file
3
node_modules/array.prototype.flat/auto.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
'use strict';
|
||||
|
||||
require('./shim')();
|
||||
22
node_modules/array.prototype.flat/implementation.js
generated
vendored
Normal file
22
node_modules/array.prototype.flat/implementation.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
var ArraySpeciesCreate = require('es-abstract/2019/ArraySpeciesCreate');
|
||||
var FlattenIntoArray = require('es-abstract/2019/FlattenIntoArray');
|
||||
var Get = require('es-abstract/2019/Get');
|
||||
var ToInteger = require('es-abstract/2019/ToInteger');
|
||||
var ToLength = require('es-abstract/2019/ToLength');
|
||||
var ToObject = require('es-abstract/2019/ToObject');
|
||||
|
||||
module.exports = function flat() {
|
||||
var O = ToObject(this);
|
||||
var sourceLen = ToLength(Get(O, 'length'));
|
||||
|
||||
var depthNum = 1;
|
||||
if (arguments.length > 0 && typeof arguments[0] !== 'undefined') {
|
||||
depthNum = ToInteger(arguments[0]);
|
||||
}
|
||||
|
||||
var A = ArraySpeciesCreate(O, 0);
|
||||
FlattenIntoArray(A, O, sourceLen, 0, depthNum);
|
||||
return A;
|
||||
};
|
||||
19
node_modules/array.prototype.flat/index.js
generated
vendored
Normal file
19
node_modules/array.prototype.flat/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var callBind = require('es-abstract/helpers/callBind');
|
||||
|
||||
var implementation = require('./implementation');
|
||||
var getPolyfill = require('./polyfill');
|
||||
var polyfill = getPolyfill();
|
||||
var shim = require('./shim');
|
||||
|
||||
var boundFlat = callBind(polyfill);
|
||||
|
||||
define(boundFlat, {
|
||||
getPolyfill: getPolyfill,
|
||||
implementation: implementation,
|
||||
shim: shim
|
||||
});
|
||||
|
||||
module.exports = boundFlat;
|
||||
96
node_modules/array.prototype.flat/package.json
generated
vendored
Normal file
96
node_modules/array.prototype.flat/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
"name": "array.prototype.flat",
|
||||
"version": "1.2.3",
|
||||
"author": {
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com",
|
||||
"url": "http://ljharb.codes"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com",
|
||||
"url": "http://ljharb.codes"
|
||||
}
|
||||
],
|
||||
"description": "An ES2019 spec-compliant `Array.prototype.flat` shim/polyfill/replacement that works as far down as ES3.",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepublish": "safe-publish-latest",
|
||||
"pretest": "npm run --silent lint && evalmd README.md",
|
||||
"test": "npm run --silent tests-only",
|
||||
"posttest": "npx aud --production",
|
||||
"pretests-only": "es-shim-api --bound",
|
||||
"tests-only": "npm run --silent test:shimmed && npm run --silent test:module",
|
||||
"test:shimmed": "node test/shimmed",
|
||||
"test:module": "node test",
|
||||
"coverage": "nyc npm run tests-only",
|
||||
"lint": "eslint test/*.js *.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/es-shims/Array.prototype.flat.git"
|
||||
},
|
||||
"keywords": [
|
||||
"Array.prototype.flatten",
|
||||
"Array.prototype.flat",
|
||||
"flatten",
|
||||
"flat",
|
||||
"array",
|
||||
"ESnext",
|
||||
"shim",
|
||||
"polyfill",
|
||||
"flatMap",
|
||||
"Array.prototype.flatMap",
|
||||
"es-shim API"
|
||||
],
|
||||
"dependencies": {
|
||||
"define-properties": "^1.1.3",
|
||||
"es-abstract": "^1.17.0-next.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@es-shims/api": "^2.1.2",
|
||||
"@ljharb/eslint-config": "^15.0.2",
|
||||
"covert": "^1.1.1",
|
||||
"eslint": "^6.7.2",
|
||||
"evalmd": "0.0.19",
|
||||
"function-bind": "^1.1.1",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.7.0",
|
||||
"safe-publish-latest": "^1.1.4",
|
||||
"tape": "^4.11.0"
|
||||
},
|
||||
"testling": {
|
||||
"files": [
|
||||
"test/index.js",
|
||||
"test/shimmed.js"
|
||||
],
|
||||
"browsers": [
|
||||
"iexplore/6.0..latest",
|
||||
"firefox/3.0..6.0",
|
||||
"firefox/15.0..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/4.0..10.0",
|
||||
"chrome/20.0..latest",
|
||||
"chrome/canary",
|
||||
"opera/10.0..latest",
|
||||
"opera/next",
|
||||
"safari/4.0..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"greenkeeper": {
|
||||
"ignore": [
|
||||
"nyc"
|
||||
]
|
||||
}
|
||||
}
|
||||
7
node_modules/array.prototype.flat/polyfill.js
generated
vendored
Normal file
7
node_modules/array.prototype.flat/polyfill.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
module.exports = function getPolyfill() {
|
||||
return Array.prototype.flat || implementation;
|
||||
};
|
||||
14
node_modules/array.prototype.flat/shim.js
generated
vendored
Normal file
14
node_modules/array.prototype.flat/shim.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimFlat() {
|
||||
var polyfill = getPolyfill();
|
||||
define(
|
||||
Array.prototype,
|
||||
{ flat: polyfill },
|
||||
{ flat: function () { return Array.prototype.flat !== polyfill; } }
|
||||
);
|
||||
return polyfill;
|
||||
};
|
||||
17
node_modules/array.prototype.flat/test/index.js
generated
vendored
Normal file
17
node_modules/array.prototype.flat/test/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
'use strict';
|
||||
|
||||
var flatten = require('../');
|
||||
var test = require('tape');
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('as a function', function (t) {
|
||||
t.test('bad array/this value', function (st) {
|
||||
st['throws'](flatten.bind(null, undefined, function () {}), TypeError, 'undefined is not an object');
|
||||
st['throws'](flatten.bind(null, null, function () {}), TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(flatten, t);
|
||||
|
||||
t.end();
|
||||
});
|
||||
36
node_modules/array.prototype.flat/test/shimmed.js
generated
vendored
Normal file
36
node_modules/array.prototype.flat/test/shimmed.js
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
require('../shim')();
|
||||
|
||||
var test = require('tape');
|
||||
var defineProperties = require('define-properties');
|
||||
var bind = require('function-bind');
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var functionsHaveNames = function f() {}.name === 'f';
|
||||
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('shimmed', function (t) {
|
||||
t.equal(Array.prototype.flat.length, 0, 'Array#flat has a length of 0');
|
||||
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
|
||||
st.equal(Array.prototype.flat.name, 'flat', 'Array#flat has name "flat"');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
|
||||
et.equal(false, isEnumerable.call(Array.prototype, 'flat'), 'Array#flat is not enumerable');
|
||||
et.end();
|
||||
});
|
||||
|
||||
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
|
||||
|
||||
t.test('bad array/this value', { skip: !supportsStrictMode }, function (st) {
|
||||
st['throws'](function () { return Array.prototype.flat.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { return Array.prototype.flat.call(null, 'a'); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(bind.call(Function.call, Array.prototype.flat), t);
|
||||
|
||||
t.end();
|
||||
});
|
||||
30
node_modules/array.prototype.flat/test/tests.js
generated
vendored
Normal file
30
node_modules/array.prototype.flat/test/tests.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
var testArray = function testArray(t, actual, expected, msg) {
|
||||
t.deepEqual(actual, expected, msg);
|
||||
t.equal(actual.length, expected.length, 'expected ' + expected.length + ', got ' + actual.length);
|
||||
};
|
||||
|
||||
module.exports = function (flat, t) {
|
||||
t.test('flattens', function (st) {
|
||||
testArray(t, flat([1, [2], [[3]], [[['four']]]]), [1, 2, [3], [['four']]], 'missing depth only flattens 1 deep');
|
||||
|
||||
testArray(t, flat([1, [2], [[3]], [[['four']]]], 1), [1, 2, [3], [['four']]], 'depth of 1 only flattens 1 deep');
|
||||
t.notDeepEqual(flat([1, [2], [[3]], [[['four']]]], 1), [1, 2, 3, ['four']], 'depth of 1 only flattens 1 deep: sanity check');
|
||||
|
||||
testArray(t, flat([1, [2], [[3]], [[['four']]]], 2), [1, 2, 3, ['four']], 'depth of 2 only flattens 2 deep');
|
||||
t.notDeepEqual(flat([1, [2], [[3]], [[['four']]]], 2), [1, 2, 3, 'four'], 'depth of 2 only flattens 2 deep: sanity check');
|
||||
|
||||
testArray(t, flat([1, [2], [[3]], [[['four']]]], 3), [1, 2, 3, 'four'], 'depth of 3 only flattens 3 deep');
|
||||
testArray(t, flat([1, [2], [[3]], [[['four']]]], Infinity), [1, 2, 3, 'four'], 'depth of Infinity flattens all the way');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('sparse arrays', function (st) {
|
||||
// eslint-disable-next-line no-sparse-arrays
|
||||
st.deepEqual(flat([, [1]]), flat([[], [1]]), 'an array hole is treated the same as an empty array');
|
||||
|
||||
st.end();
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue