1
0
forked from dyf/APP

增加mqtt

This commit is contained in:
微微一笑
2025-07-16 11:16:19 +08:00
parent e42d4af3b2
commit 6257f9d84b
1550 changed files with 5264 additions and 116701 deletions

407
node_modules/es5-ext/CHANGELOG.md generated vendored
View File

@ -1,407 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [0.10.64](https://github.com/medikoo/es5-ext/compare/v0.10.63...v0.10.64) (2024-02-27)
### Bug Fixes
- Revert update to postinstall script meant to fix Powershell issue, as it's a regression for some Linux terminals ([c2e2bb9](https://github.com/medikoo/es5-ext/commit/c2e2bb90c295c4c582445a6f03b2a3ad0b22550a))
### [0.10.63](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.63) (2024-02-23)
### Bug Fixes
- Do not rely on problematic regex ([3551cdd](https://github.com/medikoo/es5-ext/commit/3551cdd7b2db08b1632841f819d008757d28e8e2)), addresses [#201](https://github.com/medikoo/es5-ext/issues/201)
- Support ES2015+ function definitions in `function#toStringTokens()` ([a52e957](https://github.com/medikoo/es5-ext/commit/a52e95736690ad1d465ebcd9791d54570e294602)), addresses [#021](https://github.com/medikoo/es5-ext/issues/021)
- Ensure postinstall script does not crash on Windows, fixes [#181](https://github.com/medikoo/es5-ext/issues/181) ([bf8ed79](https://github.com/medikoo/es5-ext/commit/bf8ed799d57df53096da9d908ff577f305e1366f))
### Maintenance Improvements
- Simplify the manifest message ([7855319](https://github.com/medikoo/es5-ext/commit/7855319f41b9736639cf4555bd2c419f17addf55))
### [0.10.62](https://github.com/medikoo/es5-ext/compare/v0.10.61...v0.10.62) (2022-08-02)
### Maintenance Improvements
- **Manifest improvements:**
- ([#190](https://github.com/medikoo/es5-ext/issues/190)) ([b8dc53f](https://github.com/medikoo/es5-ext/commit/b8dc53fa439b98541644c64c1275f25d9f2e2235))
- ([c51d552](https://github.com/medikoo/es5-ext/commit/c51d552c03967858b8f14a4afa305338ba648cce))
### [0.10.61](https://github.com/medikoo/es5-ext/compare/v0.10.60...v0.10.61) (2022-04-20)
### Bug Fixes
- Ensure postinstall script does not error ([a0be4fd](https://github.com/medikoo/es5-ext/commit/a0be4fdacdbc3aefd6f2952b7b9215827d362bbb))
### Maintenance Improvements
- Bump dependencies ([d7e0a61](https://github.com/medikoo/es5-ext/commit/d7e0a612b7d895c1c7238c779feae1e39d4634c4))
### [0.10.60](https://github.com/medikoo/es5-ext/compare/v0.10.59...v0.10.60) (2022-04-07)
### Maintenance Improvements
- Improve `postinstall` script configuration ([ab6b121](https://github.com/medikoo/es5-ext/commit/ab6b121f0ca4f033bba9b6f400b24d07869bd716))
### [0.10.59](https://github.com/medikoo/es5-ext/compare/v0.10.58...v0.10.59) (2022-03-17)
### Maintenance Improvements
- Improve manifest wording ([#122](https://github.com/medikoo/es5-ext/issues/122)) ([eb7ae59](https://github.com/medikoo/es5-ext/commit/eb7ae59966774a8c26f1717415c627d90bb3d954))
- Update data in manifest ([3d2935a](https://github.com/medikoo/es5-ext/commit/3d2935ac6f1a0969c7569840d5b3bdeed6940e56))
### [0.10.58](https://github.com/medikoo/es5-ext/compare/v0.10.57...v0.10.58) (2022-03-11)
### Maintenance Improvements
- Improve "call for peace" manifest ([3beace4](https://github.com/medikoo/es5-ext/commit/3beace4b3d00f02da61b72dd328f90cf069d46de))
### [0.10.57](https://github.com/medikoo/es5-ext/compare/v0.10.56...v0.10.57) (2022-03-08)
### Bug Fixes
- Workaround `postinstall` script prevent npx error ([#110](https://github.com/medikoo/es5-ext/issues/110)) ([e212d5a](https://github.com/medikoo/es5-ext/commit/e212d5a0adf186f1fadf85fdc07aab25085ee097)) ([martindrq](https://github.com/martindrq))
### [0.10.56](https://github.com/medikoo/es5-ext/compare/v0.10.55...v0.10.56) (2022-03-07)
### Maintenance Improvements
- Add missing shebang to postinstall script ([e423fd7](https://github.com/medikoo/es5-ext/commit/e423fd7264c4f145921e461037d571b35b6a9833))
### [0.10.55](https://github.com/medikoo/es5-ext/compare/v0.10.54...v0.10.55) (2022-03-07)
### Maintenance Improvements
- Configure `.npmignore` file (exclude tests from publication) ([d3ed4b6](https://github.com/medikoo/es5-ext/commit/d3ed4b6a873900a2abf3957bbebdcf18c4e564e0))
### [0.10.54](https://github.com/medikoo/es5-ext/compare/v0.10.53...v0.10.54) (2022-03-07)
### Maintenance Improvements
- Convert dependency ranges ([765eb8e](https://github.com/medikoo/es5-ext/commit/765eb8e897cabc76f0351443d84b4843a1187b27))
- Give Peace a Chance ([28de285](https://github.com/medikoo/es5-ext/commit/28de285ed433b45113f01e4ce7c74e9a356b2af2))
### [0.10.53](https://github.com/medikoo/es5-ext/compare/v0.10.52...v0.10.53) (2019-11-21)
_Maintenance improvements_
### [0.10.52](https://github.com/medikoo/es5-ext/compare/v0.10.51...v0.10.52) (2019-10-29)
### Bug Fixes
- Fix global resolution for Safari ([00731d2](https://github.com/medikoo/es5-ext/commit/00731d2))
- Keep support for old Node.js versions ([2fa2a11](https://github.com/medikoo/es5-ext/commit/2fa2a11))
### [0.10.51](https://github.com/medikoo/es5-ext/compare/v0.10.50...v0.10.51) (2019-08-30)
### Bug Fixes
- Ensure Function.isFunction recognizes async functions ([6f06e66](https://github.com/medikoo/es5-ext/commit/6f06e66))
### Tests
- Fix after prettification changes ([dd6fc3f](https://github.com/medikoo/es5-ext/commit/dd6fc3f))
## [0.10.50](https://github.com/medikoo/es5-ext/compare/v0.10.49...v0.10.50) (2019-04-30)
### Bug Fixes
- maximum time value reference ([708202d](https://github.com/medikoo/es5-ext/commit/708202d))
### Features
- ensure global resolves in strict mode ([c6a19d7](https://github.com/medikoo/es5-ext/commit/c6a19d7)), closes [#86](https://github.com/medikoo/es5-ext/issues/86)
## [0.10.49](https://github.com/medikoo/es5-ext/compare/v0.10.48...v0.10.49) (2019-03-11)
### Features
- allow plain function usage of fn.compose ([2bafef7](https://github.com/medikoo/es5-ext/commit/2bafef7))
## [0.10.48](https://github.com/medikoo/es5-ext/compare/v0.10.47...v0.10.48) (2019-02-22)
### Features
- Object.ensurePlainObject util ([f48fbcf](https://github.com/medikoo/es5-ext/commit/f48fbcf))
<a name="0.10.47"></a>
## [0.10.47](https://github.com/medikoo/es5-ext/compare/v0.10.46...v0.10.47) (2019-01-16)
### Features
- Promise.prototype.finally shim ([4dadbc7](https://github.com/medikoo/es5-ext/commit/4dadbc7))
<a name="0.10.46"></a>
## [0.10.46](https://github.com/medikoo/es5-ext/compare/v0.10.45...v0.10.46) (2018-08-13)
### Bug Fixes
- assign-deep to not modify following arguments ([bf43d57](https://github.com/medikoo/es5-ext/commit/bf43d57))
<a name="0.10.45"></a>
## [0.10.45](https://github.com/medikoo/es5-ext/compare/v0.10.44...v0.10.45) (2018-06-01)
### Bug Fixes
- improve error message readbility ([adc91b9](https://github.com/medikoo/es5-ext/commit/adc91b9))
<a name="0.10.44"></a>
## [0.10.44](https://github.com/medikoo/es5-ext/compare/v0.10.43...v0.10.44) (2018-05-30)
### Features
- add Object.entries ([51d2f43](https://github.com/medikoo/es5-ext/commit/51d2f43))
<a name="0.10.43"></a>
## [0.10.43](https://github.com/medikoo/es5-ext/compare/v0.10.42...v0.10.43) (2018-05-28)
### Features
- improve patch string ([6a25b10](https://github.com/medikoo/es5-ext/commit/6a25b10))
<a name="0.10.42"></a>
## [0.10.42](https://github.com/medikoo/es5-ext/compare/v0.10.41...v0.10.42) (2018-03-28)
### Bug Fixes
- Date.isDate to exclude NaN dates ([3b61bc6](https://github.com/medikoo/es5-ext/commit/3b61bc6))
### Features
- improve non-coercible string representation ([20bfb78](https://github.com/medikoo/es5-ext/commit/20bfb78))
- improve non-stringifiable string representation ([2e4512d](https://github.com/medikoo/es5-ext/commit/2e4512d))
<a name="0.10.41"></a>
## [0.10.41](https://github.com/medikoo/es5-ext/compare/v0.10.40...v0.10.41) (2018-03-16)
### Features
- Add function.microtaskDelay method ([66481c0](https://github.com/medikoo/es5-ext/commit/66481c0))
- Add Object.isThenable ([8d5a45c](https://github.com/medikoo/es5-ext/commit/8d5a45c))
- Add promise.asCallback method ([dcc1451](https://github.com/medikoo/es5-ext/commit/dcc1451))
- Object.ensurePlainFunction ([2682be6](https://github.com/medikoo/es5-ext/commit/2682be6))
<a name="0.10.40"></a>
## [0.10.40](https://github.com/medikoo/es5-ext/compare/v0.10.39...v0.10.40) (2018-03-09)
### Features
- **math:** decimal round, floor and ceil ([39290c6](https://github.com/medikoo/es5-ext/commit/39290c6))
- **object:** isInteger and ensureInteger ([a5f7d04](https://github.com/medikoo/es5-ext/commit/a5f7d04))
<a name="0.10.39"></a>
## [0.10.39](https://github.com/medikoo/es5-ext/compare/v0.10.38...v0.10.39) (2018-02-16)
### Features
- Promise.lazy ([7a30a78](https://github.com/medikoo/es5-ext/commit/7a30a78))
<a name="0.10.38"></a>
## [0.10.38](https://github.com/medikoo/es5-ext/compare/v0.10.37...v0.10.38) (2018-01-16)
### Features
- Object.isNaturalNumber an Object.isNaturalNumberValue ([66a40af](https://github.com/medikoo/es5-ext/commit/66a40af))
<a name="0.10.37"></a>
## [0.10.37](https://github.com/medikoo/es5-ext/compare/v0.10.36...v0.10.37) (2017-11-23)
### Features
- String.random util ([7c28739](https://github.com/medikoo/es5-ext/commit/7c28739))
<a name="0.10.36"></a>
## [0.10.36](https://github.com/medikoo/es5-ext/compare/v0.10.35...v0.10.36) (2017-11-23)
### Features
- **date:** isTimeValue and ensureTimeValue utils ([7659dc5](https://github.com/medikoo/es5-ext/commit/7659dc5))
<a name="0.10.35"></a>
## [0.10.35](https://github.com/medikoo/es5-ext/compare/v0.10.34...v0.10.35) (2017-10-13)
### Bug Fixes
- **Object.copy:** do not upgrade primitives to objects ([dd4d88f](https://github.com/medikoo/es5-ext/commit/dd4d88f))
<a name="0.10.34"></a>
## [0.10.34](https://github.com/medikoo/es5-ext/compare/v0.10.33...v0.10.34) (2017-10-13)
### Features
- **copyDeep:** duplicate only recursive instances ([bba529a](https://github.com/medikoo/es5-ext/commit/bba529a))
<a name="0.10.33"></a>
## [0.10.33](https://github.com/medikoo/es5-ext/compare/v0.10.32...v0.10.33) (2017-10-13)
### Bug Fixes
- **Object.assignDeep:** relax input validation ([1baf57d](https://github.com/medikoo/es5-ext/commit/1baf57d))
<a name="0.10.32"></a>
## [0.10.32](https://github.com/medikoo/es5-ext/compare/v0.10.31...v0.10.32) (2017-10-13)
### Features
- Object.assignDeep ([2345e0b](https://github.com/medikoo/es5-ext/commit/2345e0b))
<a name="0.10.31"></a>
## [0.10.31](https://github.com/medikoo/es5-ext/compare/v0.10.30...v0.10.31) (2017-10-09)
### Features
- Object.isPlainFunction utility ([031be0a](https://github.com/medikoo/es5-ext/commit/031be0a))
<a name="0.10.30"></a>
## [0.10.30](https://github.com/medikoo/es5-ext/compare/v0.10.29...v0.10.30) (2017-08-25)
### Bug Fixes
- value stringification for error message ([37bb96b](https://github.com/medikoo/es5-ext/commit/37bb96b))
<a name="0.10.29"></a>
## [0.10.29](https://github.com/medikoo/es5-ext/compare/v0.10.28...v0.10.29) (2017-08-18)
### Bug Fixes
- string.repeat after recent regression ([b02fab4](https://github.com/medikoo/es5-ext/commit/b02fab4))
<a name="0.10.28"></a>
## [0.10.28](https://github.com/medikoo/es5-ext/compare/v0.10.27...v0.10.28) (2017-08-18)
### Features
- array.isEmpty method ([b0cfbdd](https://github.com/medikoo/es5-ext/commit/b0cfbdd))
- improve new lines representation ([860fe8b](https://github.com/medikoo/es5-ext/commit/860fe8b))
- Object.ensureArray util ([595c341](https://github.com/medikoo/es5-ext/commit/595c341))
- toShortStringRepresentation util ([6842d06](https://github.com/medikoo/es5-ext/commit/6842d06))
<a name="0.10.27"></a>
## [0.10.27](https://github.com/medikoo/es5-ext/compare/v0.10.26...v0.10.27) (2017-08-11)
### Bug Fixes
- isNumberValue should not crash on non-coercible values ([0db765e](https://github.com/medikoo/es5-ext/commit/0db765e))
### Features
- add Object.ensureFiniteNumber util ([11c67f5](https://github.com/medikoo/es5-ext/commit/11c67f5))
- add Object.isFiniteNumber util ([fe5b55a](https://github.com/medikoo/es5-ext/commit/fe5b55a))
<a name="0.10.26"></a>
## [0.10.26](https://github.com/medikoo/es5-ext/compare/v0.10.25...v0.10.26) (2017-08-02)
### Bug Fixes
- **general:** ensure optionalChaining in index ([3df879a](https://github.com/medikoo/es5-ext/commit/3df879a))
<a name="0.10.25"></a>
## [0.10.25](https://github.com/medikoo/es5-ext/compare/v0.10.24...v0.10.25) (2017-08-02)
### Features
- **general:** optionalChaining utility ([26332b5](https://github.com/medikoo/es5-ext/commit/26332b5))
<a name="0.10.24"></a>
## [0.10.24](https://github.com/medikoo/es5-ext/compare/v0.10.23...v0.10.24) (2017-07-10)
### Features
- resolve global with CSP safe method ([d386449](https://github.com/medikoo/es5-ext/commit/d386449))
<a name="0.10.23"></a>
## [0.10.23](https://github.com/medikoo/es5-ext/compare/v0.10.22...v0.10.23) (2017-06-05)
### Bug Fixes
- **Error.custom:** allow non-string code ([e8db3a0](https://github.com/medikoo/es5-ext/commit/e8db3a0))
- **Error.custom:** improve `ext` argument detection ([0edbfbc](https://github.com/medikoo/es5-ext/commit/0edbfbc))
<a name="0.10.22"></a>
## [0.10.22](https://github.com/medikoo/es5-ext/compare/v0.10.21...v0.10.22) (2017-05-31)
### Bug Fixes
- ensure proper symbols stringification in early implementations ([ce51900](https://github.com/medikoo/es5-ext/commit/ce51900))
<a name="0.10.21"></a>
## [0.10.21](https://github.com/medikoo/es5-ext/compare/v0.10.20...v0.10.21) (2017-05-22)
### Features
- support arrow functions in Function/#/to-tring-tokens.js ([ad3de1e](https://github.com/medikoo/es5-ext/commit/ad3de1e))
<a name="0.10.20"></a>
## [0.10.20](https://github.com/medikoo/es5-ext/compare/v0.10.19...v0.10.20) (2017-05-17)
### Features
- if listed copy not only if own property ([d7e7cef](https://github.com/medikoo/es5-ext/commit/d7e7cef))
- support `ensure` option in Object.copy ([295326f](https://github.com/medikoo/es5-ext/commit/295326f))
<a name="0.10.19"></a>
## [0.10.19](https://github.com/medikoo/es5-ext/compare/v0.10.18...v0.10.19) (2017-05-17)
### Features
- support propertyNames option in Object.copy ([5442279](https://github.com/medikoo/es5-ext/commit/5442279))
<a name="0.10.18"></a>
## [0.10.18](https://github.com/medikoo/es5-ext/compare/v0.10.17...v0.10.18) (2017-05-15)
### Bug Fixes
- take all changes in safeToString ([3c5cd12](https://github.com/medikoo/es5-ext/commit/3c5cd12))
<a name="0.10.17"></a>
## [0.10.17](https://github.com/medikoo/es5-ext/compare/v0.10.16...v0.10.17) (2017-05-15)
### Features
- introduce Object.ensurePromise ([46a2f45](https://github.com/medikoo/es5-ext/commit/46a2f45))
- introduce Object.isPromise ([27aecc8](https://github.com/medikoo/es5-ext/commit/27aecc8))
- introduce safeToString ([0cc6a7b](https://github.com/medikoo/es5-ext/commit/0cc6a7b))
<a name="0.10.16"></a>
## [0.10.16](https://github.com/medikoo/es5-ext/compare/v0.10.15...v0.10.16) (2017-05-09)
### Features
- add String.prototype.count ([2e53241](https://github.com/medikoo/es5-ext/commit/2e53241))
## Changelog for previous versions
See `CHANGES` file

15
node_modules/es5-ext/LICENSE generated vendored
View File

@ -1,15 +0,0 @@
ISC License
Copyright (c) 2011-2024, Mariusz Nowak, @medikoo, medikoo.com
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

1039
node_modules/es5-ext/README.md generated vendored

File diff suppressed because it is too large Load Diff

53
node_modules/es5-ext/_postinstall.js generated vendored
View File

@ -1,53 +0,0 @@
#!/usr/bin/env node
// Broadcasts "Call for peace" message when package is installed in Russia, otherwise no-op
"use strict";
try {
if (
[
"Asia/Anadyr", "Asia/Barnaul", "Asia/Chita", "Asia/Irkutsk", "Asia/Kamchatka",
"Asia/Khandyga", "Asia/Krasnoyarsk", "Asia/Magadan", "Asia/Novokuznetsk",
"Asia/Novosibirsk", "Asia/Omsk", "Asia/Sakhalin", "Asia/Srednekolymsk", "Asia/Tomsk",
"Asia/Ust-Nera", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yekaterinburg",
"Europe/Astrakhan", "Europe/Kaliningrad", "Europe/Kirov", "Europe/Moscow",
"Europe/Samara", "Europe/Saratov", "Europe/Simferopol", "Europe/Ulyanovsk",
"Europe/Volgograd", "W-SU"
].indexOf(new Intl.DateTimeFormat().resolvedOptions().timeZone) === -1
) {
return;
}
var bold = function (msg) { return "\x1b[97m\x1b[1m" + msg + "\x1b[22m\x1b[37m"; };
process._rawDebug(
[
"",
"\x1b[37m24 февраля 2022 года " +
bold("Россия вторглась на Украину") +
". Это вторжение стало крупнейшей атакой на европейскую страну со времен " +
"Второй мировой войны.",
"",
"Оценивается, что это привело к десяткам тысяч жертв среди гражданского " +
"населения Украины и сотням тысяч военных потерь.",
"",
"Российское правительство ограничивает доступ граждан к внешней информации, " +
"продвигая односторонние формулировки и версии происходящего. Другие соседние " +
"страны изображаются как угроза для России, создавая предлог для очередного " +
"неоправданного вторжения в ближайшие годы.",
"",
"Это необходимо остановить. Узнайте, как обойти цензуру и безопасно получить доступ " +
"к широкому спектру источников:",
"",
bold(
"https://forum.torproject.net/t/tor-blocked-in-russia-how-to-circumvent-censorship/982"
),
"",
"Мы призываем изучать множество точек зрения для формирования всестороннего взгляда " +
"на ситуацию."
].join("\n")
);
} catch (error) {
// ignore
}

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, require("es6-symbol").iterator, {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,5 +0,0 @@
"use strict";
module.exports = require("./is-implemented")()
? Array.prototype[require("es6-symbol").iterator]
: require("./shim");

View File

@ -1,16 +0,0 @@
"use strict";
var iteratorSymbol = require("es6-symbol").iterator;
module.exports = function () {
var arr = ["foo", 1], iterator, result;
if (typeof arr[iteratorSymbol] !== "function") return false;
iterator = arr[iteratorSymbol]();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result) return false;
if (result.value !== "foo") return false;
if (result.done !== false) return false;
return true;
};

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("../values/shim");

View File

@ -1,7 +0,0 @@
// Used internally to sort array of lists by length
"use strict";
var toPosInt = require("../../number/to-pos-integer");
module.exports = function (arr1, arr2) { return toPosInt(arr1.length) - toPosInt(arr2.length); };

View File

@ -1,27 +0,0 @@
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, floor = Math.floor;
module.exports = function (compareFn) {
var length, low, high, middle;
value(this);
callable(compareFn);
length = toPosInt(this.length);
low = 0;
high = length - 1;
while (low <= high) {
middle = floor((low + high) / 2);
if (compareFn(this[middle]) < 0) high = middle - 1;
else low = middle + 1;
}
if (high < 0) return 0;
if (high >= length) return length - 1;
return high;
};

View File

@ -1,12 +0,0 @@
// Inspired by Google Closure:
// http://closure-library.googlecode.com/svn/docs/
// closure_goog_array_array.js.html#goog.array.clear
"use strict";
var value = require("../../object/valid-value");
module.exports = function () {
value(this).length = 0;
return this;
};

View File

@ -1,11 +0,0 @@
// Inspired by: http://documentcloud.github.com/underscore/#compact
"use strict";
var isValue = require("../../object/is-value");
var filter = Array.prototype.filter;
module.exports = function () {
return filter.call(this, function (val) { return isValue(val); });
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "concat", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.concat : require("./shim");

View File

@ -1,5 +0,0 @@
"use strict";
var SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().concat("foo") instanceof SubArray; };

View File

@ -1,44 +0,0 @@
"use strict";
var isPlainArray = require("../../is-plain-array")
, toPosInt = require("../../../number/to-pos-integer")
, isObject = require("../../../object/is-object")
, isConcatSpreadable = require("es6-symbol").isConcatSpreadable
, isArray = Array.isArray
, concat = Array.prototype.concat
, forEach = Array.prototype.forEach
, isSpreadable;
isSpreadable = function (value) {
if (!value) return false;
if (!isObject(value)) return false;
if (value[isConcatSpreadable] !== undefined) {
return Boolean(value[isConcatSpreadable]);
}
return isArray(value);
};
// eslint-disable-next-line no-unused-vars
module.exports = function (item /*, …items*/) {
var result;
if (!this || !isArray(this) || isPlainArray(this)) {
return concat.apply(this, arguments);
}
result = new this.constructor();
if (isSpreadable(this)) {
forEach.call(this, function (val, i) { result[i] = val; });
} else {
result[0] = this;
}
forEach.call(arguments, function (arg) {
var base;
if (isSpreadable(arg)) {
base = result.length;
result.length += toPosInt(arg.length);
forEach.call(arg, function (val, i) { result[base + i] = val; });
return;
}
result.push(arg);
});
return result;
};

View File

@ -1,7 +0,0 @@
"use strict";
var indexOf = require("./e-index-of");
module.exports = function (searchElement /*, position*/) {
return indexOf.call(this, searchElement, arguments[1]) > -1;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "copyWithin", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.copyWithin : require("./shim");

View File

@ -1,7 +0,0 @@
"use strict";
module.exports = function () {
var arr = [1, 2, 3, 4, 5];
if (typeof arr.copyWithin !== "function") return false;
return String(arr.copyWithin(1, 3)) === "1,4,5,4,5";
};

View File

@ -1,45 +0,0 @@
// Taken from: https://github.com/paulmillr/es6-shim/
"use strict";
var toInteger = require("../../../number/to-integer")
, toPosInt = require("../../../number/to-pos-integer")
, validValue = require("../../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty
, max = Math.max
, min = Math.min;
module.exports = function (target, start /*, end*/) {
var arr = validValue(this)
, end = arguments[2]
, length = toPosInt(arr.length)
, to
, from
, fin
, count
, direction;
target = toInteger(target);
start = toInteger(start);
end = end === undefined ? length : toInteger(end);
to = target < 0 ? max(length + target, 0) : min(target, length);
from = start < 0 ? max(length + start, 0) : min(start, length);
fin = end < 0 ? max(length + end, 0) : min(end, length);
count = min(fin - from, length - to);
direction = 1;
if (from < to && to < from + count) {
direction = -1;
from += count - 1;
to += count - 1;
}
while (count > 0) {
if (objHasOwnProperty.call(arr, from)) arr[to] = arr[from];
else delete arr[from];
from += direction;
to += direction;
count -= 1;
}
return arr;
};

11
node_modules/es5-ext/array/#/diff.js generated vendored
View File

@ -1,11 +0,0 @@
"use strict";
var value = require("../../object/valid-value")
, contains = require("./contains")
, filter = Array.prototype.filter;
module.exports = function (other) {
value(this);
value(other);
return filter.call(this, function (item) { return !contains.call(other, item); });
};

View File

@ -1,28 +0,0 @@
"use strict";
var numberIsNaN = require("../../number/is-nan")
, toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, indexOf = Array.prototype.indexOf
, objHasOwnProperty = Object.prototype.hasOwnProperty
, abs = Math.abs
, floor = Math.floor;
module.exports = function (searchElement /*, fromIndex*/) {
var i, length, fromIndex, val;
if (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments);
length = toPosInt(value(this).length);
fromIndex = arguments[1];
if (isNaN(fromIndex)) fromIndex = 0;
else if (fromIndex >= 0) fromIndex = floor(fromIndex);
else fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
for (i = fromIndex; i < length; ++i) {
if (objHasOwnProperty.call(this, i)) {
val = this[i];
if (numberIsNaN(val)) return i; // Jslint: ignore
}
}
return -1;
};

View File

@ -1,31 +0,0 @@
"use strict";
var numberIsNaN = require("../../number/is-nan")
, toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, lastIndexOf = Array.prototype.lastIndexOf
, objHasOwnProperty = Object.prototype.hasOwnProperty
, abs = Math.abs
, floor = Math.floor;
module.exports = function (searchElement /*, fromIndex*/) {
var i, fromIndex, val;
if (!numberIsNaN(searchElement)) {
// Jslint: ignore
return lastIndexOf.apply(this, arguments);
}
value(this);
fromIndex = arguments[1];
if (isNaN(fromIndex)) fromIndex = toPosInt(this.length) - 1;
else if (fromIndex >= 0) fromIndex = floor(fromIndex);
else fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
for (i = fromIndex; i >= 0; --i) {
if (objHasOwnProperty.call(this, i)) {
val = this[i];
if (numberIsNaN(val)) return i; // Jslint: ignore
}
}
return -1;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "entries", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.entries : require("./shim");

View File

@ -1,15 +0,0 @@
"use strict";
module.exports = function () {
var arr = [1, "foo"], iterator, result;
if (typeof arr.entries !== "function") return false;
iterator = arr.entries();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result || !result.value) return false;
if (result.value[0] !== 0) return false;
if (result.value[1] !== 1) return false;
if (result.done !== false) return false;
return true;
};

View File

@ -1,4 +0,0 @@
"use strict";
var ArrayIterator = require("es6-iterator/array");
module.exports = function () { return new ArrayIterator(this, "key+value"); };

View File

@ -1,25 +0,0 @@
"use strict";
var value = require("../../object/valid-value")
, aFrom = require("../from")
, toArray = require("../to-array")
, contains = require("./contains")
, byLength = require("./_compare-by-length")
, filter = Array.prototype.filter
, push = Array.prototype.push;
module.exports = function (/* …lists*/) {
var lists, seen, result;
if (!arguments.length) return aFrom(this);
push.apply((lists = [this]), arguments);
lists.forEach(value);
seen = [];
result = [];
lists.sort(byLength).forEach(function (list) {
result = result
.filter(function (item) { return !contains.call(list, item); })
.concat(filter.call(list, function (item) { return !contains.call(seen, item); }));
push.apply(seen, toArray(list));
});
return result;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "fill", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.fill : require("./shim");

View File

@ -1,7 +0,0 @@
"use strict";
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.fill !== "function") return false;
return String(arr.fill(-1, -3)) === "1,2,3,-1,-1,-1";
};

View File

@ -1,25 +0,0 @@
// Taken from: https://github.com/paulmillr/es6-shim/
"use strict";
var toInteger = require("../../../number/to-integer")
, toPosInt = require("../../../number/to-pos-integer")
, validValue = require("../../../object/valid-value")
, max = Math.max
, min = Math.min;
module.exports = function (value /*, start, end*/) {
var arr = validValue(this)
, start = arguments[1]
, end = arguments[2]
, length = toPosInt(arr.length)
, relativeStart
, i;
start = start === undefined ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
relativeStart = start < 0 ? max(length + start, 0) : min(start, length);
for (i = relativeStart; i < length && i < end; ++i) arr[i] = value;
return arr;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "filter", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.filter : require("./shim");

View File

@ -1,6 +0,0 @@
"use strict";
var SubArray = require("../../_sub-array-dummy-safe")
, pass = function () { return true; };
module.exports = function () { return new SubArray().filter(pass) instanceof SubArray; };

View File

@ -1,23 +0,0 @@
"use strict";
var isPlainArray = require("../../is-plain-array")
, callable = require("../../../object/valid-callable")
, isArray = Array.isArray
, filter = Array.prototype.filter
, forEach = Array.prototype.forEach
, call = Function.prototype.call;
module.exports = function (callbackFn /*, thisArg*/) {
var result, thisArg, i;
if (!this || !isArray(this) || isPlainArray(this)) {
return filter.apply(this, arguments);
}
callable(callbackFn);
thisArg = arguments[1];
result = new this.constructor();
i = 0;
forEach.call(this, function (val, j, self) {
if (call.call(callbackFn, thisArg, val, j, self)) result[i++] = val;
});
return result;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "findIndex", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.findIndex : require("./shim");

View File

@ -1,9 +0,0 @@
"use strict";
var fn = function (value) { return value > 3; };
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.findIndex !== "function") return false;
return arr.findIndex(fn) === 3;
};

View File

@ -1,26 +0,0 @@
"use strict";
var callable = require("../../../object/valid-callable")
, ensureValue = require("../../../object/valid-value")
, some = Array.prototype.some
, apply = Function.prototype.apply;
module.exports = function (predicate /*, thisArg*/) {
var k, self;
self = Object(ensureValue(this));
callable(predicate);
return some.call(
self,
function (value, index) {
if (apply.call(predicate, this, arguments)) {
k = index;
return true;
}
return false;
},
arguments[1]
)
? k
: -1;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "find", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.find : require("./shim");

View File

@ -1,9 +0,0 @@
"use strict";
var fn = function (value) { return value > 3; };
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.find !== "function") return false;
return arr.find(fn) === 4;
};

View File

@ -1,9 +0,0 @@
"use strict";
var findIndex = require("../find-index/shim");
// eslint-disable-next-line no-unused-vars
module.exports = function (predicate /*, thisArg*/) {
var index = findIndex.apply(this, arguments);
return index === -1 ? undefined : this[index];
};

View File

@ -1,15 +0,0 @@
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function () {
var i, length;
if (!(length = toPosInt(value(this).length))) return null;
i = 0;
while (!objHasOwnProperty.call(this, i)) {
if (++i === length) return null;
}
return i;
};

View File

@ -1,9 +0,0 @@
"use strict";
var firstIndex = require("./first-index");
module.exports = function () {
var i;
if ((i = firstIndex.call(this)) !== null) return this[i];
return undefined;
};

View File

@ -1,40 +0,0 @@
// Stack grow safe implementation
"use strict";
var ensureValue = require("../../object/valid-value")
, isArray = Array.isArray
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function () {
var input = ensureValue(this), index = 0, remaining, remainingIndexes, length, i, result = [];
// Jslint: ignore
main: while (input) {
length = input.length;
for (i = index; i < length; ++i) {
if (!objHasOwnProperty.call(input, i)) continue;
if (isArray(input[i])) {
if (i < length - 1) {
// eslint-disable-next-line max-depth
if (!remaining) {
remaining = [];
remainingIndexes = [];
}
remaining.push(input);
remainingIndexes.push(i + 1);
}
input = input[i];
index = 0;
continue main;
}
result.push(input[i]);
}
if (remaining) {
input = remaining.pop();
index = remainingIndexes.pop();
} else {
input = null;
}
}
return result;
};

View File

@ -1,19 +0,0 @@
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty
, call = Function.prototype.call;
module.exports = function (cb /*, thisArg*/) {
var i, self, thisArg;
self = Object(value(this));
callable(cb);
thisArg = arguments[1];
for (i = toPosInt(self.length) - 1; i >= 0; --i) {
if (objHasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self);
}
};

View File

@ -1,28 +0,0 @@
// Inspired by Underscore's groupBy:
// http://documentcloud.github.com/underscore/#groupBy
"use strict";
var callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, forEach = Array.prototype.forEach
, apply = Function.prototype.apply;
module.exports = function (cb /*, thisArg*/) {
var result;
value(this);
callable(cb);
result = Object.create(null);
forEach.call(
this,
function (item) {
var key = apply.call(cb, this, arguments);
if (!result[key]) result[key] = [];
result[key].push(item);
},
arguments[1]
);
return result;
};

View File

@ -1,41 +0,0 @@
"use strict";
module.exports = {
"@@iterator": require("./@@iterator"),
"binarySearch": require("./binary-search"),
"clear": require("./clear"),
"compact": require("./compact"),
"concat": require("./concat"),
"contains": require("./contains"),
"copyWithin": require("./copy-within"),
"diff": require("./diff"),
"eIndexOf": require("./e-index-of"),
"eLastIndexOf": require("./e-last-index-of"),
"entries": require("./entries"),
"exclusion": require("./exclusion"),
"fill": require("./fill"),
"filter": require("./filter"),
"find": require("./find"),
"findIndex": require("./find-index"),
"first": require("./first"),
"firstIndex": require("./first-index"),
"flatten": require("./flatten"),
"forEachRight": require("./for-each-right"),
"keys": require("./keys"),
"group": require("./group"),
"indexesOf": require("./indexes-of"),
"intersection": require("./intersection"),
"isCopy": require("./is-copy"),
"isEmpty": require("./is-empty"),
"isUniq": require("./is-uniq"),
"last": require("./last"),
"lastIndex": require("./last-index"),
"map": require("./map"),
"remove": require("./remove"),
"separate": require("./separate"),
"slice": require("./slice"),
"someRight": require("./some-right"),
"splice": require("./splice"),
"uniq": require("./uniq"),
"values": require("./values")
};

View File

@ -1,12 +0,0 @@
"use strict";
var indexOf = require("./e-index-of");
module.exports = function (value /*, fromIndex*/) {
var result = [], i, fromIndex = arguments[1];
while ((i = indexOf.call(this, value, fromIndex)) !== -1) {
result.push(i);
fromIndex = i + 1;
}
return result;
};

View File

@ -1,19 +0,0 @@
"use strict";
var value = require("../../object/valid-value")
, contains = require("./contains")
, byLength = require("./_compare-by-length")
, filter = Array.prototype.filter
, push = Array.prototype.push
, slice = Array.prototype.slice;
module.exports = function (/* …list*/) {
var lists;
if (!arguments.length) slice.call(this);
push.apply((lists = [this]), arguments);
lists.forEach(value);
lists.sort(byLength);
return lists.reduce(function (list1, list2) {
return filter.call(list1, function (item) { return contains.call(list2, item); });
});
};

View File

@ -1,21 +0,0 @@
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, eq = require("../../object/eq")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function (other) {
var i, length;
value(this);
value(other);
length = toPosInt(this.length);
if (length !== toPosInt(other.length)) return false;
for (i = 0; i < length; ++i) {
if (objHasOwnProperty.call(this, i) !== objHasOwnProperty.call(other, i)) {
return false;
}
if (!eq(this[i], other[i])) return false;
}
return true;
};

View File

@ -1,6 +0,0 @@
"use strict";
var ensureArray = require("../../object/ensure-array")
, firstIndex = require("./first-index");
module.exports = function () { return firstIndex.call(ensureArray(this)) === null; };

View File

@ -1,9 +0,0 @@
"use strict";
var indexOf = require("./e-index-of")
, every = Array.prototype.every
, isFirst;
isFirst = function (value, index) { return indexOf.call(this, value) === index; };
module.exports = function () { return every.call(this, isFirst, this); };

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "keys", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.keys : require("./shim");

View File

@ -1,14 +0,0 @@
"use strict";
module.exports = function () {
var arr = [1, "foo"], iterator, result;
if (typeof arr.keys !== "function") return false;
iterator = arr.keys();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result) return false;
if (result.value !== 0) return false;
if (result.done !== false) return false;
return true;
};

View File

@ -1,4 +0,0 @@
"use strict";
var ArrayIterator = require("es6-iterator/array");
module.exports = function () { return new ArrayIterator(this, "key"); };

View File

@ -1,15 +0,0 @@
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function () {
var i, length;
if (!(length = toPosInt(value(this).length))) return null;
i = length - 1;
while (!objHasOwnProperty.call(this, i)) {
if (--i === -1) return null;
}
return i;
};

View File

@ -1,9 +0,0 @@
"use strict";
var lastIndex = require("./last-index");
module.exports = function () {
var i;
if ((i = lastIndex.call(this)) !== null) return this[i];
return undefined;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "map", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.map : require("./shim");

View File

@ -1,6 +0,0 @@
"use strict";
var identity = require("../../../function/identity")
, SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().map(identity) instanceof SubArray; };

View File

@ -1,22 +0,0 @@
"use strict";
var isPlainArray = require("../../is-plain-array")
, callable = require("../../../object/valid-callable")
, isArray = Array.isArray
, map = Array.prototype.map
, forEach = Array.prototype.forEach
, call = Function.prototype.call;
module.exports = function (callbackFn /*, thisArg*/) {
var result, thisArg;
if (!this || !isArray(this) || isPlainArray(this)) {
return map.apply(this, arguments);
}
callable(callbackFn);
thisArg = arguments[1];
result = new this.constructor(this.length);
forEach.call(this, function (val, i, self) {
result[i] = call.call(callbackFn, thisArg, val, i, self);
});
return result;
};

View File

@ -1,17 +0,0 @@
"use strict";
var indexOf = require("./e-index-of")
, forEach = Array.prototype.forEach
, splice = Array.prototype.splice;
// eslint-disable-next-line no-unused-vars
module.exports = function (itemToRemove /*, …item*/) {
forEach.call(
arguments,
function (item) {
var index = indexOf.call(this, item);
if (index !== -1) splice.call(this, index, 1);
},
this
);
};

View File

@ -1,10 +0,0 @@
"use strict";
var forEach = Array.prototype.forEach;
module.exports = function (sep) {
var result = [];
forEach.call(this, function (val) { result.push(val, sep); });
result.pop();
return result;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "slice", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.slice : require("./shim");

View File

@ -1,5 +0,0 @@
"use strict";
var SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().slice() instanceof SubArray; };

View File

@ -1,36 +0,0 @@
"use strict";
var toInteger = require("../../../number/to-integer")
, toPosInt = require("../../../number/to-pos-integer")
, isPlainArray = require("../../is-plain-array")
, isArray = Array.isArray
, slice = Array.prototype.slice
, objHasOwnProperty = Object.prototype.hasOwnProperty
, max = Math.max;
module.exports = function (start, end) {
var length, result, i;
if (!this || !isArray(this) || isPlainArray(this)) {
return slice.apply(this, arguments);
}
length = toPosInt(this.length);
start = toInteger(start);
if (start < 0) start = max(length + start, 0);
else if (start > length) start = length;
if (end === undefined) {
end = length;
} else {
end = toInteger(end);
if (end < 0) end = max(length + end, 0);
else if (end > length) end = length;
}
if (start > end) start = end;
result = new this.constructor(end - start);
i = 0;
while (start !== end) {
if (objHasOwnProperty.call(this, start)) result[i] = this[start];
++i;
++start;
}
return result;
};

View File

@ -1,21 +0,0 @@
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty
, call = Function.prototype.call;
module.exports = function (cb /*, thisArg*/) {
var i, self, thisArg;
self = Object(value(this));
callable(cb);
thisArg = arguments[1];
for (i = toPosInt(self.length) - 1; i >= 0; --i) {
if (objHasOwnProperty.call(self, i) && call.call(cb, thisArg, self[i], i, self)) {
return true;
}
}
return false;
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "splice", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.splice : require("./shim");

View File

@ -1,5 +0,0 @@
"use strict";
var SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().splice(0) instanceof SubArray; };

View File

@ -1,15 +0,0 @@
"use strict";
var isPlainArray = require("../../is-plain-array")
, isArray = Array.isArray
, splice = Array.prototype.splice
, forEach = Array.prototype.forEach;
// eslint-disable-next-line no-unused-vars
module.exports = function (start, deleteCount /*, …items*/) {
var arr = splice.apply(this, arguments), result;
if (!this || !isArray(this) || isPlainArray(this)) return arr;
result = new this.constructor(arr.length);
forEach.call(arr, function (val, i) { result[i] = val; });
return result;
};

View File

@ -1,9 +0,0 @@
"use strict";
var indexOf = require("./e-index-of")
, filter = Array.prototype.filter
, isFirst;
isFirst = function (value, index) { return indexOf.call(this, value) === index; };
module.exports = function () { return filter.call(this, isFirst, this); };

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "values", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.values : require("./shim");

View File

@ -1,14 +0,0 @@
"use strict";
module.exports = function () {
var arr = ["foo", 1], iterator, result;
if (typeof arr.values !== "function") return false;
iterator = arr.values();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result) return false;
if (result.value !== "foo") return false;
if (result.done !== false) return false;
return true;
};

View File

@ -1,4 +0,0 @@
"use strict";
var ArrayIterator = require("es6-iterator/array");
module.exports = function () { return new ArrayIterator(this, "value"); };

View File

@ -1,14 +0,0 @@
"use strict";
module.exports = (function () {
var SubArray = require("./_sub-array-dummy")
, arr;
if (!SubArray) return false;
arr = new SubArray();
if (!Array.isArray(arr)) return false;
if (!(arr instanceof SubArray)) return false;
arr[34] = "foo";
return arr.length === 35;
})();

View File

@ -1,22 +0,0 @@
"use strict";
var setPrototypeOf = require("../object/set-prototype-of")
, isExtensible = require("./_is-extensible");
module.exports = (function () {
var SubArray;
if (isExtensible) return require("./_sub-array-dummy");
if (!setPrototypeOf) return null;
SubArray = function () {
var arr = Array.apply(this, arguments);
setPrototypeOf(arr, SubArray.prototype);
return arr;
};
setPrototypeOf(SubArray, Array);
SubArray.prototype = Object.create(Array.prototype, {
constructor: { value: SubArray, enumerable: false, writable: true, configurable: true }
});
return SubArray;
})();

View File

@ -1,15 +0,0 @@
"use strict";
var setPrototypeOf = require("../object/set-prototype-of");
module.exports = (function () {
var SubArray;
if (!setPrototypeOf) return null;
SubArray = function () { Array.apply(this, arguments); };
setPrototypeOf(SubArray, Array);
SubArray.prototype = Object.create(Array.prototype, {
constructor: { value: SubArray, enumerable: false, writable: true, configurable: true }
});
return SubArray;
})();

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array, "from", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.from : require("./shim");

View File

@ -1,9 +0,0 @@
"use strict";
module.exports = function () {
var from = Array.from, arr, result;
if (typeof from !== "function") return false;
arr = ["raz", "dwa"];
result = from(arr);
return Boolean(result && result !== arr && result[1] === "dwa");
};

View File

@ -1,119 +0,0 @@
"use strict";
var iteratorSymbol = require("es6-symbol").iterator
, isArguments = require("../../function/is-arguments")
, isFunction = require("../../function/is-function")
, toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, validValue = require("../../object/valid-value")
, isValue = require("../../object/is-value")
, isString = require("../../string/is-string")
, isArray = Array.isArray
, call = Function.prototype.call
, desc = { configurable: true, enumerable: true, writable: true, value: null }
, defineProperty = Object.defineProperty;
// eslint-disable-next-line complexity, max-lines-per-function
module.exports = function (arrayLike /*, mapFn, thisArg*/) {
var mapFn = arguments[1]
, thisArg = arguments[2]
, Context
, i
, j
, arr
, length
, code
, iterator
, result
, getIterator
, value;
arrayLike = Object(validValue(arrayLike));
if (isValue(mapFn)) callable(mapFn);
if (!this || this === Array || !isFunction(this)) {
// Result: Plain array
if (!mapFn) {
if (isArguments(arrayLike)) {
// Source: Arguments
length = arrayLike.length;
if (length !== 1) return Array.apply(null, arrayLike);
arr = new Array(1);
arr[0] = arrayLike[0];
return arr;
}
if (isArray(arrayLike)) {
// Source: Array
arr = new Array((length = arrayLike.length));
for (i = 0; i < length; ++i) arr[i] = arrayLike[i];
return arr;
}
}
arr = [];
} else {
// Result: Non plain array
Context = this;
}
if (!isArray(arrayLike)) {
if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) {
// Source: Iterator
iterator = callable(getIterator).call(arrayLike);
if (Context) arr = new Context();
result = iterator.next();
i = 0;
while (!result.done) {
value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
if (Context) {
desc.value = value;
defineProperty(arr, i, desc);
} else {
arr[i] = value;
}
result = iterator.next();
++i;
}
length = i;
} else if (isString(arrayLike)) {
// Source: String
length = arrayLike.length;
if (Context) arr = new Context();
for (i = 0, j = 0; i < length; ++i) {
value = arrayLike[i];
if (i + 1 < length) {
code = value.charCodeAt(0);
// eslint-disable-next-line max-depth
if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i];
}
value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
if (Context) {
desc.value = value;
defineProperty(arr, j, desc);
} else {
arr[j] = value;
}
++j;
}
length = j;
}
}
if (length === undefined) {
// Source: array or array-like
length = toPosInt(arrayLike.length);
if (Context) arr = new Context(length);
for (i = 0; i < length; ++i) {
value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
if (Context) {
desc.value = value;
defineProperty(arr, i, desc);
} else {
arr[i] = value;
}
}
}
if (Context) {
desc.value = null;
arr.length = length;
}
return arr;
};

View File

@ -1,18 +0,0 @@
"use strict";
var toPosInt = require("../number/to-pos-integer")
, value = require("../object/valid-value")
, slice = Array.prototype.slice;
module.exports = function (length /*, …fill*/) {
var arr, currentLength;
length = toPosInt(value(length));
if (length === 0) return [];
arr = arguments.length < 2 ? [undefined] : slice.call(arguments, 1, 1 + length);
while ((currentLength = arr.length) < length) {
arr = arr.concat(arr.slice(0, length - currentLength));
}
return arr;
};

11
node_modules/es5-ext/array/index.js generated vendored
View File

@ -1,11 +0,0 @@
"use strict";
module.exports = {
"#": require("./#"),
"from": require("./from"),
"generate": require("./generate"),
"isPlainArray": require("./is-plain-array"),
"of": require("./of"),
"toArray": require("./to-array"),
"validArray": require("./valid-array")
};

View File

@ -1,11 +0,0 @@
"use strict";
var isArray = Array.isArray, getPrototypeOf = Object.getPrototypeOf;
module.exports = function (obj) {
var proto;
if (!obj || !isArray(obj)) return false;
proto = getPrototypeOf(obj);
if (!isArray(proto)) return false;
return !isArray(getPrototypeOf(proto));
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array, "of", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.of : require("./shim");

View File

@ -1,8 +0,0 @@
"use strict";
module.exports = function () {
var of = Array.of, result;
if (typeof of !== "function") return false;
result = of("foo", "bar");
return Boolean(result && result[1] === "bar");
};

View File

@ -1,19 +0,0 @@
"use strict";
var isFunction = require("../../function/is-function")
, slice = Array.prototype.slice
, defineProperty = Object.defineProperty
, desc = { configurable: true, enumerable: true, writable: true, value: null };
module.exports = function (/* …items*/) {
var result, i, length;
if (!this || this === Array || !isFunction(this)) return slice.call(arguments);
result = new this((length = arguments.length));
for (i = 0; i < length; ++i) {
desc.value = arguments[i];
defineProperty(result, i, desc);
}
desc.value = null;
result.length = length;
return result;
};

View File

@ -1,6 +0,0 @@
"use strict";
var from = require("./from")
, isArray = Array.isArray;
module.exports = function (arrayLike) { return isArray(arrayLike) ? arrayLike : from(arrayLike); };

View File

@ -1,8 +0,0 @@
"use strict";
var isArray = Array.isArray;
module.exports = function (value) {
if (isArray(value)) return value;
throw new TypeError(value + " is not an array");
};

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = { isBoolean: require("./is-boolean") };

View File

@ -1,10 +0,0 @@
"use strict";
var objToString = Object.prototype.toString, id = objToString.call(true);
module.exports = function (value) {
return (
typeof value === "boolean" ||
(typeof value === "object" && (value instanceof Boolean || objToString.call(value) === id))
);
};

Some files were not shown because too many files have changed in this diff Show More