main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

32
node_modules/es-get-iterator/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"consistent-return": 1,
"eqeqeq": [2, "always", { "null": "ignore" }],
"func-name-matching": 0,
"id-length": 0,
"multiline-comment-style": 0,
"new-cap": [2, {
"capIsNewExceptions": [
"GetIntrinsic",
],
}],
"no-magic-numbers": [1, {
"ignore": [1, 0xDC00, 0xD800, 0xDFFF, 0xDBFF],
}],
},
"overrides": [
{
"files": "test/**",
"rules": {
"max-lines-per-function": 0,
"no-magic-numbers": 0,
"no-new-func": 1,
},
},
],
}

12
node_modules/es-get-iterator/.github/FUNDING.yml generated vendored Normal file
View 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/es-get-iterator
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 a single custom sponsorship URL

9
node_modules/es-get-iterator/.nycrc generated vendored Normal file
View File

@@ -0,0 +1,9 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}

105
node_modules/es-get-iterator/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,105 @@
# 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).
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [v1.1.3](https://github.com/ljharb/es-get-iterator/compare/v1.1.2...v1.1.3) - 2023-01-12
### Commits
- [actions] reuse common workflows [`c97cb76`](https://github.com/ljharb/es-get-iterator/commit/c97cb764624f8c0e263695f1dcc9351b11000ea4)
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`6d09911`](https://github.com/ljharb/es-get-iterator/commit/6d09911097b54f59e6b3f3961f57dc594b3c649a)
- [meta] use `npmignore` to autogenerate an npmignore file [`c7e0e85`](https://github.com/ljharb/es-get-iterator/commit/c7e0e85212a756b0989f8ff24896f2a936a3fe20)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `es5-shim`, `object-inspect`, `tape` [`1353190`](https://github.com/ljharb/es-get-iterator/commit/13531904d91ee41ea22f02fd2bafd3034fba3758)
- [Refactor] extract logic to `stop-iteration-iterator` [`ab19956`](https://github.com/ljharb/es-get-iterator/commit/ab199561031139e4d5c8249cda77196ff2590aaf)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `es5-shim`, `object-inspect`, `safe-publish-latest`, `tape` [`de2ae73`](https://github.com/ljharb/es-get-iterator/commit/de2ae73a1c4395f4459450c11cd146fb73bee90c)
- [Tests] start testing more variants [`e059f33`](https://github.com/ljharb/es-get-iterator/commit/e059f33c5ab89043d731a3ea7c301301ed1b315b)
- [actions] update codecov uploader [`c8ffcec`](https://github.com/ljharb/es-get-iterator/commit/c8ffcec4ff8bfbab82e039f43d3283a345e7c94c)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `es5-shim`, `has-bigints`, `object-inspect`, `tape` [`8cd2e87`](https://github.com/ljharb/es-get-iterator/commit/8cd2e8716d5b175c5f90cce3999e5c0de3b5be69)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`7676030`](https://github.com/ljharb/es-get-iterator/commit/7676030b4aa2d41cb3579c1aaea55911a62ca9ee)
- [actions] update checkout action [`bdbe6c9`](https://github.com/ljharb/es-get-iterator/commit/bdbe6c9664eae9c87fa98128419b2d086a40988f)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `es6-shim` [`67cddd6`](https://github.com/ljharb/es-get-iterator/commit/67cddd66e4d9ad51fb9142ff3b1871b1b2fb1cf9)
- [Tests] fix debug output issues in FF 24 [`a726fdc`](https://github.com/ljharb/es-get-iterator/commit/a726fdce1defeb2e0fec0dcc7a645668d574a1ac)
- [Deps] update `has-symbols`, `is-arguments`, `is-string` [`044907b`](https://github.com/ljharb/es-get-iterator/commit/044907b42a2c1950855e9a2d1f455ba3595b2980)
- [Deps] update `get-intrinsic`, `has-symbols` [`e492f8f`](https://github.com/ljharb/es-get-iterator/commit/e492f8f3a1a1d47ed032303bcfebb5d75b756267)
- [meta] use `prepublishOnly` script for npm 7+ [`eccda6b`](https://github.com/ljharb/es-get-iterator/commit/eccda6bbfd20ed1c2ec1ad5c92c02169b50608e6)
- [Dev Deps] update `object-inspect` [`c24dfa5`](https://github.com/ljharb/es-get-iterator/commit/c24dfa542267132515128172955a1d4a4049c14e)
- [Deps] update `get-intrinsic` [`1bd68ce`](https://github.com/ljharb/es-get-iterator/commit/1bd68ceb11bc078edafb80a50631149056e8ffdf)
## [v1.1.2](https://github.com/ljharb/es-get-iterator/compare/v1.1.1...v1.1.2) - 2021-01-26
### Commits
- [meta] npmignore github action workflows [`0cd2f21`](https://github.com/ljharb/es-get-iterator/commit/0cd2f218f16b08efccbc29daf3831f4f37e30a74)
- [readme] remove travis badge [`357065b`](https://github.com/ljharb/es-get-iterator/commit/357065b649cca3122cc32c73ef97739e3ab6cf6c)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `has-bigints`, `object-inspect`, `tape` [`13a77f2`](https://github.com/ljharb/es-get-iterator/commit/13a77f279cda7ddffbb769ea57933ffc3cac62f0)
- [Deps] update `get-intrinsic`, `is-arguments`, `is-map`, `is-set` [`5f8d7f1`](https://github.com/ljharb/es-get-iterator/commit/5f8d7f14c71bffd470bb61f6f0e125da41bfcf06)
- [meta] update actions, dotfiles [`5ea3e50`](https://github.com/ljharb/es-get-iterator/commit/5ea3e506d0ca1d80df6b37836c62e85934804f89)
- [Tests] fix ESM test matrix [`9ab614c`](https://github.com/ljharb/es-get-iterator/commit/9ab614ce13b1a210d18827e47d4ad631a431dd39)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `es5-shim` [`e843ad9`](https://github.com/ljharb/es-get-iterator/commit/e843ad96802c3579a79b82ef49d98239f8288db8)
- [Deps] update `call-bind`, `get-intrinsic` [`4301b3e`](https://github.com/ljharb/es-get-iterator/commit/4301b3e70982434feda67e5868d7a50f5101ae8f)
- [meta] avoid upcoming deprecation warning in node; add "browser" field [`57297b1`](https://github.com/ljharb/es-get-iterator/commit/57297b19b54b0970fe986890be6c7a97fa4fdd3a)
- [Tests] skip `npm ls` in node 0.x tests [`1409196`](https://github.com/ljharb/es-get-iterator/commit/1409196062de66d84d3cf1d368bed18488e767f2)
- [Dev Deps] update `eslint` [`e4dcea4`](https://github.com/ljharb/es-get-iterator/commit/e4dcea49104de45a0bcf861f9aa2923f0209ed66)
## [v1.1.1](https://github.com/ljharb/es-get-iterator/compare/v1.1.0...v1.1.1) - 2020-11-06
### Commits
- [Tests] migrate tests to Github Actions [`e10fd31`](https://github.com/ljharb/es-get-iterator/commit/e10fd31909fc6451e4be5d8d9fb031d04ab72267)
- [Fix] Support iterators defined by es6-shim when loaded after es-get-iterator [`f2ef7e1`](https://github.com/ljharb/es-get-iterator/commit/f2ef7e1d1cf5fa3357e460fc0023eaf11e79b573)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `es6-shim`, `object-inspect`, `tape` [`1ee86fc`](https://github.com/ljharb/es-get-iterator/commit/1ee86fcf0ff0fa115e78ef589d3a76cd299fe89e)
- [actions] add "Allow Edits" workflow [`c785c69`](https://github.com/ljharb/es-get-iterator/commit/c785c69933afd98a670250f1d52e3b514cbd1d7a)
- [Refactor] use `get-intrinsic` and `call-bind` instead of `es-abstract` [`65f4ef5`](https://github.com/ljharb/es-get-iterator/commit/65f4ef5018688432ca87a4b5aa971fee182722df)
- [Dev Deps] update `auto-changelog`, `es5-shim`, `tape`; add `aud` [`91301ed`](https://github.com/ljharb/es-get-iterator/commit/91301edd87d6b753e0129ac7007e39d410030340)
- [Dev Deps] update `aud` [`afc91d9`](https://github.com/ljharb/es-get-iterator/commit/afc91d98ae243c8563ac7295b8775c5a4b37c92f)
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`1962743`](https://github.com/ljharb/es-get-iterator/commit/19627437efac78d71d78d5e2ef0192052598bc1b)
- [Deps] update `es-abstract` [`d2b57c8`](https://github.com/ljharb/es-get-iterator/commit/d2b57c8896b22eb90b0b894d80ba34f69ed68c3d)
## [v1.1.0](https://github.com/ljharb/es-get-iterator/compare/v1.0.2...v1.1.0) - 2020-01-25
### Commits
- [New] add native ESM variant via conditional exports [`325629d`](https://github.com/ljharb/es-get-iterator/commit/325629d43b6b8d4f2f5ff7d6623e81e01080dde7)
- [Tests] fix test matrix [`01c20cf`](https://github.com/ljharb/es-get-iterator/commit/01c20cf6ed810e567f5fba5c29425df7f2aceb7a)
- [Docs] Add modern browser example for Rollup [`ab9f17d`](https://github.com/ljharb/es-get-iterator/commit/ab9f17da94542940086280d8792d4e6c71186b47)
- [Deps] update `is-map`, `is-set`, `es-abstract`, `is-string` [`a1b9645`](https://github.com/ljharb/es-get-iterator/commit/a1b964517cbd5b16a34fb15df50ec48d684c34c1)
- [Fix] `node.js` only runs where "exports" is supported, and arguments is iterable there [`ccc7646`](https://github.com/ljharb/es-get-iterator/commit/ccc76469077f2fbc82fd4647894ebd660d21a2cb)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`4281453`](https://github.com/ljharb/es-get-iterator/commit/42814531965adb169abb3186a78c0926d4146232)
- [Dev Deps] update `@ljharb/eslint-config` [`f4fc99c`](https://github.com/ljharb/es-get-iterator/commit/f4fc99c83935d0c03aade04030f103d5328abf15)
- [Deps] update `es-abstract` [`70b0423`](https://github.com/ljharb/es-get-iterator/commit/70b042317239eb79df71b16a9531900bdad812f4)
- [Tests] add string coverage for a lone surrogate not followed by a proper surrogate ending [`796e497`](https://github.com/ljharb/es-get-iterator/commit/796e4979168b6ee8ec323d54ca157296166e36d0)
## [v1.0.2](https://github.com/ljharb/es-get-iterator/compare/v1.0.1...v1.0.2) - 2019-12-16
### Commits
- [Deps] update `es-abstract` [`1554229`](https://github.com/ljharb/es-get-iterator/commit/15542291b91d82ccf9da063d1350e7fe685f6bcd)
- [Dev Deps] update `eslint` [`577bbb1`](https://github.com/ljharb/es-get-iterator/commit/577bbb136f7c44cc2d774b0360061b1f1bb10f30)
## [v1.0.1](https://github.com/ljharb/es-get-iterator/compare/v1.0.0...v1.0.1) - 2019-11-27
### Commits
- [Fix] fix bugs in pre-Symbol environments [`592f78a`](https://github.com/ljharb/es-get-iterator/commit/592f78a1d38a0e3e3c4c3dafe1552899decd8c34)
## v1.0.0 - 2019-11-25
### Commits
- Initial tests. [`71f5fdd`](https://github.com/ljharb/es-get-iterator/commit/71f5fdd9c1fdd7b34b5c6f4e1a14cb0cbffc0d9c)
- Initial implementation [`d7e0480`](https://github.com/ljharb/es-get-iterator/commit/d7e04808b322fb6648f4890d86df7f3384b53421)
- Initial commit [`eb5372c`](https://github.com/ljharb/es-get-iterator/commit/eb5372c438b3ca4136e8253ffc4cc7834a4c8ca8)
- readme [`8d6ad14`](https://github.com/ljharb/es-get-iterator/commit/8d6ad14a7f17339ccc20143562f0618773aba3b8)
- npm init [`9b84446`](https://github.com/ljharb/es-get-iterator/commit/9b84446a4e346d4e12c59da5f2f928e1f71d3d69)
- [meta] add `auto-changelog` [`e2d2e4f`](https://github.com/ljharb/es-get-iterator/commit/e2d2e4f55245b786581ef5d42d03cd0efb62db12)
- [meta] add `funding` field; create FUNDING.yml [`5a31c77`](https://github.com/ljharb/es-get-iterator/commit/5a31c7722fc54edfe56975f5a4b7414c48136d36)
- [actions] add automatic rebasing / merge commit blocking [`644429e`](https://github.com/ljharb/es-get-iterator/commit/644429e791abc1b85b65c90d0ee4aac57416ee90)
- [Tests] add `npm run lint` [`f22172f`](https://github.com/ljharb/es-get-iterator/commit/f22172f2dcdd6f41ca45862698b8ea496134b164)
- Only apps should have lockfiles [`fcf8441`](https://github.com/ljharb/es-get-iterator/commit/fcf8441df29d902647fd87d14224c7af19e40c31)
- [meta] add `safe-publish-latest` [`946befa`](https://github.com/ljharb/es-get-iterator/commit/946befa7eb4a91ca648b98660b086ed7813cd3b1)
- [Tests] only test on majors, since travis has a 200 build limit [`aeb5f09`](https://github.com/ljharb/es-get-iterator/commit/aeb5f09a66957c2cff0af22cb1a731ecafb82f24)

21
node_modules/es-get-iterator/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Jordan Harband
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.

89
node_modules/es-get-iterator/README.md generated vendored Normal file
View File

@@ -0,0 +1,89 @@
# es-get-iterator <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![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]
Get an iterator for any JS language value. Works robustly across all environments, all versions.
In modern engines, `value[Symbol.iterator]()` is sufficient to produce an iterator (an object with a `.next` method) for that object. However, older engines:
- may lack `Symbol` support altogether
- may have `Symbol.iterator` but not implement it on everything it should, like arguments objects
- may have `Map` and `Set`, but a non-standard name for the iterator-producing method (`.iterator` or `['@@iterator']`, eg)
- may be old versions of Firefox that produce values until they throw a StopIteration exception, rather than having iteration result objects
- may be polyfilled/shimmed/shammed, with `es6-shim` or `core-js` or similar
This library attempts to provide an abstraction over all that complexity!
In node v13+, `exports` is used to provide a lean implementation that lacks all the complexity described above, in combination with the `browser` field so that bundlers will pick up the proper implementation.
## Targeting browsers with Symbol support
If you are targeting browsers that definitely all have Symbol support, then you can configure your bundler to replace `require('has-symbols')()` with a literal `true`, which should allow dead code elimination to reduce the size of the bundled code.
### With `@rollup/plugin-replace`
```js
// rollup.config.js
import replace from '@rollup/plugin-replace';
export default {
...
plugins: [
replace({
"require('has-symbols')()": 'true',
delimiters: ['', '']
})
]
};
```
## Example
```js
var getIterator = require('es-get-iterator');
var assert = require('assert');
var iterator = getIterator('a 💩');
assert.deepEqual(
[iterator.next(), iterator.next(), iterator.next(), iterator.next()],
[{ done: false, value: 'a' }, { done: false, value: ' ' }, { done: false, value: '💩' }, { done: true, value: undefined }]
);
var iterator = getIterator([1, 2]);
assert.deepEqual(
[iterator.next(), iterator.next(), iterator.next()],
[{ done: false, value: 1 }, { done: false, value: 2 }, { done: true, value: undefined }]
);
var iterator = getIterator(new Set([1, 2]));
assert.deepEqual(
[iterator.next(), iterator.next(), iterator.next()],
[{ done: false, value: 1 }, { done: false, value: 2 }, { done: true, value: undefined }]
);
var iterator = getIterator(new Map([[1, 2], [3, 4]]));
assert.deepEqual(
[iterator.next(), iterator.next(), iterator.next()],
[{ done: false, value: [1, 2] }, { done: false, value: [3, 4] }, { done: true, value: undefined }]
);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/es-get-iterator
[npm-version-svg]: https://versionbadg.es/ljharb/es-get-iterator.svg
[deps-svg]: https://david-dm.org/ljharb/es-get-iterator.svg
[deps-url]: https://david-dm.org/ljharb/es-get-iterator
[dev-deps-svg]: https://david-dm.org/ljharb/es-get-iterator/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/es-get-iterator#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es-get-iterator.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/es-get-iterator.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es-get-iterator.svg
[downloads-url]: https://npm-stat.com/charts.html?package=es-get-iterator

189
node_modules/es-get-iterator/index.js generated vendored Normal file
View File

@@ -0,0 +1,189 @@
'use strict';
/* eslint global-require: 0 */
// the code is structured this way so that bundlers can
// alias out `has-symbols` to `() => true` or `() => false` if your target
// environments' Symbol capabilities are known, and then use
// dead code elimination on the rest of this module.
//
// Similarly, `isarray` can be aliased to `Array.isArray` if
// available in all target environments.
var isArguments = require('is-arguments');
var getStopIterationIterator = require('stop-iteration-iterator');
if (require('has-symbols')() || require('has-symbols/shams')()) {
var $iterator = Symbol.iterator;
// Symbol is available natively or shammed
// natively:
// - Chrome >= 38
// - Edge 12-14?, Edge >= 15 for sure
// - FF >= 36
// - Safari >= 9
// - node >= 0.12
module.exports = function getIterator(iterable) {
// alternatively, `iterable[$iterator]?.()`
if (iterable != null && typeof iterable[$iterator] !== 'undefined') {
return iterable[$iterator]();
}
if (isArguments(iterable)) {
// arguments objects lack Symbol.iterator
// - node 0.12
return Array.prototype[$iterator].call(iterable);
}
};
} else {
// Symbol is not available, native or shammed
var isArray = require('isarray');
var isString = require('is-string');
var GetIntrinsic = require('get-intrinsic');
var $Map = GetIntrinsic('%Map%', true);
var $Set = GetIntrinsic('%Set%', true);
var callBound = require('call-bind/callBound');
var $arrayPush = callBound('Array.prototype.push');
var $charCodeAt = callBound('String.prototype.charCodeAt');
var $stringSlice = callBound('String.prototype.slice');
var advanceStringIndex = function advanceStringIndex(S, index) {
var length = S.length;
if ((index + 1) >= length) {
return index + 1;
}
var first = $charCodeAt(S, index);
if (first < 0xD800 || first > 0xDBFF) {
return index + 1;
}
var second = $charCodeAt(S, index + 1);
if (second < 0xDC00 || second > 0xDFFF) {
return index + 1;
}
return index + 2;
};
var getArrayIterator = function getArrayIterator(arraylike) {
var i = 0;
return {
next: function next() {
var done = i >= arraylike.length;
var value;
if (!done) {
value = arraylike[i];
i += 1;
}
return {
done: done,
value: value
};
}
};
};
var getNonCollectionIterator = function getNonCollectionIterator(iterable, noPrimordialCollections) {
if (isArray(iterable) || isArguments(iterable)) {
return getArrayIterator(iterable);
}
if (isString(iterable)) {
var i = 0;
return {
next: function next() {
var nextIndex = advanceStringIndex(iterable, i);
var value = $stringSlice(iterable, i, nextIndex);
i = nextIndex;
return {
done: nextIndex > iterable.length,
value: value
};
}
};
}
// es6-shim and es-shims' es-map use a string "_es6-shim iterator_" property on different iterables, such as MapIterator.
if (noPrimordialCollections && typeof iterable['_es6-shim iterator_'] !== 'undefined') {
return iterable['_es6-shim iterator_']();
}
};
if (!$Map && !$Set) {
// the only language iterables are Array, String, arguments
// - Safari <= 6.0
// - Chrome < 38
// - node < 0.12
// - FF < 13
// - IE < 11
// - Edge < 11
module.exports = function getIterator(iterable) {
if (iterable != null) {
return getNonCollectionIterator(iterable, true);
}
};
} else {
// either Map or Set are available, but Symbol is not
// - es6-shim on an ES5 browser
// - Safari 6.2 (maybe 6.1?)
// - FF v[13, 36)
// - IE 11
// - Edge 11
// - Safari v[6, 9)
var isMap = require('is-map');
var isSet = require('is-set');
// Firefox >= 27, IE 11, Safari 6.2 - 9, Edge 11, es6-shim in older envs, all have forEach
var $mapForEach = callBound('Map.prototype.forEach', true);
var $setForEach = callBound('Set.prototype.forEach', true);
if (typeof process === 'undefined' || !process.versions || !process.versions.node) { // "if is not node"
// Firefox 17 - 26 has `.iterator()`, whose iterator `.next()` either
// returns a value, or throws a StopIteration object. These browsers
// do not have any other mechanism for iteration.
var $mapIterator = callBound('Map.prototype.iterator', true);
var $setIterator = callBound('Set.prototype.iterator', true);
}
// Firefox 27-35, and some older es6-shim versions, use a string "@@iterator" property
// this returns a proper iterator object, so we should use it instead of forEach.
// newer es6-shim versions use a string "_es6-shim iterator_" property.
var $mapAtAtIterator = callBound('Map.prototype.@@iterator', true) || callBound('Map.prototype._es6-shim iterator_', true);
var $setAtAtIterator = callBound('Set.prototype.@@iterator', true) || callBound('Set.prototype._es6-shim iterator_', true);
var getCollectionIterator = function getCollectionIterator(iterable) {
if (isMap(iterable)) {
if ($mapIterator) {
return getStopIterationIterator($mapIterator(iterable));
}
if ($mapAtAtIterator) {
return $mapAtAtIterator(iterable);
}
if ($mapForEach) {
var entries = [];
$mapForEach(iterable, function (v, k) {
$arrayPush(entries, [k, v]);
});
return getArrayIterator(entries);
}
}
if (isSet(iterable)) {
if ($setIterator) {
return getStopIterationIterator($setIterator(iterable));
}
if ($setAtAtIterator) {
return $setAtAtIterator(iterable);
}
if ($setForEach) {
var values = [];
$setForEach(iterable, function (v) {
$arrayPush(values, v);
});
return getArrayIterator(values);
}
}
};
module.exports = function getIterator(iterable) {
return getCollectionIterator(iterable) || getNonCollectionIterator(iterable);
};
}
}

12
node_modules/es-get-iterator/node.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
// this should only run in node >= 13.2, so it
// does not need any of the intense fallbacks that old node/browsers do
var $iterator = Symbol.iterator;
module.exports = function getIterator(iterable) {
// alternatively, `iterable[$iterator]?.()`
if (iterable != null && typeof iterable[$iterator] !== 'undefined') {
return iterable[$iterator]();
}
};

11
node_modules/es-get-iterator/node.mjs generated vendored Normal file
View File

@@ -0,0 +1,11 @@
// this should only run in node >= 13.7, so it
// does not need any of the intense fallbacks that old node/browsers do
var $iterator = Symbol.iterator;
export default function getIterator(iterable) {
// alternatively, `iterable[$iterator]?.()`
if (iterable != null && iterable[$iterator] !== undefined) {
return iterable[$iterator]();
}
}

102
node_modules/es-get-iterator/package.json generated vendored Normal file
View File

@@ -0,0 +1,102 @@
{
"name": "es-get-iterator",
"version": "1.1.3",
"description": "Get an iterator for any JS language value. Works robustly across all environments, all versions.",
"main": "./index.js",
"browser": "./index.js",
"exports": {
".": [
{
"browser": "./index.js",
"import": "./node.mjs",
"default": "./node.js"
},
"./node.js"
],
"./package": "./package.json",
"./package.json": "./package.json"
},
"type": "commonjs",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"lint": "eslint --ext=js,mjs .",
"pretest": "npm run lint",
"tests-only": "nyc node test/${TEST_VARIANT-}",
"tests-esm": "TEST_VARIANT=node.mjs npm run tests-only",
"tests-preload-es6-shim": "TEST_VARIANT=es6-shim PRELOAD_GET_ITERATOR=true npm run tests-only",
"test": "npm run tests-only && TEST_VARIANT=node npm run tests-only && npm run tests-esm && npm run tests-preload-es6-shim",
"posttest": "aud --production",
"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+https://github.com/ljharb/es-get-iterator.git"
},
"keywords": [
"iterator",
"Symbol.iterator",
"iterable",
"collection",
"next",
"iteration"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/es-get-iterator/issues"
},
"homepage": "https://github.com/ljharb/es-get-iterator#readme",
"devDependencies": {
"@ljharb/eslint-config": "^21.0.1",
"aud": "^2.0.2",
"auto-changelog": "^2.4.0",
"core-js": "^2.6.10 || ^3.4.2",
"es5-shim": "^4.6.7",
"es6-shim": "^0.35.7",
"eslint": "=8.8.0",
"for-each": "^0.3.3",
"has-bigints": "^1.0.2",
"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"object-inspect": "^1.12.3",
"safe-publish-latest": "^2.0.0",
"tape": "^5.6.1"
},
"testling": {
"files": "./test/index.js"
},
"greenkeeper": {
"ignore": [
"nyc"
]
},
"dependencies": {
"call-bind": "^1.0.2",
"get-intrinsic": "^1.1.3",
"has-symbols": "^1.0.3",
"is-arguments": "^1.1.1",
"is-map": "^2.0.2",
"is-set": "^2.0.2",
"is-string": "^1.0.7",
"isarray": "^2.0.5",
"stop-iteration-iterator": "^1.0.0"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false
},
"publishConfig": {
"ignore": [
".github/workflows"
]
}
}

5
node_modules/es-get-iterator/test/core-js.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
'use strict';
require('core-js');
require('./');

11
node_modules/es-get-iterator/test/es6-shim.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
'use strict';
if (process.env.PRELOAD_GET_ITERATOR) {
// eslint-disable-next-line global-require
require('../');
}
require('es5-shim');
require('es6-shim');
require('./');

178
node_modules/es-get-iterator/test/index.js generated vendored Normal file
View File

@@ -0,0 +1,178 @@
'use strict';
var test = require('tape');
var Test = require('tape/lib/test');
var inspect = require('object-inspect');
// eslint-disable-next-line global-require
var hasSymbols = require('has-symbols')() || require('has-symbols/shams')();
var hasBigInts = require('has-bigints')();
var forEach = require('for-each');
var getIterator = process.env.TEST_VARIANT === 'node' ? require('../node') : require('../');
Test.prototype.iterate = function (value, expected, message) {
var i = 0;
this.test(message, function (t) {
var iterator = getIterator(value);
if (!iterator) {
t.fail(inspect(value) + ' is not iterable');
return t.end();
}
if (typeof iterator.next !== 'function') {
t.fail('iterator does not have a next function, got ' + inspect(iterator));
return t.end();
}
var result;
while ((result = iterator.next()) && !result.done) {
var expectedDebug = typeof expected[i] === 'string' ? expected[i].charCodeAt(0) : expected[i];
var actualDebug = typeof result.value === 'string' ? result.value.charCodeAt(0) : result.value;
t.deepEqual(result.value, expected[i], 'index ' + i + ': expected ' + inspect(expectedDebug) + ', got ' + inspect(actualDebug));
i += 1;
}
t.equal(i, expected.length, 'expected ' + expected.length + ' values, got ' + i + ' values');
t.end();
});
};
Test.prototype.noIterate = function (value) {
this.equal(getIterator(value), undefined, inspect(value) + ' is not iterable');
};
Test.prototype.fakeIterator = function (value) {
this.test(inspect(value) + ' with a fake iterator', { skip: !hasSymbols }, function (t) {
var fakeValues = ['fake', 'iterator', 'scary'];
var o = Object(value);
o[Symbol.iterator] = function () {
return getIterator(fakeValues);
};
t.iterate(o, fakeValues, inspect(o) + ' with an overwritten iterator method, yields those values instead');
t.end();
});
};
var getArguments = function () { return arguments; };
var getSloppyArguments = Function('return arguments');
var collect = function createCollection(C, items) {
var c = new C();
forEach(items, function (item) {
if (c.add) {
c.add(item);
} else {
c.set(item[0], item[1]);
}
});
return c;
};
var runTests = function runTests(t) {
t.test('strings', function (st) {
st.iterate('', [], '"" yields nothing');
st.iterate(Object(''), [], inspect(Object('')) + ' yields nothing');
st.iterate('foo', ['f', 'o', 'o'], '"foo" yields three chars');
st.iterate(Object('foo'), ['f', 'o', 'o'], inspect(Object('foo')) + ' yields three chars');
st.iterate('a💩z', ['a', '💩', 'z'], '"a💩z" yields three code points');
st.iterate(Object('a💩z'), ['a', '💩', 'z'], inspect(Object('a💩z')) + ' yields three code points');
st.iterate('\ud83dX', ['\ud83d', 'X'], '(lone surrogate followed by "not a lone surrogate ending") yields one code point');
st.fakeIterator('abc');
st.end();
});
t.test('arrays', function (st) {
st.iterate([], [], '[] yields nothing');
st.iterate([1, 2], [1, 2], '[1, 2] yields [1, 2]');
// eslint-disable-next-line no-sparse-arrays
st.iterate([1, , 3], [1, undefined, 3], 'sparse array does not skip holes');
st.fakeIterator([1, 2, 3]);
st.end();
});
t.test('arguments', function (st) {
st.iterate(getArguments(), [], 'empty arguments object yields nothing');
st.iterate(getSloppyArguments(), [], 'empty sloppy arguments object yields nothing');
st.iterate(getArguments(1, 2, 3), [1, 2, 3], 'arguments object yields all args');
st.iterate(getSloppyArguments(1, 2, 3), [1, 2, 3], 'sloppy arguments object yields all args');
st.fakeIterator(getArguments(1, 2, 3));
st.fakeIterator(getSloppyArguments(1, 2, 3));
st.end();
});
t.test('non-iterables', function (st) {
var numbers = [0, -0, NaN, Infinity, 42];
var nonIterables = [
undefined,
null,
true,
false,
{},
/a/g,
function () {}
];
if (hasSymbols) {
nonIterables.push(Symbol.iterator);
}
if (hasBigInts) {
nonIterables.push(BigInt(42), BigInt(0));
}
forEach(nonIterables, function (nonIterable) {
st.noIterate(nonIterable);
if (nonIterable != null) {
st.fakeIterator(nonIterable);
}
});
if (hasSymbols && NaN[Symbol.iterator]) {
st.comment('# SKIP core-js v2 makes numbers iterable, in violation of the spec');
}
forEach(numbers, function (number) {
if (!hasSymbols || !number[Symbol.iterator]) {
st.noIterate(number);
}
st.fakeIterator(number);
});
st.end();
});
t.test('Map', { skip: typeof Map !== 'function' }, function (st) {
st.iterate(new Map(), [], 'empty Map yields nothing');
var entries = [
[1, 'a'],
[2, 'b'],
[3, 'c']
];
var m = collect(Map, entries);
st.iterate(m, entries, inspect(m) + ' yields expected entries');
st.fakeIterator(collect(Map, entries));
st.end();
});
t.test('Set', { skip: typeof Set !== 'function' }, function (st) {
st.iterate(new Set(), [], 'empty Set yields nothing');
var values = [
1,
2,
3
];
var s = collect(Set, values);
st.iterate(s, values, inspect(s) + ' yields expected values');
st.fakeIterator(collect(Set, values));
st.end();
});
};
test((process.env.TEST_VARIANT || 'standard') + ': getIterator tests', function (t) {
runTests(t);
t.end();
});

3
node_modules/es-get-iterator/test/node.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
'use strict';
require('./');

10
node_modules/es-get-iterator/test/node.mjs generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import getIterator from 'es-get-iterator';
import Module from 'module';
const require = Module.createRequire(import.meta.url);
const id = require.resolve('../node');
const mod = new Module(id);
mod.exports = getIterator;
require.cache[id] = mod;
require('./');