prettier 1.6.0 → 2.0.0.pre.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +342 -288
- data/CONTRIBUTING.md +6 -9
- data/LICENSE +1 -1
- data/README.md +11 -12
- data/dist/haml/embed.js +53 -0
- data/dist/haml/parser.js +31 -0
- data/{src → dist}/haml/parser.rb +0 -0
- data/dist/haml/printer.js +336 -0
- data/dist/parser/getInfo.js +17 -0
- data/{src → dist}/parser/netcat.js +1 -0
- data/dist/parser/parseSync.js +142 -0
- data/dist/parser/server.rb +141 -0
- data/dist/plugin.js +143 -0
- data/dist/prettier.js +15 -0
- data/dist/rbs/parser.js +34 -0
- data/{src → dist}/rbs/parser.rb +0 -0
- data/dist/rbs/printer.js +517 -0
- data/dist/ruby/embed.js +110 -0
- data/dist/ruby/nodes/alias.js +59 -0
- data/{src → dist}/ruby/nodes/aref.js +26 -35
- data/dist/ruby/nodes/args.js +165 -0
- data/dist/ruby/nodes/arrays.js +126 -0
- data/dist/ruby/nodes/assign.js +41 -0
- data/dist/ruby/nodes/blocks.js +87 -0
- data/dist/ruby/nodes/calls.js +260 -0
- data/dist/ruby/nodes/case.js +50 -0
- data/dist/ruby/nodes/class.js +54 -0
- data/dist/ruby/nodes/commands.js +124 -0
- data/dist/ruby/nodes/conditionals.js +242 -0
- data/dist/ruby/nodes/constants.js +38 -0
- data/dist/ruby/nodes/flow.js +66 -0
- data/dist/ruby/nodes/hashes.js +130 -0
- data/dist/ruby/nodes/heredocs.js +30 -0
- data/dist/ruby/nodes/hooks.js +35 -0
- data/dist/ruby/nodes/ints.js +27 -0
- data/dist/ruby/nodes/lambdas.js +69 -0
- data/dist/ruby/nodes/loops.js +73 -0
- data/dist/ruby/nodes/massign.js +73 -0
- data/dist/ruby/nodes/methods.js +70 -0
- data/dist/ruby/nodes/operators.js +70 -0
- data/dist/ruby/nodes/params.js +89 -0
- data/dist/ruby/nodes/patterns.js +109 -0
- data/dist/ruby/nodes/regexp.js +45 -0
- data/dist/ruby/nodes/rescue.js +82 -0
- data/dist/ruby/nodes/return.js +75 -0
- data/dist/ruby/nodes/statements.js +111 -0
- data/dist/ruby/nodes/strings.js +218 -0
- data/dist/ruby/nodes/super.js +30 -0
- data/dist/ruby/nodes/undef.js +26 -0
- data/dist/ruby/nodes.js +151 -0
- data/dist/ruby/parser.js +34 -0
- data/{src → dist}/ruby/parser.rb +1195 -254
- data/dist/ruby/printer.js +129 -0
- data/dist/ruby/toProc.js +93 -0
- data/dist/types/haml.js +4 -0
- data/dist/types/plugin.js +3 -0
- data/dist/types/rbs.js +4 -0
- data/dist/types/ruby.js +4 -0
- data/dist/types/utils.js +2 -0
- data/dist/types.js +30 -0
- data/dist/utils/containsAssignment.js +15 -0
- data/dist/utils/getTrailingComma.js +6 -0
- data/dist/utils/hasAncestor.js +15 -0
- data/{src → dist}/utils/inlineEnsureParens.js +16 -17
- data/dist/utils/isEmptyBodyStmt.js +10 -0
- data/dist/utils/isEmptyStmts.js +10 -0
- data/dist/utils/literal.js +8 -0
- data/dist/utils/literallineWithoutBreakParent.js +8 -0
- data/dist/utils/makeCall.js +13 -0
- data/dist/utils/noIndent.js +11 -0
- data/dist/utils/printEmptyCollection.js +44 -0
- data/dist/utils/skipAssignIndent.js +15 -0
- data/dist/utils.js +30 -0
- data/node_modules/prettier/bin-prettier.js +2573 -2264
- data/node_modules/prettier/doc.js +4829 -0
- data/node_modules/prettier/index.js +5979 -6846
- data/node_modules/prettier/package.json +23 -0
- data/node_modules/prettier/parser-angular.js +13 -14
- data/node_modules/prettier/parser-babel.js +7 -7
- data/node_modules/prettier/parser-espree.js +7 -7
- data/node_modules/prettier/parser-flow.js +7 -7
- data/node_modules/prettier/parser-glimmer.js +1 -1
- data/node_modules/prettier/parser-graphql.js +1 -1
- data/node_modules/prettier/parser-html.js +17 -17
- data/node_modules/prettier/parser-markdown.js +9 -9
- data/node_modules/prettier/parser-meriyah.js +7 -7
- data/node_modules/prettier/parser-postcss.js +2 -2
- data/node_modules/prettier/parser-typescript.js +7 -7
- data/node_modules/prettier/parser-yaml.js +2 -2
- data/node_modules/prettier/third-party.js +794 -131
- data/package.json +26 -18
- metadata +76 -67
- data/src/haml/embed.js +0 -87
- data/src/haml/parser.js +0 -23
- data/src/haml/printer.js +0 -438
- data/src/parser/parseSync.js +0 -172
- data/src/parser/server.rb +0 -66
- data/src/plugin.js +0 -148
- data/src/prettier.js +0 -16
- data/src/rbs/parser.js +0 -37
- data/src/rbs/printer.js +0 -643
- data/src/ruby/embed.js +0 -142
- data/src/ruby/nodes/alias.js +0 -73
- data/src/ruby/nodes/args.js +0 -222
- data/src/ruby/nodes/arrays.js +0 -162
- data/src/ruby/nodes/assign.js +0 -47
- data/src/ruby/nodes/blocks.js +0 -90
- data/src/ruby/nodes/calls.js +0 -206
- data/src/ruby/nodes/case.js +0 -65
- data/src/ruby/nodes/class.js +0 -64
- data/src/ruby/nodes/commands.js +0 -131
- data/src/ruby/nodes/conditionals.js +0 -282
- data/src/ruby/nodes/constants.js +0 -43
- data/src/ruby/nodes/flow.js +0 -74
- data/src/ruby/nodes/hashes.js +0 -155
- data/src/ruby/nodes/heredocs.js +0 -36
- data/src/ruby/nodes/hooks.js +0 -34
- data/src/ruby/nodes/ints.js +0 -31
- data/src/ruby/nodes/lambdas.js +0 -76
- data/src/ruby/nodes/loops.js +0 -98
- data/src/ruby/nodes/massign.js +0 -98
- data/src/ruby/nodes/methods.js +0 -74
- data/src/ruby/nodes/operators.js +0 -83
- data/src/ruby/nodes/params.js +0 -106
- data/src/ruby/nodes/patterns.js +0 -157
- data/src/ruby/nodes/regexp.js +0 -56
- data/src/ruby/nodes/rescue.js +0 -101
- data/src/ruby/nodes/return.js +0 -94
- data/src/ruby/nodes/statements.js +0 -142
- data/src/ruby/nodes/strings.js +0 -270
- data/src/ruby/nodes/super.js +0 -35
- data/src/ruby/nodes/undef.js +0 -42
- data/src/ruby/nodes.js +0 -34
- data/src/ruby/parser.js +0 -37
- data/src/ruby/printer.js +0 -147
- data/src/ruby/toProc.js +0 -105
- data/src/utils/containsAssignment.js +0 -11
- data/src/utils/getTrailingComma.js +0 -5
- data/src/utils/hasAncestor.js +0 -17
- data/src/utils/isEmptyBodyStmt.js +0 -7
- data/src/utils/isEmptyStmts.js +0 -11
- data/src/utils/literal.js +0 -7
- data/src/utils/literallineWithoutBreakParent.js +0 -7
- data/src/utils/makeCall.js +0 -14
- data/src/utils/noIndent.js +0 -11
- data/src/utils/printEmptyCollection.js +0 -49
- data/src/utils/skipAssignIndent.js +0 -17
- data/src/utils.js +0 -13
@@ -2491,69 +2491,6 @@ var chalk = createCommonjsModule(function (module) {
|
|
2491
2491
|
var shouldHighlight_1 = shouldHighlight;
|
2492
2492
|
var getChalk_1 = getChalk;
|
2493
2493
|
var _default$1 = highlight;
|
2494
|
-
|
2495
|
-
var jsTokensNs = _interopRequireWildcard$1(jsTokens);
|
2496
|
-
|
2497
|
-
var _chalk = _interopRequireDefault$2(chalk);
|
2498
|
-
|
2499
|
-
function _interopRequireDefault$2(obj) {
|
2500
|
-
return obj && obj.__esModule ? obj : {
|
2501
|
-
default: obj
|
2502
|
-
};
|
2503
|
-
}
|
2504
|
-
|
2505
|
-
function _getRequireWildcardCache$1() {
|
2506
|
-
if (typeof WeakMap !== "function") return null;
|
2507
|
-
var cache = new WeakMap();
|
2508
|
-
|
2509
|
-
_getRequireWildcardCache$1 = function () {
|
2510
|
-
return cache;
|
2511
|
-
};
|
2512
|
-
|
2513
|
-
return cache;
|
2514
|
-
}
|
2515
|
-
|
2516
|
-
function _interopRequireWildcard$1(obj) {
|
2517
|
-
if (obj && obj.__esModule) {
|
2518
|
-
return obj;
|
2519
|
-
}
|
2520
|
-
|
2521
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
2522
|
-
return {
|
2523
|
-
default: obj
|
2524
|
-
};
|
2525
|
-
}
|
2526
|
-
|
2527
|
-
var cache = _getRequireWildcardCache$1();
|
2528
|
-
|
2529
|
-
if (cache && cache.has(obj)) {
|
2530
|
-
return cache.get(obj);
|
2531
|
-
}
|
2532
|
-
|
2533
|
-
var newObj = {};
|
2534
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
2535
|
-
|
2536
|
-
for (var key in obj) {
|
2537
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
2538
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
2539
|
-
|
2540
|
-
if (desc && (desc.get || desc.set)) {
|
2541
|
-
Object.defineProperty(newObj, key, desc);
|
2542
|
-
} else {
|
2543
|
-
newObj[key] = obj[key];
|
2544
|
-
}
|
2545
|
-
}
|
2546
|
-
}
|
2547
|
-
|
2548
|
-
newObj.default = obj;
|
2549
|
-
|
2550
|
-
if (cache) {
|
2551
|
-
cache.set(obj, newObj);
|
2552
|
-
}
|
2553
|
-
|
2554
|
-
return newObj;
|
2555
|
-
}
|
2556
|
-
|
2557
2494
|
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
2558
2495
|
|
2559
2496
|
function getDefs$1(chalk) {
|
@@ -2574,9 +2511,6 @@ const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
2574
2511
|
const BRACKET = /^[()[\]{}]$/;
|
2575
2512
|
let tokenize;
|
2576
2513
|
{
|
2577
|
-
const {
|
2578
|
-
matchToToken
|
2579
|
-
} = jsTokensNs;
|
2580
2514
|
const JSX_TAG = /^[a-z][\w-]*$/i;
|
2581
2515
|
|
2582
2516
|
const getTokenType = function (token, offset, text) {
|
@@ -2608,8 +2542,9 @@ let tokenize;
|
|
2608
2542
|
tokenize = function* (text) {
|
2609
2543
|
let match;
|
2610
2544
|
|
2611
|
-
while (match =
|
2612
|
-
const token = matchToToken(match);
|
2545
|
+
while (match = jsTokens.default.exec(text)) {
|
2546
|
+
const token = jsTokens.matchToToken(match);
|
2547
|
+
|
2613
2548
|
yield {
|
2614
2549
|
type: getTokenType(token, match.index, text),
|
2615
2550
|
value: token.value
|
@@ -2638,14 +2573,14 @@ function highlightTokens(defs, text) {
|
|
2638
2573
|
}
|
2639
2574
|
|
2640
2575
|
function shouldHighlight(options) {
|
2641
|
-
return !!
|
2576
|
+
return !!chalk.supportsColor || options.forceColor;
|
2642
2577
|
}
|
2643
2578
|
|
2644
2579
|
function getChalk(options) {
|
2645
|
-
return options.forceColor ? new
|
2580
|
+
return options.forceColor ? new chalk.constructor({
|
2646
2581
|
enabled: true,
|
2647
2582
|
level: 1
|
2648
|
-
}) :
|
2583
|
+
}) : chalk;
|
2649
2584
|
}
|
2650
2585
|
|
2651
2586
|
function highlight(code, options = {}) {
|
@@ -2668,61 +2603,6 @@ var lib$1 = /*#__PURE__*/Object.defineProperty({
|
|
2668
2603
|
|
2669
2604
|
var codeFrameColumns_1 = codeFrameColumns$1;
|
2670
2605
|
var default_1 = _default;
|
2671
|
-
|
2672
|
-
var _highlight = _interopRequireWildcard(lib$1);
|
2673
|
-
|
2674
|
-
function _getRequireWildcardCache() {
|
2675
|
-
if (typeof WeakMap !== "function") return null;
|
2676
|
-
var cache = new WeakMap();
|
2677
|
-
|
2678
|
-
_getRequireWildcardCache = function () {
|
2679
|
-
return cache;
|
2680
|
-
};
|
2681
|
-
|
2682
|
-
return cache;
|
2683
|
-
}
|
2684
|
-
|
2685
|
-
function _interopRequireWildcard(obj) {
|
2686
|
-
if (obj && obj.__esModule) {
|
2687
|
-
return obj;
|
2688
|
-
}
|
2689
|
-
|
2690
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
2691
|
-
return {
|
2692
|
-
default: obj
|
2693
|
-
};
|
2694
|
-
}
|
2695
|
-
|
2696
|
-
var cache = _getRequireWildcardCache();
|
2697
|
-
|
2698
|
-
if (cache && cache.has(obj)) {
|
2699
|
-
return cache.get(obj);
|
2700
|
-
}
|
2701
|
-
|
2702
|
-
var newObj = {};
|
2703
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
2704
|
-
|
2705
|
-
for (var key in obj) {
|
2706
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
2707
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
2708
|
-
|
2709
|
-
if (desc && (desc.get || desc.set)) {
|
2710
|
-
Object.defineProperty(newObj, key, desc);
|
2711
|
-
} else {
|
2712
|
-
newObj[key] = obj[key];
|
2713
|
-
}
|
2714
|
-
}
|
2715
|
-
}
|
2716
|
-
|
2717
|
-
newObj.default = obj;
|
2718
|
-
|
2719
|
-
if (cache) {
|
2720
|
-
cache.set(obj, newObj);
|
2721
|
-
}
|
2722
|
-
|
2723
|
-
return newObj;
|
2724
|
-
}
|
2725
|
-
|
2726
2606
|
let deprecationWarningShown = false;
|
2727
2607
|
|
2728
2608
|
function getDefs(chalk) {
|
@@ -2799,8 +2679,8 @@ function getMarkerLines(loc, source, opts) {
|
|
2799
2679
|
}
|
2800
2680
|
|
2801
2681
|
function codeFrameColumns$1(rawLines, loc, opts = {}) {
|
2802
|
-
const highlighted = (opts.highlightCode || opts.forceColor) && (0,
|
2803
|
-
const chalk = (0,
|
2682
|
+
const highlighted = (opts.highlightCode || opts.forceColor) && (0, lib$1.shouldHighlight)(opts);
|
2683
|
+
const chalk = (0, lib$1.getChalk)(opts);
|
2804
2684
|
const defs = getDefs(chalk);
|
2805
2685
|
|
2806
2686
|
const maybeHighlight = (chalkFn, string) => {
|
@@ -2815,7 +2695,7 @@ function codeFrameColumns$1(rawLines, loc, opts = {}) {
|
|
2815
2695
|
} = getMarkerLines(loc, lines, opts);
|
2816
2696
|
const hasColumns = loc.start && typeof loc.start.column === "number";
|
2817
2697
|
const numberMaxWidth = String(end).length;
|
2818
|
-
const highlightedLines = highlighted ? (0,
|
2698
|
+
const highlightedLines = highlighted ? (0, lib$1.default)(rawLines, opts) : rawLines;
|
2819
2699
|
let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
|
2820
2700
|
const number = start + 1 + index;
|
2821
2701
|
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
@@ -7780,6 +7660,789 @@ var resolveSeqD03cb037 = {
|
|
7780
7660
|
toJSON: toJSON_1
|
7781
7661
|
};
|
7782
7662
|
|
7663
|
+
var check = function (it) {
|
7664
|
+
return it && it.Math == Math && it;
|
7665
|
+
};
|
7666
|
+
|
7667
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
7668
|
+
var global =
|
7669
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
7670
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
7671
|
+
check(typeof window == 'object' && window) ||
|
7672
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
7673
|
+
check(typeof self == 'object' && self) ||
|
7674
|
+
check(typeof global == 'object' && global) ||
|
7675
|
+
// eslint-disable-next-line no-new-func -- fallback
|
7676
|
+
(function () { return this; })() || Function('return this')();
|
7677
|
+
|
7678
|
+
var fails = function (exec) {
|
7679
|
+
try {
|
7680
|
+
return !!exec();
|
7681
|
+
} catch (error) {
|
7682
|
+
return true;
|
7683
|
+
}
|
7684
|
+
};
|
7685
|
+
|
7686
|
+
// Detect IE8's incomplete defineProperty implementation
|
7687
|
+
var descriptors = !fails(function () {
|
7688
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
7689
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
7690
|
+
});
|
7691
|
+
|
7692
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
7693
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
7694
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
7695
|
+
|
7696
|
+
// Nashorn ~ JDK8 bug
|
7697
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
7698
|
+
|
7699
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
7700
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
7701
|
+
var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
7702
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
7703
|
+
return !!descriptor && descriptor.enumerable;
|
7704
|
+
} : $propertyIsEnumerable;
|
7705
|
+
|
7706
|
+
var objectPropertyIsEnumerable = {
|
7707
|
+
f: f$4
|
7708
|
+
};
|
7709
|
+
|
7710
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
7711
|
+
return {
|
7712
|
+
enumerable: !(bitmap & 1),
|
7713
|
+
configurable: !(bitmap & 2),
|
7714
|
+
writable: !(bitmap & 4),
|
7715
|
+
value: value
|
7716
|
+
};
|
7717
|
+
};
|
7718
|
+
|
7719
|
+
var toString$1 = {}.toString;
|
7720
|
+
|
7721
|
+
var classofRaw = function (it) {
|
7722
|
+
return toString$1.call(it).slice(8, -1);
|
7723
|
+
};
|
7724
|
+
|
7725
|
+
var split = ''.split;
|
7726
|
+
|
7727
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
7728
|
+
var indexedObject = fails(function () {
|
7729
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
7730
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
7731
|
+
return !Object('z').propertyIsEnumerable(0);
|
7732
|
+
}) ? function (it) {
|
7733
|
+
return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
7734
|
+
} : Object;
|
7735
|
+
|
7736
|
+
// `RequireObjectCoercible` abstract operation
|
7737
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
7738
|
+
var requireObjectCoercible = function (it) {
|
7739
|
+
if (it == undefined) throw TypeError("Can't call method on " + it);
|
7740
|
+
return it;
|
7741
|
+
};
|
7742
|
+
|
7743
|
+
// toObject with fallback for non-array-like ES3 strings
|
7744
|
+
|
7745
|
+
|
7746
|
+
|
7747
|
+
var toIndexedObject = function (it) {
|
7748
|
+
return indexedObject(requireObjectCoercible(it));
|
7749
|
+
};
|
7750
|
+
|
7751
|
+
var isObject = function (it) {
|
7752
|
+
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
7753
|
+
};
|
7754
|
+
|
7755
|
+
var aFunction$1 = function (variable) {
|
7756
|
+
return typeof variable == 'function' ? variable : undefined;
|
7757
|
+
};
|
7758
|
+
|
7759
|
+
var getBuiltIn = function (namespace, method) {
|
7760
|
+
return arguments.length < 2 ? aFunction$1(global[namespace]) : global[namespace] && global[namespace][method];
|
7761
|
+
};
|
7762
|
+
|
7763
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
7764
|
+
|
7765
|
+
var process$1 = global.process;
|
7766
|
+
var Deno = global.Deno;
|
7767
|
+
var versions = process$1 && process$1.versions || Deno && Deno.version;
|
7768
|
+
var v8 = versions && versions.v8;
|
7769
|
+
var match, version;
|
7770
|
+
|
7771
|
+
if (v8) {
|
7772
|
+
match = v8.split('.');
|
7773
|
+
version = match[0] < 4 ? 1 : match[0] + match[1];
|
7774
|
+
} else if (engineUserAgent) {
|
7775
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
7776
|
+
if (!match || match[1] >= 74) {
|
7777
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
7778
|
+
if (match) version = match[1];
|
7779
|
+
}
|
7780
|
+
}
|
7781
|
+
|
7782
|
+
var engineV8Version = version && +version;
|
7783
|
+
|
7784
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
7785
|
+
|
7786
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
7787
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
7788
|
+
var symbol = Symbol();
|
7789
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
7790
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
7791
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
7792
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
7793
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
7794
|
+
});
|
7795
|
+
|
7796
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
7797
|
+
|
7798
|
+
var useSymbolAsUid = nativeSymbol
|
7799
|
+
&& !Symbol.sham
|
7800
|
+
&& typeof Symbol.iterator == 'symbol';
|
7801
|
+
|
7802
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
7803
|
+
return typeof it == 'symbol';
|
7804
|
+
} : function (it) {
|
7805
|
+
var $Symbol = getBuiltIn('Symbol');
|
7806
|
+
return typeof $Symbol == 'function' && Object(it) instanceof $Symbol;
|
7807
|
+
};
|
7808
|
+
|
7809
|
+
// `OrdinaryToPrimitive` abstract operation
|
7810
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
7811
|
+
var ordinaryToPrimitive = function (input, pref) {
|
7812
|
+
var fn, val;
|
7813
|
+
if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
7814
|
+
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
7815
|
+
if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
7816
|
+
throw TypeError("Can't convert object to primitive value");
|
7817
|
+
};
|
7818
|
+
|
7819
|
+
var setGlobal = function (key, value) {
|
7820
|
+
try {
|
7821
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
7822
|
+
Object.defineProperty(global, key, { value: value, configurable: true, writable: true });
|
7823
|
+
} catch (error) {
|
7824
|
+
global[key] = value;
|
7825
|
+
} return value;
|
7826
|
+
};
|
7827
|
+
|
7828
|
+
var SHARED = '__core-js_shared__';
|
7829
|
+
var store$1 = global[SHARED] || setGlobal(SHARED, {});
|
7830
|
+
|
7831
|
+
var sharedStore = store$1;
|
7832
|
+
|
7833
|
+
var shared = createCommonjsModule(function (module) {
|
7834
|
+
(module.exports = function (key, value) {
|
7835
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
7836
|
+
})('versions', []).push({
|
7837
|
+
version: '3.17.3',
|
7838
|
+
mode: 'global',
|
7839
|
+
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
7840
|
+
});
|
7841
|
+
});
|
7842
|
+
|
7843
|
+
// `ToObject` abstract operation
|
7844
|
+
// https://tc39.es/ecma262/#sec-toobject
|
7845
|
+
var toObject = function (argument) {
|
7846
|
+
return Object(requireObjectCoercible(argument));
|
7847
|
+
};
|
7848
|
+
|
7849
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
7850
|
+
|
7851
|
+
var has$1 = Object.hasOwn || function hasOwn(it, key) {
|
7852
|
+
return hasOwnProperty.call(toObject(it), key);
|
7853
|
+
};
|
7854
|
+
|
7855
|
+
var id = 0;
|
7856
|
+
var postfix = Math.random();
|
7857
|
+
|
7858
|
+
var uid = function (key) {
|
7859
|
+
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
7860
|
+
};
|
7861
|
+
|
7862
|
+
var WellKnownSymbolsStore = shared('wks');
|
7863
|
+
var Symbol$1 = global.Symbol;
|
7864
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
7865
|
+
|
7866
|
+
var wellKnownSymbol = function (name) {
|
7867
|
+
if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
7868
|
+
if (nativeSymbol && has$1(Symbol$1, name)) {
|
7869
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
7870
|
+
} else {
|
7871
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
7872
|
+
}
|
7873
|
+
} return WellKnownSymbolsStore[name];
|
7874
|
+
};
|
7875
|
+
|
7876
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
7877
|
+
|
7878
|
+
// `ToPrimitive` abstract operation
|
7879
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
7880
|
+
var toPrimitive = function (input, pref) {
|
7881
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
7882
|
+
var exoticToPrim = input[TO_PRIMITIVE];
|
7883
|
+
var result;
|
7884
|
+
if (exoticToPrim !== undefined) {
|
7885
|
+
if (pref === undefined) pref = 'default';
|
7886
|
+
result = exoticToPrim.call(input, pref);
|
7887
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
7888
|
+
throw TypeError("Can't convert object to primitive value");
|
7889
|
+
}
|
7890
|
+
if (pref === undefined) pref = 'number';
|
7891
|
+
return ordinaryToPrimitive(input, pref);
|
7892
|
+
};
|
7893
|
+
|
7894
|
+
// `ToPropertyKey` abstract operation
|
7895
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
7896
|
+
var toPropertyKey = function (argument) {
|
7897
|
+
var key = toPrimitive(argument, 'string');
|
7898
|
+
return isSymbol(key) ? key : String(key);
|
7899
|
+
};
|
7900
|
+
|
7901
|
+
var document = global.document;
|
7902
|
+
// typeof document.createElement is 'object' in old IE
|
7903
|
+
var EXISTS = isObject(document) && isObject(document.createElement);
|
7904
|
+
|
7905
|
+
var documentCreateElement = function (it) {
|
7906
|
+
return EXISTS ? document.createElement(it) : {};
|
7907
|
+
};
|
7908
|
+
|
7909
|
+
// Thank's IE8 for his funny defineProperty
|
7910
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
7911
|
+
// eslint-disable-next-line es/no-object-defineproperty -- requied for testing
|
7912
|
+
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
7913
|
+
get: function () { return 7; }
|
7914
|
+
}).a != 7;
|
7915
|
+
});
|
7916
|
+
|
7917
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
7918
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
7919
|
+
|
7920
|
+
// `Object.getOwnPropertyDescriptor` method
|
7921
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
7922
|
+
var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
7923
|
+
O = toIndexedObject(O);
|
7924
|
+
P = toPropertyKey(P);
|
7925
|
+
if (ie8DomDefine) try {
|
7926
|
+
return $getOwnPropertyDescriptor(O, P);
|
7927
|
+
} catch (error) { /* empty */ }
|
7928
|
+
if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
7929
|
+
};
|
7930
|
+
|
7931
|
+
var objectGetOwnPropertyDescriptor = {
|
7932
|
+
f: f$3
|
7933
|
+
};
|
7934
|
+
|
7935
|
+
var anObject = function (it) {
|
7936
|
+
if (!isObject(it)) {
|
7937
|
+
throw TypeError(String(it) + ' is not an object');
|
7938
|
+
} return it;
|
7939
|
+
};
|
7940
|
+
|
7941
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
7942
|
+
var $defineProperty = Object.defineProperty;
|
7943
|
+
|
7944
|
+
// `Object.defineProperty` method
|
7945
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
7946
|
+
var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
|
7947
|
+
anObject(O);
|
7948
|
+
P = toPropertyKey(P);
|
7949
|
+
anObject(Attributes);
|
7950
|
+
if (ie8DomDefine) try {
|
7951
|
+
return $defineProperty(O, P, Attributes);
|
7952
|
+
} catch (error) { /* empty */ }
|
7953
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
7954
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
7955
|
+
return O;
|
7956
|
+
};
|
7957
|
+
|
7958
|
+
var objectDefineProperty = {
|
7959
|
+
f: f$2
|
7960
|
+
};
|
7961
|
+
|
7962
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
7963
|
+
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
7964
|
+
} : function (object, key, value) {
|
7965
|
+
object[key] = value;
|
7966
|
+
return object;
|
7967
|
+
};
|
7968
|
+
|
7969
|
+
var functionToString = Function.toString;
|
7970
|
+
|
7971
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
7972
|
+
if (typeof sharedStore.inspectSource != 'function') {
|
7973
|
+
sharedStore.inspectSource = function (it) {
|
7974
|
+
return functionToString.call(it);
|
7975
|
+
};
|
7976
|
+
}
|
7977
|
+
|
7978
|
+
var inspectSource = sharedStore.inspectSource;
|
7979
|
+
|
7980
|
+
var WeakMap$1 = global.WeakMap;
|
7981
|
+
|
7982
|
+
var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
|
7983
|
+
|
7984
|
+
var keys = shared('keys');
|
7985
|
+
|
7986
|
+
var sharedKey = function (key) {
|
7987
|
+
return keys[key] || (keys[key] = uid(key));
|
7988
|
+
};
|
7989
|
+
|
7990
|
+
var hiddenKeys$1 = {};
|
7991
|
+
|
7992
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
7993
|
+
var WeakMap = global.WeakMap;
|
7994
|
+
var set$1, get, has;
|
7995
|
+
|
7996
|
+
var enforce = function (it) {
|
7997
|
+
return has(it) ? get(it) : set$1(it, {});
|
7998
|
+
};
|
7999
|
+
|
8000
|
+
var getterFor = function (TYPE) {
|
8001
|
+
return function (it) {
|
8002
|
+
var state;
|
8003
|
+
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
8004
|
+
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
8005
|
+
} return state;
|
8006
|
+
};
|
8007
|
+
};
|
8008
|
+
|
8009
|
+
if (nativeWeakMap || sharedStore.state) {
|
8010
|
+
var store = sharedStore.state || (sharedStore.state = new WeakMap());
|
8011
|
+
var wmget = store.get;
|
8012
|
+
var wmhas = store.has;
|
8013
|
+
var wmset = store.set;
|
8014
|
+
set$1 = function (it, metadata) {
|
8015
|
+
if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
8016
|
+
metadata.facade = it;
|
8017
|
+
wmset.call(store, it, metadata);
|
8018
|
+
return metadata;
|
8019
|
+
};
|
8020
|
+
get = function (it) {
|
8021
|
+
return wmget.call(store, it) || {};
|
8022
|
+
};
|
8023
|
+
has = function (it) {
|
8024
|
+
return wmhas.call(store, it);
|
8025
|
+
};
|
8026
|
+
} else {
|
8027
|
+
var STATE = sharedKey('state');
|
8028
|
+
hiddenKeys$1[STATE] = true;
|
8029
|
+
set$1 = function (it, metadata) {
|
8030
|
+
if (has$1(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
8031
|
+
metadata.facade = it;
|
8032
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
8033
|
+
return metadata;
|
8034
|
+
};
|
8035
|
+
get = function (it) {
|
8036
|
+
return has$1(it, STATE) ? it[STATE] : {};
|
8037
|
+
};
|
8038
|
+
has = function (it) {
|
8039
|
+
return has$1(it, STATE);
|
8040
|
+
};
|
8041
|
+
}
|
8042
|
+
|
8043
|
+
var internalState = {
|
8044
|
+
set: set$1,
|
8045
|
+
get: get,
|
8046
|
+
has: has,
|
8047
|
+
enforce: enforce,
|
8048
|
+
getterFor: getterFor
|
8049
|
+
};
|
8050
|
+
|
8051
|
+
var redefine = createCommonjsModule(function (module) {
|
8052
|
+
var getInternalState = internalState.get;
|
8053
|
+
var enforceInternalState = internalState.enforce;
|
8054
|
+
var TEMPLATE = String(String).split('String');
|
8055
|
+
|
8056
|
+
(module.exports = function (O, key, value, options) {
|
8057
|
+
var unsafe = options ? !!options.unsafe : false;
|
8058
|
+
var simple = options ? !!options.enumerable : false;
|
8059
|
+
var noTargetGet = options ? !!options.noTargetGet : false;
|
8060
|
+
var state;
|
8061
|
+
if (typeof value == 'function') {
|
8062
|
+
if (typeof key == 'string' && !has$1(value, 'name')) {
|
8063
|
+
createNonEnumerableProperty(value, 'name', key);
|
8064
|
+
}
|
8065
|
+
state = enforceInternalState(value);
|
8066
|
+
if (!state.source) {
|
8067
|
+
state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
8068
|
+
}
|
8069
|
+
}
|
8070
|
+
if (O === global) {
|
8071
|
+
if (simple) O[key] = value;
|
8072
|
+
else setGlobal(key, value);
|
8073
|
+
return;
|
8074
|
+
} else if (!unsafe) {
|
8075
|
+
delete O[key];
|
8076
|
+
} else if (!noTargetGet && O[key]) {
|
8077
|
+
simple = true;
|
8078
|
+
}
|
8079
|
+
if (simple) O[key] = value;
|
8080
|
+
else createNonEnumerableProperty(O, key, value);
|
8081
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
8082
|
+
})(Function.prototype, 'toString', function toString() {
|
8083
|
+
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
8084
|
+
});
|
8085
|
+
});
|
8086
|
+
|
8087
|
+
var ceil = Math.ceil;
|
8088
|
+
var floor$1 = Math.floor;
|
8089
|
+
|
8090
|
+
// `ToInteger` abstract operation
|
8091
|
+
// https://tc39.es/ecma262/#sec-tointeger
|
8092
|
+
var toInteger = function (argument) {
|
8093
|
+
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1 : ceil)(argument);
|
8094
|
+
};
|
8095
|
+
|
8096
|
+
var min$1 = Math.min;
|
8097
|
+
|
8098
|
+
// `ToLength` abstract operation
|
8099
|
+
// https://tc39.es/ecma262/#sec-tolength
|
8100
|
+
var toLength = function (argument) {
|
8101
|
+
return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
8102
|
+
};
|
8103
|
+
|
8104
|
+
var max = Math.max;
|
8105
|
+
var min = Math.min;
|
8106
|
+
|
8107
|
+
// Helper for a popular repeating case of the spec:
|
8108
|
+
// Let integer be ? ToInteger(index).
|
8109
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
8110
|
+
var toAbsoluteIndex = function (index, length) {
|
8111
|
+
var integer = toInteger(index);
|
8112
|
+
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
8113
|
+
};
|
8114
|
+
|
8115
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
8116
|
+
var createMethod = function (IS_INCLUDES) {
|
8117
|
+
return function ($this, el, fromIndex) {
|
8118
|
+
var O = toIndexedObject($this);
|
8119
|
+
var length = toLength(O.length);
|
8120
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
8121
|
+
var value;
|
8122
|
+
// Array#includes uses SameValueZero equality algorithm
|
8123
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
8124
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
8125
|
+
value = O[index++];
|
8126
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
8127
|
+
if (value != value) return true;
|
8128
|
+
// Array#indexOf ignores holes, Array#includes - not
|
8129
|
+
} else for (;length > index; index++) {
|
8130
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
8131
|
+
} return !IS_INCLUDES && -1;
|
8132
|
+
};
|
8133
|
+
};
|
8134
|
+
|
8135
|
+
var arrayIncludes = {
|
8136
|
+
// `Array.prototype.includes` method
|
8137
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
8138
|
+
includes: createMethod(true),
|
8139
|
+
// `Array.prototype.indexOf` method
|
8140
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
8141
|
+
indexOf: createMethod(false)
|
8142
|
+
};
|
8143
|
+
|
8144
|
+
var indexOf = arrayIncludes.indexOf;
|
8145
|
+
|
8146
|
+
|
8147
|
+
var objectKeysInternal = function (object, names) {
|
8148
|
+
var O = toIndexedObject(object);
|
8149
|
+
var i = 0;
|
8150
|
+
var result = [];
|
8151
|
+
var key;
|
8152
|
+
for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
|
8153
|
+
// Don't enum bug & hidden keys
|
8154
|
+
while (names.length > i) if (has$1(O, key = names[i++])) {
|
8155
|
+
~indexOf(result, key) || result.push(key);
|
8156
|
+
}
|
8157
|
+
return result;
|
8158
|
+
};
|
8159
|
+
|
8160
|
+
// IE8- don't enum bug keys
|
8161
|
+
var enumBugKeys = [
|
8162
|
+
'constructor',
|
8163
|
+
'hasOwnProperty',
|
8164
|
+
'isPrototypeOf',
|
8165
|
+
'propertyIsEnumerable',
|
8166
|
+
'toLocaleString',
|
8167
|
+
'toString',
|
8168
|
+
'valueOf'
|
8169
|
+
];
|
8170
|
+
|
8171
|
+
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
8172
|
+
|
8173
|
+
// `Object.getOwnPropertyNames` method
|
8174
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
8175
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
8176
|
+
var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
8177
|
+
return objectKeysInternal(O, hiddenKeys);
|
8178
|
+
};
|
8179
|
+
|
8180
|
+
var objectGetOwnPropertyNames = {
|
8181
|
+
f: f$1
|
8182
|
+
};
|
8183
|
+
|
8184
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
8185
|
+
var f = Object.getOwnPropertySymbols;
|
8186
|
+
|
8187
|
+
var objectGetOwnPropertySymbols = {
|
8188
|
+
f: f
|
8189
|
+
};
|
8190
|
+
|
8191
|
+
// all object keys, includes non-enumerable and symbols
|
8192
|
+
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
8193
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
8194
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
8195
|
+
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
8196
|
+
};
|
8197
|
+
|
8198
|
+
var copyConstructorProperties = function (target, source) {
|
8199
|
+
var keys = ownKeys(source);
|
8200
|
+
var defineProperty = objectDefineProperty.f;
|
8201
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
8202
|
+
for (var i = 0; i < keys.length; i++) {
|
8203
|
+
var key = keys[i];
|
8204
|
+
if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
8205
|
+
}
|
8206
|
+
};
|
8207
|
+
|
8208
|
+
var replacement = /#|\.prototype\./;
|
8209
|
+
|
8210
|
+
var isForced = function (feature, detection) {
|
8211
|
+
var value = data[normalize(feature)];
|
8212
|
+
return value == POLYFILL ? true
|
8213
|
+
: value == NATIVE ? false
|
8214
|
+
: typeof detection == 'function' ? fails(detection)
|
8215
|
+
: !!detection;
|
8216
|
+
};
|
8217
|
+
|
8218
|
+
var normalize = isForced.normalize = function (string) {
|
8219
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
8220
|
+
};
|
8221
|
+
|
8222
|
+
var data = isForced.data = {};
|
8223
|
+
var NATIVE = isForced.NATIVE = 'N';
|
8224
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
8225
|
+
|
8226
|
+
var isForced_1 = isForced;
|
8227
|
+
|
8228
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
8229
|
+
|
8230
|
+
|
8231
|
+
|
8232
|
+
|
8233
|
+
|
8234
|
+
|
8235
|
+
/*
|
8236
|
+
options.target - name of the target object
|
8237
|
+
options.global - target is the global object
|
8238
|
+
options.stat - export as static methods of target
|
8239
|
+
options.proto - export as prototype methods of target
|
8240
|
+
options.real - real prototype method for the `pure` version
|
8241
|
+
options.forced - export even if the native feature is available
|
8242
|
+
options.bind - bind methods to the target, required for the `pure` version
|
8243
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
8244
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
8245
|
+
options.sham - add a flag to not completely full polyfills
|
8246
|
+
options.enumerable - export as enumerable property
|
8247
|
+
options.noTargetGet - prevent calling a getter on target
|
8248
|
+
*/
|
8249
|
+
var _export = function (options, source) {
|
8250
|
+
var TARGET = options.target;
|
8251
|
+
var GLOBAL = options.global;
|
8252
|
+
var STATIC = options.stat;
|
8253
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
8254
|
+
if (GLOBAL) {
|
8255
|
+
target = global;
|
8256
|
+
} else if (STATIC) {
|
8257
|
+
target = global[TARGET] || setGlobal(TARGET, {});
|
8258
|
+
} else {
|
8259
|
+
target = (global[TARGET] || {}).prototype;
|
8260
|
+
}
|
8261
|
+
if (target) for (key in source) {
|
8262
|
+
sourceProperty = source[key];
|
8263
|
+
if (options.noTargetGet) {
|
8264
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
8265
|
+
targetProperty = descriptor && descriptor.value;
|
8266
|
+
} else targetProperty = target[key];
|
8267
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
8268
|
+
// contained in target
|
8269
|
+
if (!FORCED && targetProperty !== undefined) {
|
8270
|
+
if (typeof sourceProperty === typeof targetProperty) continue;
|
8271
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
8272
|
+
}
|
8273
|
+
// add a flag to not completely full polyfills
|
8274
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
8275
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
8276
|
+
}
|
8277
|
+
// extend global
|
8278
|
+
redefine(target, key, sourceProperty, options);
|
8279
|
+
}
|
8280
|
+
};
|
8281
|
+
|
8282
|
+
var aFunction = function (it) {
|
8283
|
+
if (typeof it != 'function') {
|
8284
|
+
throw TypeError(String(it) + ' is not a function');
|
8285
|
+
} return it;
|
8286
|
+
};
|
8287
|
+
|
8288
|
+
var toString = function (argument) {
|
8289
|
+
if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');
|
8290
|
+
return String(argument);
|
8291
|
+
};
|
8292
|
+
|
8293
|
+
// TODO: use something more complex like timsort?
|
8294
|
+
var floor = Math.floor;
|
8295
|
+
|
8296
|
+
var mergeSort = function (array, comparefn) {
|
8297
|
+
var length = array.length;
|
8298
|
+
var middle = floor(length / 2);
|
8299
|
+
return length < 8 ? insertionSort(array, comparefn) : merge(
|
8300
|
+
mergeSort(array.slice(0, middle), comparefn),
|
8301
|
+
mergeSort(array.slice(middle), comparefn),
|
8302
|
+
comparefn
|
8303
|
+
);
|
8304
|
+
};
|
8305
|
+
|
8306
|
+
var insertionSort = function (array, comparefn) {
|
8307
|
+
var length = array.length;
|
8308
|
+
var i = 1;
|
8309
|
+
var element, j;
|
8310
|
+
|
8311
|
+
while (i < length) {
|
8312
|
+
j = i;
|
8313
|
+
element = array[i];
|
8314
|
+
while (j && comparefn(array[j - 1], element) > 0) {
|
8315
|
+
array[j] = array[--j];
|
8316
|
+
}
|
8317
|
+
if (j !== i++) array[j] = element;
|
8318
|
+
} return array;
|
8319
|
+
};
|
8320
|
+
|
8321
|
+
var merge = function (left, right, comparefn) {
|
8322
|
+
var llength = left.length;
|
8323
|
+
var rlength = right.length;
|
8324
|
+
var lindex = 0;
|
8325
|
+
var rindex = 0;
|
8326
|
+
var result = [];
|
8327
|
+
|
8328
|
+
while (lindex < llength || rindex < rlength) {
|
8329
|
+
if (lindex < llength && rindex < rlength) {
|
8330
|
+
result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]);
|
8331
|
+
} else {
|
8332
|
+
result.push(lindex < llength ? left[lindex++] : right[rindex++]);
|
8333
|
+
}
|
8334
|
+
} return result;
|
8335
|
+
};
|
8336
|
+
|
8337
|
+
var arraySort = mergeSort;
|
8338
|
+
|
8339
|
+
var arrayMethodIsStrict = function (METHOD_NAME, argument) {
|
8340
|
+
var method = [][METHOD_NAME];
|
8341
|
+
return !!method && fails(function () {
|
8342
|
+
// eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
|
8343
|
+
method.call(null, argument || function () { throw 1; }, 1);
|
8344
|
+
});
|
8345
|
+
};
|
8346
|
+
|
8347
|
+
var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
|
8348
|
+
|
8349
|
+
var engineFfVersion = !!firefox && +firefox[1];
|
8350
|
+
|
8351
|
+
var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
|
8352
|
+
|
8353
|
+
var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
|
8354
|
+
|
8355
|
+
var engineWebkitVersion = !!webkit && +webkit[1];
|
8356
|
+
|
8357
|
+
var test = [];
|
8358
|
+
var nativeSort = test.sort;
|
8359
|
+
|
8360
|
+
// IE8-
|
8361
|
+
var FAILS_ON_UNDEFINED = fails(function () {
|
8362
|
+
test.sort(undefined);
|
8363
|
+
});
|
8364
|
+
// V8 bug
|
8365
|
+
var FAILS_ON_NULL = fails(function () {
|
8366
|
+
test.sort(null);
|
8367
|
+
});
|
8368
|
+
// Old WebKit
|
8369
|
+
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
8370
|
+
|
8371
|
+
var STABLE_SORT = !fails(function () {
|
8372
|
+
// feature detection can be too slow, so check engines versions
|
8373
|
+
if (engineV8Version) return engineV8Version < 70;
|
8374
|
+
if (engineFfVersion && engineFfVersion > 3) return;
|
8375
|
+
if (engineIsIeOrEdge) return true;
|
8376
|
+
if (engineWebkitVersion) return engineWebkitVersion < 603;
|
8377
|
+
|
8378
|
+
var result = '';
|
8379
|
+
var code, chr, value, index;
|
8380
|
+
|
8381
|
+
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
|
8382
|
+
for (code = 65; code < 76; code++) {
|
8383
|
+
chr = String.fromCharCode(code);
|
8384
|
+
|
8385
|
+
switch (code) {
|
8386
|
+
case 66: case 69: case 70: case 72: value = 3; break;
|
8387
|
+
case 68: case 71: value = 4; break;
|
8388
|
+
default: value = 2;
|
8389
|
+
}
|
8390
|
+
|
8391
|
+
for (index = 0; index < 47; index++) {
|
8392
|
+
test.push({ k: chr + index, v: value });
|
8393
|
+
}
|
8394
|
+
}
|
8395
|
+
|
8396
|
+
test.sort(function (a, b) { return b.v - a.v; });
|
8397
|
+
|
8398
|
+
for (index = 0; index < test.length; index++) {
|
8399
|
+
chr = test[index].k.charAt(0);
|
8400
|
+
if (result.charAt(result.length - 1) !== chr) result += chr;
|
8401
|
+
}
|
8402
|
+
|
8403
|
+
return result !== 'DGBEFHACIJK';
|
8404
|
+
});
|
8405
|
+
|
8406
|
+
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
8407
|
+
|
8408
|
+
var getSortCompare = function (comparefn) {
|
8409
|
+
return function (x, y) {
|
8410
|
+
if (y === undefined) return -1;
|
8411
|
+
if (x === undefined) return 1;
|
8412
|
+
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
8413
|
+
return toString(x) > toString(y) ? 1 : -1;
|
8414
|
+
};
|
8415
|
+
};
|
8416
|
+
|
8417
|
+
// `Array.prototype.sort` method
|
8418
|
+
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
8419
|
+
_export({ target: 'Array', proto: true, forced: FORCED }, {
|
8420
|
+
sort: function sort(comparefn) {
|
8421
|
+
if (comparefn !== undefined) aFunction(comparefn);
|
8422
|
+
|
8423
|
+
var array = toObject(this);
|
8424
|
+
|
8425
|
+
if (STABLE_SORT) return comparefn === undefined ? nativeSort.call(array) : nativeSort.call(array, comparefn);
|
8426
|
+
|
8427
|
+
var items = [];
|
8428
|
+
var arrayLength = toLength(array.length);
|
8429
|
+
var itemsLength, index;
|
8430
|
+
|
8431
|
+
for (index = 0; index < arrayLength; index++) {
|
8432
|
+
if (index in array) items.push(array[index]);
|
8433
|
+
}
|
8434
|
+
|
8435
|
+
items = arraySort(items, getSortCompare(comparefn));
|
8436
|
+
itemsLength = items.length;
|
8437
|
+
index = 0;
|
8438
|
+
|
8439
|
+
while (index < itemsLength) array[index] = items[index++];
|
8440
|
+
while (index < arrayLength) delete array[index++];
|
8441
|
+
|
8442
|
+
return array;
|
8443
|
+
}
|
8444
|
+
});
|
8445
|
+
|
7783
8446
|
/* global atob, btoa, Buffer */
|
7784
8447
|
|
7785
8448
|
|
@@ -9824,7 +10487,7 @@ async function readFile(filepath, options = {}) {
|
|
9824
10487
|
const content = await fsReadFileAsync(filepath, 'utf8');
|
9825
10488
|
return content;
|
9826
10489
|
} catch (error) {
|
9827
|
-
if (throwNotFound === false && error.code === 'ENOENT') {
|
10490
|
+
if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) {
|
9828
10491
|
return null;
|
9829
10492
|
}
|
9830
10493
|
|
@@ -9840,7 +10503,7 @@ function readFileSync(filepath, options = {}) {
|
|
9840
10503
|
|
9841
10504
|
return content;
|
9842
10505
|
} catch (error) {
|
9843
|
-
if (throwNotFound === false && error.code === 'ENOENT') {
|
10506
|
+
if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) {
|
9844
10507
|
return null;
|
9845
10508
|
}
|
9846
10509
|
|