5 лабараторная
This commit is contained in:
20
node_modules/array.prototype.flatmap/.editorconfig
generated
vendored
Normal file
20
node_modules/array.prototype.flatmap/.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
|
||||
34
node_modules/array.prototype.flatmap/.eslintrc
generated
vendored
Normal file
34
node_modules/array.prototype.flatmap/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"new-cap": [2, {
|
||||
"capIsNewExceptions": [
|
||||
"ArraySpeciesCreate",
|
||||
"Call",
|
||||
"CreateDataPropertyOrThrow",
|
||||
"FlattenIntoArray",
|
||||
"Get",
|
||||
"HasProperty",
|
||||
"IsArray",
|
||||
"IsCallable",
|
||||
"Set",
|
||||
"ToLength",
|
||||
"ToObject",
|
||||
"ToString",
|
||||
]
|
||||
}],
|
||||
"no-magic-numbers": 0,
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"no-invalid-this": [1],
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
12
node_modules/array.prototype.flatmap/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/array.prototype.flatmap/.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.flatmap
|
||||
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']
|
||||
9
node_modules/array.prototype.flatmap/.nycrc
generated
vendored
Normal file
9
node_modules/array.prototype.flatmap/.nycrc
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
122
node_modules/array.prototype.flatmap/CHANGELOG.md
generated
vendored
Normal file
122
node_modules/array.prototype.flatmap/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.3.3](https://github.com/es-shims/Array.prototype.flatMap/compare/v1.3.2...v1.3.3) - 2024-12-15
|
||||
|
||||
### Commits
|
||||
|
||||
- [actions] split out node 10-20, and 20+ [`8727281`](https://github.com/es-shims/Array.prototype.flatMap/commit/87272812ed6ade6935c7429ee1daf1cfa54115ef)
|
||||
- [Tests] add test coverage [`6e78327`](https://github.com/es-shims/Array.prototype.flatMap/commit/6e7832790c36b320880f4b6d38dc31388d1fae3a)
|
||||
- [Deps] update `call-bind`, `es-abstract` [`e027dd1`](https://github.com/es-shims/Array.prototype.flatMap/commit/e027dd10ee63b3c3a98cc7e6ce8ad42b1100bdc9)
|
||||
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `auto-changelog`, `object-inspect`, `tape` [`7322d84`](https://github.com/es-shims/Array.prototype.flatMap/commit/7322d841e87ab17e4b929e92e73e8a20c3daf544)
|
||||
- [Dev Deps] update `aud`, `npmignore`, `object-inspect`, `tape` [`958bf5c`](https://github.com/es-shims/Array.prototype.flatMap/commit/958bf5c982cb0c4941dc2a6e873883e9f2c8d535)
|
||||
- [Deps] update `call-bind`, `define-properties`, `es-abstract`, `es-shim-unscopables` [`b3698fb`](https://github.com/es-shims/Array.prototype.flatMap/commit/b3698fb2320992f5ab85a486d1adef0105f739aa)
|
||||
- [Tests] replace `aud` with `npm audit` [`e0461ed`](https://github.com/es-shims/Array.prototype.flatMap/commit/e0461ed2288d37e2d878e3e64569313c04af6a64)
|
||||
- [Dev Deps] add missing peer dep [`e7160b5`](https://github.com/es-shims/Array.prototype.flatMap/commit/e7160b5ef9d624300cc189696e8019adaf6d67fc)
|
||||
|
||||
## [v1.3.2](https://github.com/es-shims/Array.prototype.flatMap/compare/v1.3.1...v1.3.2) - 2023-09-06
|
||||
|
||||
### Commits
|
||||
|
||||
- [Deps] update `define-properties`, `es-abstract` [`1737863`](https://github.com/es-shims/Array.prototype.flatMap/commit/17378634d56fc4b75027764b54804d89c6f8d60f)
|
||||
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`2337759`](https://github.com/es-shims/Array.prototype.flatMap/commit/23377597983440102805d36f701408505b433ccd)
|
||||
|
||||
## [v1.3.1](https://github.com/es-shims/Array.prototype.flatMap/compare/v1.3.0...v1.3.1) - 2022-11-02
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`3587a34`](https://github.com/es-shims/Array.prototype.flatMap/commit/3587a34ca111ec36ffc46b4131f5b32d4d8a357c)
|
||||
- [meta] add `auto-changelog` [`d66bdea`](https://github.com/es-shims/Array.prototype.flatMap/commit/d66bdeac56f2c1803a72695230c80d8270ab2ecf)
|
||||
- [Deps] update `define-properties`, `es-abstract` [`d64c486`](https://github.com/es-shims/Array.prototype.flatMap/commit/d64c48639ec4958ed9a2627a4d7315ac1404687a)
|
||||
- [actions] update rebase action to use reusable workflow [`8d657d0`](https://github.com/es-shims/Array.prototype.flatMap/commit/8d657d094a2aafa7948eee73eaa0e56047c5d60d)
|
||||
- [Dev Deps] update `aud`, `object-inspect`, `tape` [`aa22741`](https://github.com/es-shims/Array.prototype.flatMap/commit/aa22741a4bbe8db6d448cc4ca5417ddec90ac01d)
|
||||
- [Tests] use `for-each` instead of `foreach` [`748a78d`](https://github.com/es-shims/Array.prototype.flatMap/commit/748a78dbddb08462c75916fde07746d34cfd5c5c)
|
||||
|
||||
<!-- auto-changelog-above -->
|
||||
|
||||
1.3.0 / 2022-04-11
|
||||
=================
|
||||
* [New] `shim`/`auto`: add `flatMap` to `Symbol.unscopables`
|
||||
* [Deps] update `call-bind`, `es-abstract`
|
||||
* [actions] reuse common workflows
|
||||
* [actions] update codecov uploader
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `auto-changelog`, `object-inspect`, `safe-publish-latest`, `tape`
|
||||
|
||||
1.2.5 / 2021-10-01
|
||||
=================
|
||||
* [readme] add github actions/codecov badges; update description; remove travis badge
|
||||
* [Deps] update `call-bind`, `es-abstract`; remove unused `function-bind`
|
||||
* [meta] use `prepublishOnly`, for npm 7+
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `has-strict-mode`, `object-inspect`, `tape`
|
||||
* [actions] update workflows
|
||||
* [actions] use `node/install` instead of `node/run`; use `codecov` action
|
||||
* [Tests] increase coverage
|
||||
|
||||
1.2.4 / 2020-11-18
|
||||
=================
|
||||
* [Deps] update `es-abstract`; use `call-bind` where applicable
|
||||
* [meta] do not publish github action workflows
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape`; add `aud`
|
||||
* [Tests] migrate tests to Github Actions
|
||||
* [Tests] run `nyc` on all tests
|
||||
* [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner
|
||||
* [actions] add "Allow Edits" workflow
|
||||
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
|
||||
|
||||
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] add `funding` field
|
||||
* [Tests] use shared travis-ci configs
|
||||
* [actions] add automatic rebasing / merge commit blocking
|
||||
|
||||
1.2.2 / 2019-10-10
|
||||
=================
|
||||
* [Refactor] rename callback argument to `mapperFunction`, to match spec
|
||||
* [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] up to `node` `v12.11`, `v11.15`, `v10.16`, `v9.11`, `v8.16`, `v6.17`, `v4.9`; use `nvm install-latest-npm`
|
||||
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
|
||||
|
||||
1.2.1 / 2018-02-23
|
||||
=================
|
||||
* [Fix] Temporarily hack main entry, so it's compatible with other resolvers
|
||||
* [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`, `object-inspect`
|
||||
* [Tests] up to `node` `v9.4`
|
||||
|
||||
1.1.1 / 2017-11-29
|
||||
=================
|
||||
* [Fix] avoid an extra hole in the array (#1)
|
||||
* [Deps] update `es-abstract`
|
||||
* [Dev Deps] update `eslint`, `nsp`, `object-inspect`
|
||||
* [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.flatmap/LICENSE
generated
vendored
Normal file
21
node_modules/array.prototype.flatmap/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.
|
||||
82
node_modules/array.prototype.flatmap/README.md
generated
vendored
Normal file
82
node_modules/array.prototype.flatmap/README.md
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
# array.prototype.flatmap <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-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.flatMap` 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 [spec](https://tc39.es/ecma262/#sec-array.prototype.flatmap).
|
||||
|
||||
Because `Array.prototype.flatMap` 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.flatmap
|
||||
```
|
||||
|
||||
## Usage/Examples
|
||||
|
||||
```js
|
||||
var flatMap = require('array.prototype.flatmap');
|
||||
var assert = require('assert');
|
||||
|
||||
var arr = [1, [2], [], 3];
|
||||
|
||||
var results = flatMap(arr, function (x, i) {
|
||||
assert.equal(x, arr[i]);
|
||||
return x;
|
||||
});
|
||||
|
||||
assert.deepEqual(results, [1, 2, 3]);
|
||||
```
|
||||
|
||||
```js
|
||||
var flatMap = require('array.prototype.flatmap');
|
||||
var assert = require('assert');
|
||||
/* when Array#flatMap is not present */
|
||||
delete Array.prototype.flatMap;
|
||||
var shimmedFlatMap = flatMap.shim();
|
||||
|
||||
var mapper = function (x) { return [x, 1]; };
|
||||
|
||||
assert.equal(shimmedFlatMap, flatMap.getPolyfill());
|
||||
assert.deepEqual(arr.flatMap(mapper), flatMap(arr, mapper));
|
||||
```
|
||||
|
||||
```js
|
||||
var flatMap = require('array.prototype.flatmap');
|
||||
var assert = require('assert');
|
||||
/* when Array#flatMap is present */
|
||||
var shimmedIncludes = flatMap.shim();
|
||||
|
||||
var mapper = function (x) { return [x, 1]; };
|
||||
|
||||
assert.equal(shimmedIncludes, Array.prototype.flatMap);
|
||||
assert.deepEqual(arr.flatMap(mapper), flatMap(arr, mapper));
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.org/package/array.prototype.flatmap
|
||||
[npm-version-svg]: https://versionbadg.es/es-shims/Array.prototype.flatMap.svg
|
||||
[deps-svg]: https://david-dm.org/es-shims/Array.prototype.flatMap.svg
|
||||
[deps-url]: https://david-dm.org/es-shims/Array.prototype.flatMap
|
||||
[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.flatMap/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.flatMap#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/array.prototype.flatmap.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/array.prototype.flatmap.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/array.prototype.flatmap.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=array.prototype.flatmap
|
||||
[codecov-image]: https://codecov.io/gh/es-shims/Array.prototype.flatMap/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/es-shims/Array.prototype.flatMap/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Array.prototype.flatMap
|
||||
[actions-url]: https://github.com/es-shims/Array.prototype.flatMap/actions
|
||||
3
node_modules/array.prototype.flatmap/auto.js
generated
vendored
Normal file
3
node_modules/array.prototype.flatmap/auto.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
require('./shim')();
|
||||
26
node_modules/array.prototype.flatmap/implementation.js
generated
vendored
Normal file
26
node_modules/array.prototype.flatmap/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
var ArraySpeciesCreate = require('es-abstract/2024/ArraySpeciesCreate');
|
||||
var FlattenIntoArray = require('es-abstract/2024/FlattenIntoArray');
|
||||
var Get = require('es-abstract/2024/Get');
|
||||
var IsCallable = require('es-abstract/2024/IsCallable');
|
||||
var ToLength = require('es-abstract/2024/ToLength');
|
||||
var ToObject = require('es-abstract/2024/ToObject');
|
||||
|
||||
module.exports = function flatMap(mapperFunction) {
|
||||
var O = ToObject(this);
|
||||
var sourceLen = ToLength(Get(O, 'length'));
|
||||
|
||||
if (!IsCallable(mapperFunction)) {
|
||||
throw new TypeError('mapperFunction must be a function');
|
||||
}
|
||||
|
||||
var T;
|
||||
if (arguments.length > 1) {
|
||||
T = arguments[1];
|
||||
}
|
||||
|
||||
var A = ArraySpeciesCreate(O, 0);
|
||||
FlattenIntoArray(A, O, sourceLen, 0, 1, mapperFunction, T);
|
||||
return A;
|
||||
};
|
||||
19
node_modules/array.prototype.flatmap/index.js
generated
vendored
Normal file
19
node_modules/array.prototype.flatmap/index.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var callBind = require('call-bind');
|
||||
|
||||
var implementation = require('./implementation');
|
||||
var getPolyfill = require('./polyfill');
|
||||
var polyfill = getPolyfill();
|
||||
var shim = require('./shim');
|
||||
|
||||
var boundFlatMap = callBind(polyfill);
|
||||
|
||||
define(boundFlatMap, {
|
||||
getPolyfill: getPolyfill,
|
||||
implementation: implementation,
|
||||
shim: shim
|
||||
});
|
||||
|
||||
module.exports = boundFlatMap;
|
||||
111
node_modules/array.prototype.flatmap/package.json
generated
vendored
Normal file
111
node_modules/array.prototype.flatmap/package.json
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"name": "array.prototype.flatmap",
|
||||
"version": "1.3.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.flatMap` shim/polyfill/replacement that works as far down as ES3.",
|
||||
"license": "MIT",
|
||||
"main": "index",
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "npx npm@'>= 10.2' audit --production",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"prelint": "evalmd README.md",
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"postlint": "es-shim-api --bound",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/es-shims/Array.prototype.flatMap.git"
|
||||
},
|
||||
"keywords": [
|
||||
"Array.prototype.flatMap",
|
||||
"flatMap",
|
||||
"array",
|
||||
"ESnext",
|
||||
"shim",
|
||||
"polyfill",
|
||||
"flatten",
|
||||
"Array.prototype.flatten",
|
||||
"es-shim API"
|
||||
],
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.8",
|
||||
"define-properties": "^1.2.1",
|
||||
"es-abstract": "^1.23.5",
|
||||
"es-shim-unscopables": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@es-shims/api": "^2.5.1",
|
||||
"@ljharb/eslint-config": "^21.1.1",
|
||||
"auto-changelog": "^2.5.0",
|
||||
"encoding": "^0.1.13",
|
||||
"eslint": "=8.8.0",
|
||||
"evalmd": "^0.0.19",
|
||||
"for-each": "^0.3.3",
|
||||
"has-strict-mode": "^1.0.1",
|
||||
"in-publish": "^2.0.1",
|
||||
"npmignore": "^0.3.1",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.13.3",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.9.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"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true,
|
||||
"startingVersion": "1.3.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
||||
7
node_modules/array.prototype.flatmap/polyfill.js
generated
vendored
Normal file
7
node_modules/array.prototype.flatmap/polyfill.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
module.exports = function getPolyfill() {
|
||||
return Array.prototype.flatMap || implementation;
|
||||
};
|
||||
20
node_modules/array.prototype.flatmap/shim.js
generated
vendored
Normal file
20
node_modules/array.prototype.flatmap/shim.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var shimUnscopables = require('es-shim-unscopables');
|
||||
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimFlatMap() {
|
||||
var polyfill = getPolyfill();
|
||||
|
||||
define(
|
||||
Array.prototype,
|
||||
{ flatMap: polyfill },
|
||||
{ flatMap: function () { return Array.prototype.flatMap !== polyfill; } }
|
||||
);
|
||||
|
||||
shimUnscopables('flatMap');
|
||||
|
||||
return polyfill;
|
||||
};
|
||||
20
node_modules/array.prototype.flatmap/test/implementation.js
generated
vendored
Normal file
20
node_modules/array.prototype.flatmap/test/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var flatMap = require('../implementation');
|
||||
var callBind = require('call-bind');
|
||||
var test = require('tape');
|
||||
var hasStrictMode = require('has-strict-mode')();
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('as a function', function (t) {
|
||||
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
|
||||
/* eslint no-useless-call: 0 */
|
||||
st['throws'](function () { flatMap.call(undefined); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { flatMap.call(null); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(callBind(flatMap), t);
|
||||
|
||||
t.end();
|
||||
});
|
||||
18
node_modules/array.prototype.flatmap/test/index.js
generated
vendored
Normal file
18
node_modules/array.prototype.flatmap/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var flatMap = require('../');
|
||||
var test = require('tape');
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('as a function', function (t) {
|
||||
t.test('bad array/this value', function (st) {
|
||||
/* eslint no-useless-call: 0 */
|
||||
st['throws'](function () { flatMap.call(undefined, function () {}); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { flatMap.call(null, function () {}); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(flatMap, t);
|
||||
|
||||
t.end();
|
||||
});
|
||||
36
node_modules/array.prototype.flatmap/test/shimmed.js
generated
vendored
Normal file
36
node_modules/array.prototype.flatmap/test/shimmed.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
require('../auto');
|
||||
|
||||
var test = require('tape');
|
||||
var defineProperties = require('define-properties');
|
||||
var callBind = require('call-bind');
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var functionsHaveNames = function f() {}.name === 'f';
|
||||
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('shimmed', function (t) {
|
||||
t.equal(Array.prototype.flatMap.length, 1, 'Array#flatMap has a length of 1');
|
||||
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
|
||||
st.equal(Array.prototype.flatMap.name, 'flatMap', 'Array#flatMap has name "flatMap"');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
|
||||
et.equal(false, isEnumerable.call(Array.prototype, 'flatMap'), 'Array#flatMap 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.flatMap.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { return Array.prototype.flatMap.call(null, 'a'); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(callBind(Array.prototype.flatMap), t);
|
||||
|
||||
t.end();
|
||||
});
|
||||
61
node_modules/array.prototype.flatmap/test/tests.js
generated
vendored
Normal file
61
node_modules/array.prototype.flatmap/test/tests.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('object-inspect');
|
||||
var forEach = require('for-each');
|
||||
|
||||
module.exports = function (flatMap, t) {
|
||||
t.test('callback function', function (st) {
|
||||
forEach([[], {}, true, false, 42, 'foo', /a/g, null], function (nonFunction) {
|
||||
st['throws'](
|
||||
function () { flatMap([], nonFunction); },
|
||||
TypeError,
|
||||
inspect(nonFunction) + ' is not a function'
|
||||
);
|
||||
});
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('flatMaps', function (st) {
|
||||
var mapped = flatMap([1, [2], [3, 4]], function (x, i) {
|
||||
return [x, i];
|
||||
});
|
||||
|
||||
var expected = [1, 0, [2], 1, [3, 4], 2];
|
||||
st.deepEqual(mapped, expected, 'array is flattened and mapped to tuples of item/index');
|
||||
st.equal(mapped.length, expected.length, 'array has expected length');
|
||||
|
||||
var context = {};
|
||||
var actual;
|
||||
flatMap([1], function () { actual = this; }, context);
|
||||
st.equal(actual, context, 'thisArg works as expected');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('sparse arrays', function (st) {
|
||||
var identity = function (x) { return x; };
|
||||
// eslint-disable-next-line no-sparse-arrays
|
||||
st.deepEqual(flatMap([, [1]], identity), flatMap([[], [1]], identity), 'an array hole is treated the same as an empty array');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('test262: staging test from v8', function (st) {
|
||||
var arr1 = [0, 1, 2, 3];
|
||||
var f = function (e) {
|
||||
arr1[4] = 42;
|
||||
return e;
|
||||
};
|
||||
st.deepEqual(flatMap(arr1, f), [0, 1, 2, 3]);
|
||||
|
||||
var arr2 = [0, 1, 2, 3];
|
||||
var g = function (e) {
|
||||
arr2.length = 3;
|
||||
return e;
|
||||
};
|
||||
st.deepEqual(flatMap(arr2, g), [0, 1, 2]);
|
||||
|
||||
st.end();
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user