1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-17 01:16:00 +00:00
This commit is contained in:
MatteZ02
2020-03-03 22:30:50 +02:00
parent edfcc6f474
commit 30022c7634
11800 changed files with 1984416 additions and 1 deletions

4
node_modules/es-get-iterator/.eslintignore generated vendored Normal file
View File

@ -0,0 +1,4 @@
coverage
# until eslint can parse `import.meta.url`
test/node.mjs

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

@ -0,0 +1,27 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"consistent-return": 1,
"eqeqeq": [2, "always", { "null": "ignore" }],
"func-name-matching": 0,
"id-length": 0,
"max-lines-per-function": 0,
"max-statements": 0,
"multiline-comment-style": 0,
"new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }],
"no-magic-numbers": 0,
},
"overrides": [
{
"files": "test/**",
"rules": {
"max-params": [2, 3],
"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

View 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 }}

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

@ -0,0 +1,14 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"operations",
"test"
]
}

4
node_modules/es-get-iterator/.travis.011.yml generated vendored Normal file
View File

@ -0,0 +1,4 @@
version: ~> 1.0
language: node_js
node_js:
- '0.11'

39
node_modules/es-get-iterator/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,39 @@
version: ~> 1.0
language: node_js
os:
- linux
import:
- ljharb/travis-ci:node/majors/all.yml
- ljharb/travis-ci:node/0.x/all.yml
- ljharb/travis-ci:node/pretest.yml
- ljharb/travis-ci:node/posttest.yml
- ./.travis.011.yml
install:
- 'npm install'
- 'if [ "${CORE_JS-}" ]; then npm install --no-save core-js@${CORE_JS}; fi'
script:
- 'if [ "${TRAVIS_NODE_VERSION}" = "13.2" ] || [ "${TRAVIS_NODE_VERSION}" = "13.7" ]; then npm run tests-esm; fi'
env:
- TEST=true TEST_VARIANT=es6-shim
- TEST=true TEST_VARIANT=core-js CORE_JS=2
- TEST=true TEST_VARIANT=core-js CORE_JS=3
matrix:
include:
- node_js: '13.7'
env: TEST=true TEST_VARIANT=node
- node_js: '13.6'
env: TEST=true TEST_VARIANT=node
- node_js: '13.5'
env: TEST=true TEST_VARIANT=node
- node_js: '13.4'
env: TEST=true TEST_VARIANT=node
- node_js: '13.3'
env: TEST=true TEST_VARIANT=node
- node_js: '13.2'
env: TEST=true TEST_VARIANT=node
- node_js: '13.1'
env: TEST=true TEST_VARIANT=node
- node_js: '13.0'
env: TEST=true TEST_VARIANT=node
after_success:
- 'if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi'

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

@ -0,0 +1,52 @@
# 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.0](https://github.com/ljharb/es-get-iterator/compare/v1.0.2...v1.1.0) - 2020-01-26
### 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-26
### 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.

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

@ -0,0 +1,92 @@
# es-get-iterator <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]
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]: http://versionbadg.es/ljharb/es-get-iterator.svg
[travis-svg]: https://travis-ci.org/ljharb/es-get-iterator.svg
[travis-url]: https://travis-ci.org/ljharb/es-get-iterator
[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]: http://img.shields.io/npm/l/es-get-iterator.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/es-get-iterator.svg
[downloads-url]: http://npm-stat.com/charts.html?package=es-get-iterator

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

@ -0,0 +1,198 @@
'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');
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('es-abstract/GetIntrinsic');
var $Map = GetIntrinsic('%Map%', true);
var $Set = GetIntrinsic('%Set%', true);
var callBound = require('es-abstract/helpers/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) {
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
};
}
};
}
};
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 = getNonCollectionIterator;
} 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);
var getStopIterationIterator = function (iterator) {
var done = false;
return {
next: function next() {
try {
return {
done: done,
value: done ? undefined : iterator.next()
};
} catch (e) {
done = true;
return {
done: true,
value: undefined
};
}
}
};
};
}
// 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]();
}
}

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

@ -0,0 +1,117 @@
{
"_from": "es-get-iterator@^1.0.1",
"_id": "es-get-iterator@1.1.0",
"_inBundle": false,
"_integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==",
"_location": "/es-get-iterator",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "es-get-iterator@^1.0.1",
"name": "es-get-iterator",
"escapedName": "es-get-iterator",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/deep-equal"
],
"_resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz",
"_shasum": "bb98ad9d6d63b31aacdc8f89d5d0ee57bcb5b4c8",
"_spec": "es-get-iterator@^1.0.1",
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix-V3\\node_modules\\deep-equal",
"author": {
"name": "Jordan Harband",
"email": "ljharb@gmail.com"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false
},
"bugs": {
"url": "https://github.com/ljharb/es-get-iterator/issues"
},
"bundleDependencies": false,
"dependencies": {
"es-abstract": "^1.17.4",
"has-symbols": "^1.0.1",
"is-arguments": "^1.0.4",
"is-map": "^2.0.1",
"is-set": "^2.0.1",
"is-string": "^1.0.5",
"isarray": "^2.0.5"
},
"deprecated": false,
"description": "Get an iterator for any JS language value. Works robustly across all environments, all versions.",
"devDependencies": {
"@ljharb/eslint-config": "^16.0.0",
"auto-changelog": "^1.16.2",
"core-js": "^2.6.10 || ^3.4.2",
"es5-shim": "^4.5.13",
"es6-shim": "^0.35.5",
"eslint": "^6.8.0",
"for-each": "^0.3.3",
"has-bigints": "^1.0.0",
"nyc": "^10.3.2",
"object-inspect": "^1.7.0",
"safe-publish-latest": "^1.1.4",
"tape": "^5.0.0-next.3"
},
"exports": {
".": [
{
"browser": "./index.js",
"import": "./node.mjs",
"default": "./node.js"
},
"./node.js"
],
"./package": "./package.json",
"./package.json": "./package.json"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"greenkeeper": {
"ignore": [
"nyc"
]
},
"homepage": "https://github.com/ljharb/es-get-iterator#readme",
"keywords": [
"iterator",
"Symbol.iterator",
"iterable",
"collection",
"next",
"iteration"
],
"license": "MIT",
"main": "index",
"name": "es-get-iterator",
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/es-get-iterator.git"
},
"scripts": {
"lint": "eslint --ext=js,mjs .",
"posttest": "npx aud --production",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"",
"prepublish": "safe-publish-latest",
"pretest": "npm run lint",
"test": "npm run tests-only && npm run tests-esm",
"tests-esm": "nyc node test/node.mjs",
"tests-only": "nyc node test/${TEST_VARIANT-}",
"version": "auto-changelog && git add CHANGELOG.md"
},
"testling": {
"files": "./test/index.js"
},
"type": "commonjs",
"version": "1.1.0"
}

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('./');

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

@ -0,0 +1,6 @@
'use strict';
require('es5-shim');
require('es6-shim');
require('./');

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

@ -0,0 +1,176 @@
'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) {
t.deepEqual(result.value, expected[i], 'index ' + i + ': expected ' + inspect(expected[i]) + ', got ' + inspect(result.value));
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'], inspect('\ud83dX') + ' (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('./');