prettier 1.5.4 → 2.0.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +338 -276
- data/CONTRIBUTING.md +8 -11
- data/LICENSE +1 -1
- data/README.md +31 -14
- data/dist/haml/embed.js +53 -0
- data/dist/haml/parser.js +31 -0
- data/{src → dist}/haml/parser.rb +8 -1
- 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 +128 -0
- data/dist/parser/server.rb +140 -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 +7 -1
- 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 +68 -0
- data/dist/ruby/nodes/calls.js +220 -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 +1276 -290
- data/dist/ruby/printer.js +125 -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 -16
- 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 +13343 -10961
- data/node_modules/prettier/doc.js +4829 -0
- data/node_modules/prettier/index.js +24010 -22251
- data/node_modules/prettier/package.json +23 -0
- data/node_modules/prettier/parser-angular.js +66 -0
- data/node_modules/prettier/parser-babel.js +22 -0
- data/node_modules/prettier/parser-espree.js +22 -0
- data/node_modules/prettier/parser-flow.js +22 -0
- data/node_modules/prettier/parser-glimmer.js +1 -0
- data/node_modules/prettier/parser-graphql.js +1 -0
- data/node_modules/prettier/parser-html.js +132 -0
- data/node_modules/prettier/parser-markdown.js +34 -0
- data/node_modules/prettier/parser-meriyah.js +22 -0
- data/node_modules/prettier/parser-postcss.js +22 -0
- data/node_modules/prettier/parser-typescript.js +22 -0
- data/node_modules/prettier/parser-yaml.js +15 -0
- data/node_modules/prettier/third-party.js +1734 -862
- data/package.json +27 -19
- data/rubocop.yml +9 -0
- metadata +88 -79
- data/src/haml/embed.js +0 -87
- data/src/haml/nodes/comment.js +0 -27
- data/src/haml/nodes/doctype.js +0 -34
- data/src/haml/nodes/filter.js +0 -16
- data/src/haml/nodes/hamlComment.js +0 -21
- data/src/haml/nodes/plain.js +0 -6
- data/src/haml/nodes/root.js +0 -8
- data/src/haml/nodes/script.js +0 -33
- data/src/haml/nodes/silentScript.js +0 -59
- data/src/haml/nodes/tag.js +0 -193
- data/src/haml/parser.js +0 -22
- data/src/haml/printer.js +0 -28
- data/src/parser/getLang.js +0 -32
- data/src/parser/getNetcat.js +0 -57
- data/src/parser/parseSync.js +0 -43
- data/src/parser/requestParse.js +0 -74
- 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 -39
- data/src/rbs/printer.js +0 -605
- data/src/ruby/embed.js +0 -142
- data/src/ruby/nodes/alias.js +0 -73
- data/src/ruby/nodes/args.js +0 -178
- 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 -199
- 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 -280
- data/src/ruby/nodes/constants.js +0 -43
- data/src/ruby/nodes/flow.js +0 -74
- data/src/ruby/nodes/hashes.js +0 -164
- 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 -113
- 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 -177
- 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 -39
- data/src/ruby/printer.js +0 -138
- 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 -10
- data/src/utils.js +0 -13
@@ -14,18 +14,9 @@ var Module__default = /*#__PURE__*/_interopDefaultLegacy(Module);
|
|
14
14
|
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
15
15
|
var util__default = /*#__PURE__*/_interopDefaultLegacy(util);
|
16
16
|
|
17
|
-
function createCommonjsModule(fn
|
18
|
-
|
19
|
-
|
20
|
-
exports: {},
|
21
|
-
require: function (path, base) {
|
22
|
-
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
23
|
-
}
|
24
|
-
}, fn(module, module.exports), module.exports;
|
25
|
-
}
|
26
|
-
|
27
|
-
function commonjsRequire () {
|
28
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
17
|
+
function createCommonjsModule(fn) {
|
18
|
+
var module = { exports: {} };
|
19
|
+
return fn(module, module.exports), module.exports;
|
29
20
|
}
|
30
21
|
|
31
22
|
const resolveFrom = (fromDir, moduleId, silent) => {
|
@@ -79,8 +70,9 @@ var importFresh = moduleId => {
|
|
79
70
|
}
|
80
71
|
|
81
72
|
const parentPath = __filename;
|
82
|
-
const
|
83
|
-
const
|
73
|
+
const cwd = parentPath ? path__default['default'].dirname(parentPath) : __dirname;
|
74
|
+
const filePath = resolveFrom_1(cwd, moduleId);
|
75
|
+
const oldModule = require.cache[filePath]; // Delete itself from module parent
|
84
76
|
|
85
77
|
if (oldModule && oldModule.parent) {
|
86
78
|
let i = oldModule.parent.children.length;
|
@@ -92,11 +84,11 @@ var importFresh = moduleId => {
|
|
92
84
|
}
|
93
85
|
}
|
94
86
|
|
95
|
-
delete
|
87
|
+
delete require.cache[filePath]; // Delete module from cache
|
96
88
|
|
97
|
-
const parent =
|
89
|
+
const parent = require.cache[parentPath]; // If `filePath` and `parentPath` are the same, cache will already be deleted so we won't get a memory leak in next step
|
98
90
|
|
99
|
-
return parent === undefined ?
|
91
|
+
return parent === undefined ? require(filePath) : parent.require(filePath); // In case cache doesn't have parent, fall back to normal require
|
100
92
|
};
|
101
93
|
|
102
94
|
var isArrayish = function isArrayish(obj) {
|
@@ -237,36 +229,120 @@ errorEx.line = function (str, def) {
|
|
237
229
|
|
238
230
|
var errorEx_1 = errorEx;
|
239
231
|
|
240
|
-
|
232
|
+
const hexify = char => {
|
233
|
+
const h = char.charCodeAt(0).toString(16).toUpperCase();
|
234
|
+
return '0x' + (h.length % 2 ? '0' : '') + h;
|
235
|
+
};
|
236
|
+
|
237
|
+
const parseError = (e, txt, context) => {
|
238
|
+
if (!txt) {
|
239
|
+
return {
|
240
|
+
message: e.message + ' while parsing empty string',
|
241
|
+
position: 0
|
242
|
+
};
|
243
|
+
}
|
244
|
+
|
245
|
+
const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);
|
246
|
+
const errIdx = badToken ? +badToken[2] : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 : null;
|
247
|
+
const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${JSON.stringify(badToken[1])} (${hexify(badToken[1])})`) : e.message;
|
248
|
+
|
249
|
+
if (errIdx !== null && errIdx !== undefined) {
|
250
|
+
const start = errIdx <= context ? 0 : errIdx - context;
|
251
|
+
const end = errIdx + context >= txt.length ? txt.length : errIdx + context;
|
252
|
+
const slice = (start === 0 ? '' : '...') + txt.slice(start, end) + (end === txt.length ? '' : '...');
|
253
|
+
const near = txt === slice ? '' : 'near ';
|
254
|
+
return {
|
255
|
+
message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,
|
256
|
+
position: errIdx
|
257
|
+
};
|
258
|
+
} else {
|
259
|
+
return {
|
260
|
+
message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,
|
261
|
+
position: 0
|
262
|
+
};
|
263
|
+
}
|
264
|
+
};
|
265
|
+
|
266
|
+
class JSONParseError extends SyntaxError {
|
267
|
+
constructor(er, txt, context, caller) {
|
268
|
+
context = context || 20;
|
269
|
+
const metadata = parseError(er, txt, context);
|
270
|
+
super(metadata.message);
|
271
|
+
Object.assign(this, metadata);
|
272
|
+
this.code = 'EJSONPARSE';
|
273
|
+
this.systemError = er;
|
274
|
+
Error.captureStackTrace(this, caller || this.constructor);
|
275
|
+
}
|
276
|
+
|
277
|
+
get name() {
|
278
|
+
return this.constructor.name;
|
279
|
+
}
|
280
|
+
|
281
|
+
set name(n) {}
|
282
|
+
|
283
|
+
get [Symbol.toStringTag]() {
|
284
|
+
return this.constructor.name;
|
285
|
+
}
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
const kIndent = Symbol.for('indent');
|
290
|
+
const kNewline = Symbol.for('newline'); // only respect indentation if we got a line break, otherwise squash it
|
291
|
+
// things other than objects and arrays aren't indented, so ignore those
|
292
|
+
// Important: in both of these regexps, the $1 capture group is the newline
|
293
|
+
// or undefined, and the $2 capture group is the indent, or undefined.
|
294
|
+
|
295
|
+
const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/;
|
296
|
+
const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/;
|
241
297
|
|
242
|
-
|
298
|
+
const parseJson$1 = (txt, reviver, context) => {
|
299
|
+
const parseText = stripBOM(txt);
|
243
300
|
context = context || 20;
|
244
301
|
|
245
302
|
try {
|
246
|
-
|
303
|
+
// get the indentation so that we can save it back nicely
|
304
|
+
// if the file starts with {" then we have an indent of '', ie, none
|
305
|
+
// otherwise, pick the indentation of the next line after the first \n
|
306
|
+
// If the pattern doesn't match, then it means no indentation.
|
307
|
+
// JSON.stringify ignores symbols, so this is reasonably safe.
|
308
|
+
// if the string is '{}' or '[]', then use the default 2-space indent.
|
309
|
+
const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) || parseText.match(formatRE) || [, '', ''];
|
310
|
+
const result = JSON.parse(parseText, reviver);
|
311
|
+
|
312
|
+
if (result && typeof result === 'object') {
|
313
|
+
result[kNewline] = newline;
|
314
|
+
result[kIndent] = indent;
|
315
|
+
}
|
316
|
+
|
317
|
+
return result;
|
247
318
|
} catch (e) {
|
248
|
-
if (typeof txt !== 'string') {
|
319
|
+
if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {
|
249
320
|
const isEmptyArray = Array.isArray(txt) && txt.length === 0;
|
250
|
-
|
251
|
-
|
321
|
+
throw Object.assign(new TypeError(`Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`), {
|
322
|
+
code: 'EJSONPARSE',
|
323
|
+
systemError: e
|
324
|
+
});
|
252
325
|
}
|
253
326
|
|
254
|
-
|
255
|
-
|
327
|
+
throw new JSONParseError(e, parseText, context, parseJson$1);
|
328
|
+
}
|
329
|
+
}; // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
330
|
+
// because the buffer-to-string conversion in `fs.readFileSync()`
|
331
|
+
// translates it to FEFF, the UTF-16 BOM.
|
256
332
|
|
257
|
-
if (errIdx != null) {
|
258
|
-
const start = errIdx <= context ? 0 : errIdx - context;
|
259
|
-
const end = errIdx + context >= txt.length ? txt.length : errIdx + context;
|
260
|
-
e.message += ` while parsing near '${start === 0 ? '' : '...'}${txt.slice(start, end)}${end === txt.length ? '' : '...'}'`;
|
261
|
-
} else {
|
262
|
-
e.message += ` while parsing '${txt.slice(0, context * 2)}'`;
|
263
|
-
}
|
264
333
|
|
265
|
-
|
266
|
-
}
|
267
|
-
}
|
334
|
+
const stripBOM = txt => String(txt).replace(/^\uFEFF/, '');
|
268
335
|
|
269
|
-
var
|
336
|
+
var jsonParseEvenBetterErrors = parseJson$1;
|
337
|
+
parseJson$1.JSONParseError = JSONParseError;
|
338
|
+
|
339
|
+
parseJson$1.noExceptions = (txt, reviver) => {
|
340
|
+
try {
|
341
|
+
return JSON.parse(stripBOM(txt), reviver);
|
342
|
+
} catch (e) {}
|
343
|
+
};
|
344
|
+
|
345
|
+
var dist$2 = createCommonjsModule(function (module, exports) {
|
270
346
|
|
271
347
|
var LF = '\n';
|
272
348
|
var CR = '\r';
|
@@ -349,147 +425,162 @@ var dist = createCommonjsModule(function (module, exports) {
|
|
349
425
|
exports["default"] = LinesAndColumns;
|
350
426
|
});
|
351
427
|
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
var token = {
|
364
|
-
type: "invalid",
|
365
|
-
value: match[0],
|
366
|
-
closed: undefined
|
367
|
-
};
|
368
|
-
if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace";
|
369
|
-
return token;
|
428
|
+
// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
|
429
|
+
// License: MIT. (See LICENSE.)
|
430
|
+
// This regex comes from regex.coffee, and is inserted here by generate-index.js
|
431
|
+
// (run `npm run build`).
|
432
|
+
var _default$2 = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
|
433
|
+
|
434
|
+
var matchToToken = function (match) {
|
435
|
+
var token = {
|
436
|
+
type: "invalid",
|
437
|
+
value: match[0],
|
438
|
+
closed: undefined
|
370
439
|
};
|
440
|
+
if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace";
|
441
|
+
return token;
|
442
|
+
};
|
443
|
+
|
444
|
+
var jsTokens = /*#__PURE__*/Object.defineProperty({
|
445
|
+
default: _default$2,
|
446
|
+
matchToToken: matchToToken
|
447
|
+
}, '__esModule', {
|
448
|
+
value: true
|
371
449
|
});
|
372
450
|
|
373
|
-
var
|
451
|
+
var isIdentifierStart_1 = isIdentifierStart;
|
452
|
+
var isIdentifierChar_1 = isIdentifierChar;
|
453
|
+
var isIdentifierName_1 = isIdentifierName;
|
454
|
+
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
455
|
+
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
|
456
|
+
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
457
|
+
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
458
|
+
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
459
|
+
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
|
460
|
+
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
374
461
|
|
375
|
-
|
376
|
-
|
377
|
-
});
|
378
|
-
exports.isIdentifierStart = isIdentifierStart;
|
379
|
-
exports.isIdentifierChar = isIdentifierChar;
|
380
|
-
exports.isIdentifierName = isIdentifierName;
|
381
|
-
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
382
|
-
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
|
383
|
-
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
384
|
-
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
385
|
-
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
386
|
-
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
|
387
|
-
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
388
|
-
|
389
|
-
function isInAstralSet(code, set) {
|
390
|
-
let pos = 0x10000;
|
391
|
-
|
392
|
-
for (let i = 0, length = set.length; i < length; i += 2) {
|
393
|
-
pos += set[i];
|
394
|
-
if (pos > code) return false;
|
395
|
-
pos += set[i + 1];
|
396
|
-
if (pos >= code) return true;
|
397
|
-
}
|
462
|
+
function isInAstralSet(code, set) {
|
463
|
+
let pos = 0x10000;
|
398
464
|
|
399
|
-
|
465
|
+
for (let i = 0, length = set.length; i < length; i += 2) {
|
466
|
+
pos += set[i];
|
467
|
+
if (pos > code) return false;
|
468
|
+
pos += set[i + 1];
|
469
|
+
if (pos >= code) return true;
|
400
470
|
}
|
401
471
|
|
402
|
-
|
403
|
-
|
404
|
-
if (code <= 90) return true;
|
405
|
-
if (code < 97) return code === 95;
|
406
|
-
if (code <= 122) return true;
|
472
|
+
return false;
|
473
|
+
}
|
407
474
|
|
408
|
-
|
409
|
-
|
410
|
-
|
475
|
+
function isIdentifierStart(code) {
|
476
|
+
if (code < 65) return code === 36;
|
477
|
+
if (code <= 90) return true;
|
478
|
+
if (code < 97) return code === 95;
|
479
|
+
if (code <= 122) return true;
|
411
480
|
|
412
|
-
|
481
|
+
if (code <= 0xffff) {
|
482
|
+
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
413
483
|
}
|
414
484
|
|
415
|
-
|
416
|
-
|
417
|
-
if (code < 58) return true;
|
418
|
-
if (code < 65) return false;
|
419
|
-
if (code <= 90) return true;
|
420
|
-
if (code < 97) return code === 95;
|
421
|
-
if (code <= 122) return true;
|
485
|
+
return isInAstralSet(code, astralIdentifierStartCodes);
|
486
|
+
}
|
422
487
|
|
423
|
-
|
424
|
-
|
425
|
-
|
488
|
+
function isIdentifierChar(code) {
|
489
|
+
if (code < 48) return code === 36;
|
490
|
+
if (code < 58) return true;
|
491
|
+
if (code < 65) return false;
|
492
|
+
if (code <= 90) return true;
|
493
|
+
if (code < 97) return code === 95;
|
494
|
+
if (code <= 122) return true;
|
426
495
|
|
427
|
-
|
496
|
+
if (code <= 0xffff) {
|
497
|
+
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
|
428
498
|
}
|
429
499
|
|
430
|
-
|
431
|
-
|
500
|
+
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
501
|
+
}
|
432
502
|
|
433
|
-
|
434
|
-
|
435
|
-
const cp = char.codePointAt(0);
|
503
|
+
function isIdentifierName(name) {
|
504
|
+
let isFirst = true;
|
436
505
|
|
437
|
-
|
438
|
-
|
439
|
-
return false;
|
440
|
-
}
|
506
|
+
for (let i = 0; i < name.length; i++) {
|
507
|
+
let cp = name.charCodeAt(i);
|
441
508
|
|
442
|
-
|
443
|
-
|
444
|
-
|
509
|
+
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
|
510
|
+
const trail = name.charCodeAt(++i);
|
511
|
+
|
512
|
+
if ((trail & 0xfc00) === 0xdc00) {
|
513
|
+
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
|
445
514
|
}
|
446
515
|
}
|
447
516
|
|
448
|
-
|
517
|
+
if (isFirst) {
|
518
|
+
isFirst = false;
|
519
|
+
|
520
|
+
if (!isIdentifierStart(cp)) {
|
521
|
+
return false;
|
522
|
+
}
|
523
|
+
} else if (!isIdentifierChar(cp)) {
|
524
|
+
return false;
|
525
|
+
}
|
449
526
|
}
|
527
|
+
|
528
|
+
return !isFirst;
|
529
|
+
}
|
530
|
+
|
531
|
+
var identifier = /*#__PURE__*/Object.defineProperty({
|
532
|
+
isIdentifierStart: isIdentifierStart_1,
|
533
|
+
isIdentifierChar: isIdentifierChar_1,
|
534
|
+
isIdentifierName: isIdentifierName_1
|
535
|
+
}, '__esModule', {
|
536
|
+
value: true
|
450
537
|
});
|
451
538
|
|
452
|
-
var
|
539
|
+
var isReservedWord_1 = isReservedWord;
|
540
|
+
var isStrictReservedWord_1 = isStrictReservedWord;
|
541
|
+
var isStrictBindOnlyReservedWord_1 = isStrictBindOnlyReservedWord;
|
542
|
+
var isStrictBindReservedWord_1 = isStrictBindReservedWord;
|
543
|
+
var isKeyword_1 = isKeyword;
|
544
|
+
const reservedWords = {
|
545
|
+
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
546
|
+
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
547
|
+
strictBind: ["eval", "arguments"]
|
548
|
+
};
|
549
|
+
const keywords = new Set(reservedWords.keyword);
|
550
|
+
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
551
|
+
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
453
552
|
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
exports.isReservedWord = isReservedWord;
|
458
|
-
exports.isStrictReservedWord = isStrictReservedWord;
|
459
|
-
exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
460
|
-
exports.isStrictBindReservedWord = isStrictBindReservedWord;
|
461
|
-
exports.isKeyword = isKeyword;
|
462
|
-
const reservedWords = {
|
463
|
-
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
464
|
-
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
465
|
-
strictBind: ["eval", "arguments"]
|
466
|
-
};
|
467
|
-
const keywords = new Set(reservedWords.keyword);
|
468
|
-
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
469
|
-
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
553
|
+
function isReservedWord(word, inModule) {
|
554
|
+
return inModule && word === "await" || word === "enum";
|
555
|
+
}
|
470
556
|
|
471
|
-
|
472
|
-
|
473
|
-
|
557
|
+
function isStrictReservedWord(word, inModule) {
|
558
|
+
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
559
|
+
}
|
474
560
|
|
475
|
-
|
476
|
-
|
477
|
-
|
561
|
+
function isStrictBindOnlyReservedWord(word) {
|
562
|
+
return reservedWordsStrictBindSet.has(word);
|
563
|
+
}
|
478
564
|
|
479
|
-
|
480
|
-
|
481
|
-
|
565
|
+
function isStrictBindReservedWord(word, inModule) {
|
566
|
+
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
567
|
+
}
|
482
568
|
|
483
|
-
|
484
|
-
|
485
|
-
|
569
|
+
function isKeyword(word) {
|
570
|
+
return keywords.has(word);
|
571
|
+
}
|
486
572
|
|
487
|
-
|
488
|
-
|
489
|
-
|
573
|
+
var keyword = /*#__PURE__*/Object.defineProperty({
|
574
|
+
isReservedWord: isReservedWord_1,
|
575
|
+
isStrictReservedWord: isStrictReservedWord_1,
|
576
|
+
isStrictBindOnlyReservedWord: isStrictBindOnlyReservedWord_1,
|
577
|
+
isStrictBindReservedWord: isStrictBindReservedWord_1,
|
578
|
+
isKeyword: isKeyword_1
|
579
|
+
}, '__esModule', {
|
580
|
+
value: true
|
490
581
|
});
|
491
582
|
|
492
|
-
var lib = createCommonjsModule(function (module, exports) {
|
583
|
+
var lib$2 = createCommonjsModule(function (module, exports) {
|
493
584
|
|
494
585
|
Object.defineProperty(exports, "__esModule", {
|
495
586
|
value: true
|
@@ -705,8 +796,8 @@ var colorName = {
|
|
705
796
|
"yellowgreen": [154, 205, 50]
|
706
797
|
};
|
707
798
|
|
799
|
+
/* MIT license */
|
708
800
|
var conversions = createCommonjsModule(function (module) {
|
709
|
-
/* MIT license */
|
710
801
|
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
711
802
|
// values that give correct `typeof` results).
|
712
803
|
// do not use box values types (i.e. Number(), String(), etc.)
|
@@ -2397,106 +2488,39 @@ var chalk = createCommonjsModule(function (module) {
|
|
2397
2488
|
module.exports.default = module.exports; // For TypeScript
|
2398
2489
|
});
|
2399
2490
|
|
2400
|
-
var
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
});
|
2405
|
-
exports.shouldHighlight = shouldHighlight;
|
2406
|
-
exports.getChalk = getChalk;
|
2407
|
-
exports.default = highlight;
|
2408
|
-
|
2409
|
-
var _jsTokens = _interopRequireWildcard(jsTokens);
|
2410
|
-
|
2411
|
-
var _chalk = _interopRequireDefault(chalk);
|
2412
|
-
|
2413
|
-
function _interopRequireDefault(obj) {
|
2414
|
-
return obj && obj.__esModule ? obj : {
|
2415
|
-
default: obj
|
2416
|
-
};
|
2417
|
-
}
|
2418
|
-
|
2419
|
-
function _getRequireWildcardCache() {
|
2420
|
-
if (typeof WeakMap !== "function") return null;
|
2421
|
-
var cache = new WeakMap();
|
2422
|
-
|
2423
|
-
_getRequireWildcardCache = function () {
|
2424
|
-
return cache;
|
2425
|
-
};
|
2426
|
-
|
2427
|
-
return cache;
|
2428
|
-
}
|
2429
|
-
|
2430
|
-
function _interopRequireWildcard(obj) {
|
2431
|
-
if (obj && obj.__esModule) {
|
2432
|
-
return obj;
|
2433
|
-
}
|
2434
|
-
|
2435
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
2436
|
-
return {
|
2437
|
-
default: obj
|
2438
|
-
};
|
2439
|
-
}
|
2440
|
-
|
2441
|
-
var cache = _getRequireWildcardCache();
|
2491
|
+
var shouldHighlight_1 = shouldHighlight;
|
2492
|
+
var getChalk_1 = getChalk;
|
2493
|
+
var _default$1 = highlight;
|
2494
|
+
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
2442
2495
|
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
2450
|
-
|
2451
|
-
|
2452
|
-
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
2456
|
-
} else {
|
2457
|
-
newObj[key] = obj[key];
|
2458
|
-
}
|
2459
|
-
}
|
2460
|
-
}
|
2461
|
-
|
2462
|
-
newObj.default = obj;
|
2463
|
-
|
2464
|
-
if (cache) {
|
2465
|
-
cache.set(obj, newObj);
|
2466
|
-
}
|
2467
|
-
|
2468
|
-
return newObj;
|
2469
|
-
}
|
2470
|
-
|
2471
|
-
function getDefs(chalk) {
|
2472
|
-
return {
|
2473
|
-
keyword: chalk.cyan,
|
2474
|
-
capitalized: chalk.yellow,
|
2475
|
-
jsx_tag: chalk.yellow,
|
2476
|
-
punctuator: chalk.yellow,
|
2477
|
-
number: chalk.magenta,
|
2478
|
-
string: chalk.green,
|
2479
|
-
regex: chalk.magenta,
|
2480
|
-
comment: chalk.grey,
|
2481
|
-
invalid: chalk.white.bgRed.bold
|
2482
|
-
};
|
2483
|
-
}
|
2496
|
+
function getDefs$1(chalk) {
|
2497
|
+
return {
|
2498
|
+
keyword: chalk.cyan,
|
2499
|
+
capitalized: chalk.yellow,
|
2500
|
+
jsxIdentifier: chalk.yellow,
|
2501
|
+
punctuator: chalk.yellow,
|
2502
|
+
number: chalk.magenta,
|
2503
|
+
string: chalk.green,
|
2504
|
+
regex: chalk.magenta,
|
2505
|
+
comment: chalk.grey,
|
2506
|
+
invalid: chalk.white.bgRed.bold
|
2507
|
+
};
|
2508
|
+
}
|
2484
2509
|
|
2485
|
-
|
2510
|
+
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
2511
|
+
const BRACKET = /^[()[\]{}]$/;
|
2512
|
+
let tokenize;
|
2513
|
+
{
|
2486
2514
|
const JSX_TAG = /^[a-z][\w-]*$/i;
|
2487
|
-
const BRACKET = /^[()[\]{}]$/;
|
2488
|
-
|
2489
|
-
function getTokenType(match) {
|
2490
|
-
const [offset, text] = match.slice(-2);
|
2491
|
-
const token = (0, _jsTokens.matchToToken)(match);
|
2492
2515
|
|
2516
|
+
const getTokenType = function (token, offset, text) {
|
2493
2517
|
if (token.type === "name") {
|
2494
|
-
if ((0, lib.isKeyword)(token.value) || (0, lib.
|
2518
|
+
if ((0, lib$2.isKeyword)(token.value) || (0, lib$2.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
|
2495
2519
|
return "keyword";
|
2496
2520
|
}
|
2497
2521
|
|
2498
2522
|
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
|
2499
|
-
return "
|
2523
|
+
return "jsxIdentifier";
|
2500
2524
|
}
|
2501
2525
|
|
2502
2526
|
if (token.value[0] !== token.value[0].toLowerCase()) {
|
@@ -2513,278 +2537,245 @@ var lib$1 = createCommonjsModule(function (module, exports) {
|
|
2513
2537
|
}
|
2514
2538
|
|
2515
2539
|
return token.type;
|
2516
|
-
}
|
2517
|
-
|
2518
|
-
function highlightTokens(defs, text) {
|
2519
|
-
return text.replace(_jsTokens.default, function (...args) {
|
2520
|
-
const type = getTokenType(args);
|
2521
|
-
const colorize = defs[type];
|
2522
|
-
|
2523
|
-
if (colorize) {
|
2524
|
-
return args[0].split(NEWLINE).map(str => colorize(str)).join("\n");
|
2525
|
-
} else {
|
2526
|
-
return args[0];
|
2527
|
-
}
|
2528
|
-
});
|
2529
|
-
}
|
2540
|
+
};
|
2530
2541
|
|
2531
|
-
function
|
2532
|
-
|
2533
|
-
}
|
2542
|
+
tokenize = function* (text) {
|
2543
|
+
let match;
|
2534
2544
|
|
2535
|
-
|
2536
|
-
|
2545
|
+
while (match = jsTokens.default.exec(text)) {
|
2546
|
+
const token = jsTokens.matchToToken(match);
|
2537
2547
|
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
2542
|
-
});
|
2548
|
+
yield {
|
2549
|
+
type: getTokenType(token, match.index, text),
|
2550
|
+
value: token.value
|
2551
|
+
};
|
2543
2552
|
}
|
2553
|
+
};
|
2554
|
+
}
|
2544
2555
|
|
2545
|
-
|
2546
|
-
|
2556
|
+
function highlightTokens(defs, text) {
|
2557
|
+
let highlighted = "";
|
2558
|
+
|
2559
|
+
for (const {
|
2560
|
+
type,
|
2561
|
+
value
|
2562
|
+
} of tokenize(text)) {
|
2563
|
+
const colorize = defs[type];
|
2547
2564
|
|
2548
|
-
|
2549
|
-
|
2550
|
-
const chalk = getChalk(options);
|
2551
|
-
const defs = getDefs(chalk);
|
2552
|
-
return highlightTokens(defs, code);
|
2565
|
+
if (colorize) {
|
2566
|
+
highlighted += value.split(NEWLINE$1).map(str => colorize(str)).join("\n");
|
2553
2567
|
} else {
|
2554
|
-
|
2568
|
+
highlighted += value;
|
2555
2569
|
}
|
2556
2570
|
}
|
2557
|
-
});
|
2558
2571
|
|
2559
|
-
|
2560
|
-
|
2561
|
-
Object.defineProperty(exports, "__esModule", {
|
2562
|
-
value: true
|
2563
|
-
});
|
2564
|
-
exports.codeFrameColumns = codeFrameColumns;
|
2565
|
-
exports.default = _default;
|
2566
|
-
|
2567
|
-
var _highlight = _interopRequireWildcard(lib$1);
|
2572
|
+
return highlighted;
|
2573
|
+
}
|
2568
2574
|
|
2569
|
-
|
2570
|
-
|
2571
|
-
|
2575
|
+
function shouldHighlight(options) {
|
2576
|
+
return !!chalk.supportsColor || options.forceColor;
|
2577
|
+
}
|
2572
2578
|
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2579
|
+
function getChalk(options) {
|
2580
|
+
return options.forceColor ? new chalk.constructor({
|
2581
|
+
enabled: true,
|
2582
|
+
level: 1
|
2583
|
+
}) : chalk;
|
2584
|
+
}
|
2576
2585
|
|
2577
|
-
|
2586
|
+
function highlight(code, options = {}) {
|
2587
|
+
if (shouldHighlight(options)) {
|
2588
|
+
const chalk = getChalk(options);
|
2589
|
+
const defs = getDefs$1(chalk);
|
2590
|
+
return highlightTokens(defs, code);
|
2591
|
+
} else {
|
2592
|
+
return code;
|
2578
2593
|
}
|
2594
|
+
}
|
2579
2595
|
|
2580
|
-
|
2581
|
-
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
default: obj
|
2588
|
-
};
|
2589
|
-
}
|
2590
|
-
|
2591
|
-
var cache = _getRequireWildcardCache();
|
2596
|
+
var lib$1 = /*#__PURE__*/Object.defineProperty({
|
2597
|
+
shouldHighlight: shouldHighlight_1,
|
2598
|
+
getChalk: getChalk_1,
|
2599
|
+
default: _default$1
|
2600
|
+
}, '__esModule', {
|
2601
|
+
value: true
|
2602
|
+
});
|
2592
2603
|
|
2593
|
-
|
2594
|
-
|
2595
|
-
|
2604
|
+
var codeFrameColumns_1 = codeFrameColumns$1;
|
2605
|
+
var default_1 = _default;
|
2606
|
+
let deprecationWarningShown = false;
|
2596
2607
|
|
2597
|
-
|
2598
|
-
|
2608
|
+
function getDefs(chalk) {
|
2609
|
+
return {
|
2610
|
+
gutter: chalk.grey,
|
2611
|
+
marker: chalk.red.bold,
|
2612
|
+
message: chalk.red.bold
|
2613
|
+
};
|
2614
|
+
}
|
2599
2615
|
|
2600
|
-
|
2601
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
2602
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
2616
|
+
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
2603
2617
|
|
2604
|
-
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2618
|
+
function getMarkerLines(loc, source, opts) {
|
2619
|
+
const startLoc = Object.assign({
|
2620
|
+
column: 0,
|
2621
|
+
line: -1
|
2622
|
+
}, loc.start);
|
2623
|
+
const endLoc = Object.assign({}, startLoc, loc.end);
|
2624
|
+
const {
|
2625
|
+
linesAbove = 2,
|
2626
|
+
linesBelow = 3
|
2627
|
+
} = opts || {};
|
2628
|
+
const startLine = startLoc.line;
|
2629
|
+
const startColumn = startLoc.column;
|
2630
|
+
const endLine = endLoc.line;
|
2631
|
+
const endColumn = endLoc.column;
|
2632
|
+
let start = Math.max(startLine - (linesAbove + 1), 0);
|
2633
|
+
let end = Math.min(source.length, endLine + linesBelow);
|
2634
|
+
|
2635
|
+
if (startLine === -1) {
|
2636
|
+
start = 0;
|
2637
|
+
}
|
2638
|
+
|
2639
|
+
if (endLine === -1) {
|
2640
|
+
end = source.length;
|
2641
|
+
}
|
2642
|
+
|
2643
|
+
const lineDiff = endLine - startLine;
|
2644
|
+
const markerLines = {};
|
2645
|
+
|
2646
|
+
if (lineDiff) {
|
2647
|
+
for (let i = 0; i <= lineDiff; i++) {
|
2648
|
+
const lineNumber = i + startLine;
|
2649
|
+
|
2650
|
+
if (!startColumn) {
|
2651
|
+
markerLines[lineNumber] = true;
|
2652
|
+
} else if (i === 0) {
|
2653
|
+
const sourceLength = source[lineNumber - 1].length;
|
2654
|
+
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
2655
|
+
} else if (i === lineDiff) {
|
2656
|
+
markerLines[lineNumber] = [0, endColumn];
|
2657
|
+
} else {
|
2658
|
+
const sourceLength = source[lineNumber - i].length;
|
2659
|
+
markerLines[lineNumber] = [0, sourceLength];
|
2609
2660
|
}
|
2610
2661
|
}
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
|
2662
|
+
} else {
|
2663
|
+
if (startColumn === endColumn) {
|
2664
|
+
if (startColumn) {
|
2665
|
+
markerLines[startLine] = [startColumn, 0];
|
2666
|
+
} else {
|
2667
|
+
markerLines[startLine] = true;
|
2668
|
+
}
|
2669
|
+
} else {
|
2670
|
+
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
2616
2671
|
}
|
2617
|
-
|
2618
|
-
return newObj;
|
2619
2672
|
}
|
2620
2673
|
|
2621
|
-
|
2674
|
+
return {
|
2675
|
+
start,
|
2676
|
+
end,
|
2677
|
+
markerLines
|
2678
|
+
};
|
2679
|
+
}
|
2622
2680
|
|
2623
|
-
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
message: chalk.red.bold
|
2628
|
-
};
|
2629
|
-
}
|
2681
|
+
function codeFrameColumns$1(rawLines, loc, opts = {}) {
|
2682
|
+
const highlighted = (opts.highlightCode || opts.forceColor) && (0, lib$1.shouldHighlight)(opts);
|
2683
|
+
const chalk = (0, lib$1.getChalk)(opts);
|
2684
|
+
const defs = getDefs(chalk);
|
2630
2685
|
|
2631
|
-
const
|
2686
|
+
const maybeHighlight = (chalkFn, string) => {
|
2687
|
+
return highlighted ? chalkFn(string) : string;
|
2688
|
+
};
|
2632
2689
|
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
const
|
2644
|
-
const
|
2645
|
-
const
|
2646
|
-
const
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2659
|
-
const markerLines = {};
|
2660
|
-
|
2661
|
-
if (lineDiff) {
|
2662
|
-
for (let i = 0; i <= lineDiff; i++) {
|
2663
|
-
const lineNumber = i + startLine;
|
2664
|
-
|
2665
|
-
if (!startColumn) {
|
2666
|
-
markerLines[lineNumber] = true;
|
2667
|
-
} else if (i === 0) {
|
2668
|
-
const sourceLength = source[lineNumber - 1].length;
|
2669
|
-
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
2670
|
-
} else if (i === lineDiff) {
|
2671
|
-
markerLines[lineNumber] = [0, endColumn];
|
2672
|
-
} else {
|
2673
|
-
const sourceLength = source[lineNumber - i].length;
|
2674
|
-
markerLines[lineNumber] = [0, sourceLength];
|
2690
|
+
const lines = rawLines.split(NEWLINE);
|
2691
|
+
const {
|
2692
|
+
start,
|
2693
|
+
end,
|
2694
|
+
markerLines
|
2695
|
+
} = getMarkerLines(loc, lines, opts);
|
2696
|
+
const hasColumns = loc.start && typeof loc.start.column === "number";
|
2697
|
+
const numberMaxWidth = String(end).length;
|
2698
|
+
const highlightedLines = highlighted ? (0, lib$1.default)(rawLines, opts) : rawLines;
|
2699
|
+
let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
|
2700
|
+
const number = start + 1 + index;
|
2701
|
+
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
2702
|
+
const gutter = ` ${paddedNumber} |`;
|
2703
|
+
const hasMarker = markerLines[number];
|
2704
|
+
const lastMarkerLine = !markerLines[number + 1];
|
2705
|
+
|
2706
|
+
if (hasMarker) {
|
2707
|
+
let markerLine = "";
|
2708
|
+
|
2709
|
+
if (Array.isArray(hasMarker)) {
|
2710
|
+
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
2711
|
+
const numberOfMarkers = hasMarker[1] || 1;
|
2712
|
+
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
|
2713
|
+
|
2714
|
+
if (lastMarkerLine && opts.message) {
|
2715
|
+
markerLine += " " + maybeHighlight(defs.message, opts.message);
|
2675
2716
|
}
|
2676
2717
|
}
|
2718
|
+
|
2719
|
+
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
2677
2720
|
} else {
|
2678
|
-
|
2679
|
-
if (startColumn) {
|
2680
|
-
markerLines[startLine] = [startColumn, 0];
|
2681
|
-
} else {
|
2682
|
-
markerLines[startLine] = true;
|
2683
|
-
}
|
2684
|
-
} else {
|
2685
|
-
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
2686
|
-
}
|
2721
|
+
return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
2687
2722
|
}
|
2723
|
+
}).join("\n");
|
2688
2724
|
|
2689
|
-
|
2690
|
-
|
2691
|
-
end,
|
2692
|
-
markerLines
|
2693
|
-
};
|
2725
|
+
if (opts.message && !hasColumns) {
|
2726
|
+
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
2694
2727
|
}
|
2695
2728
|
|
2696
|
-
|
2697
|
-
|
2698
|
-
|
2699
|
-
|
2700
|
-
|
2701
|
-
|
2702
|
-
return highlighted ? chalkFn(string) : string;
|
2703
|
-
};
|
2704
|
-
|
2705
|
-
const lines = rawLines.split(NEWLINE);
|
2706
|
-
const {
|
2707
|
-
start,
|
2708
|
-
end,
|
2709
|
-
markerLines
|
2710
|
-
} = getMarkerLines(loc, lines, opts);
|
2711
|
-
const hasColumns = loc.start && typeof loc.start.column === "number";
|
2712
|
-
const numberMaxWidth = String(end).length;
|
2713
|
-
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
|
2714
|
-
let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
|
2715
|
-
const number = start + 1 + index;
|
2716
|
-
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
2717
|
-
const gutter = ` ${paddedNumber} | `;
|
2718
|
-
const hasMarker = markerLines[number];
|
2719
|
-
const lastMarkerLine = !markerLines[number + 1];
|
2720
|
-
|
2721
|
-
if (hasMarker) {
|
2722
|
-
let markerLine = "";
|
2723
|
-
|
2724
|
-
if (Array.isArray(hasMarker)) {
|
2725
|
-
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
2726
|
-
const numberOfMarkers = hasMarker[1] || 1;
|
2727
|
-
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
|
2728
|
-
|
2729
|
-
if (lastMarkerLine && opts.message) {
|
2730
|
-
markerLine += " " + maybeHighlight(defs.message, opts.message);
|
2731
|
-
}
|
2732
|
-
}
|
2733
|
-
|
2734
|
-
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
|
2735
|
-
} else {
|
2736
|
-
return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;
|
2737
|
-
}
|
2738
|
-
}).join("\n");
|
2729
|
+
if (highlighted) {
|
2730
|
+
return chalk.reset(frame);
|
2731
|
+
} else {
|
2732
|
+
return frame;
|
2733
|
+
}
|
2734
|
+
}
|
2739
2735
|
|
2740
|
-
|
2741
|
-
|
2742
|
-
|
2736
|
+
function _default(rawLines, lineNumber, colNumber, opts = {}) {
|
2737
|
+
if (!deprecationWarningShown) {
|
2738
|
+
deprecationWarningShown = true;
|
2739
|
+
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
2743
2740
|
|
2744
|
-
if (
|
2745
|
-
|
2741
|
+
if (process.emitWarning) {
|
2742
|
+
process.emitWarning(message, "DeprecationWarning");
|
2746
2743
|
} else {
|
2747
|
-
|
2744
|
+
const deprecationError = new Error(message);
|
2745
|
+
deprecationError.name = "DeprecationWarning";
|
2746
|
+
console.warn(new Error(message));
|
2748
2747
|
}
|
2749
2748
|
}
|
2750
2749
|
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
if (process.emitWarning) {
|
2757
|
-
process.emitWarning(message, "DeprecationWarning");
|
2758
|
-
} else {
|
2759
|
-
const deprecationError = new Error(message);
|
2760
|
-
deprecationError.name = "DeprecationWarning";
|
2761
|
-
console.warn(new Error(message));
|
2762
|
-
}
|
2750
|
+
colNumber = Math.max(colNumber, 0);
|
2751
|
+
const location = {
|
2752
|
+
start: {
|
2753
|
+
column: colNumber,
|
2754
|
+
line: lineNumber
|
2763
2755
|
}
|
2756
|
+
};
|
2757
|
+
return codeFrameColumns$1(rawLines, location, opts);
|
2758
|
+
}
|
2764
2759
|
|
2765
|
-
|
2766
|
-
|
2767
|
-
|
2768
|
-
|
2769
|
-
|
2770
|
-
}
|
2771
|
-
};
|
2772
|
-
return codeFrameColumns(rawLines, location, opts);
|
2773
|
-
}
|
2760
|
+
var lib = /*#__PURE__*/Object.defineProperty({
|
2761
|
+
codeFrameColumns: codeFrameColumns_1,
|
2762
|
+
default: default_1
|
2763
|
+
}, '__esModule', {
|
2764
|
+
value: true
|
2774
2765
|
});
|
2775
2766
|
|
2776
2767
|
const {
|
2777
2768
|
default: LinesAndColumns
|
2778
|
-
} = dist;
|
2769
|
+
} = dist$2;
|
2779
2770
|
const {
|
2780
2771
|
codeFrameColumns
|
2781
|
-
} = lib
|
2772
|
+
} = lib;
|
2782
2773
|
const JSONError = errorEx_1('JSONError', {
|
2783
2774
|
fileName: errorEx_1.append('in %s'),
|
2784
2775
|
codeFrame: errorEx_1.append('\n\n%s\n')
|
2785
2776
|
});
|
2786
2777
|
|
2787
|
-
|
2778
|
+
const parseJson = (string, reviver, filename) => {
|
2788
2779
|
if (typeof reviver === 'string') {
|
2789
2780
|
filename = reviver;
|
2790
2781
|
reviver = null;
|
@@ -2794,12 +2785,12 @@ var parseJson$1 = (string, reviver, filename) => {
|
|
2794
2785
|
try {
|
2795
2786
|
return JSON.parse(string, reviver);
|
2796
2787
|
} catch (error) {
|
2797
|
-
|
2788
|
+
jsonParseEvenBetterErrors(string, reviver);
|
2798
2789
|
throw error;
|
2799
2790
|
}
|
2800
2791
|
} catch (error) {
|
2801
2792
|
error.message = error.message.replace(/\n/g, '');
|
2802
|
-
const indexMatch = error.message.match(/in JSON at position (\d+) while parsing
|
2793
|
+
const indexMatch = error.message.match(/in JSON at position (\d+) while parsing/);
|
2803
2794
|
const jsonError = new JSONError(error);
|
2804
2795
|
|
2805
2796
|
if (filename) {
|
@@ -2825,6 +2816,9 @@ var parseJson$1 = (string, reviver, filename) => {
|
|
2825
2816
|
}
|
2826
2817
|
};
|
2827
2818
|
|
2819
|
+
parseJson.JSONError = JSONError;
|
2820
|
+
var parseJson_1 = parseJson;
|
2821
|
+
|
2828
2822
|
const Char = {
|
2829
2823
|
ANCHOR: '&',
|
2830
2824
|
COMMENT: '#',
|
@@ -3085,10 +3079,10 @@ class Range {
|
|
3085
3079
|
/** Root class of all nodes */
|
3086
3080
|
|
3087
3081
|
|
3088
|
-
class Node {
|
3082
|
+
class Node$1 {
|
3089
3083
|
static addStringTerminator(src, offset, str) {
|
3090
3084
|
if (str[str.length - 1] === '\n') return str;
|
3091
|
-
const next = Node.endOfWhiteSpace(src, offset);
|
3085
|
+
const next = Node$1.endOfWhiteSpace(src, offset);
|
3092
3086
|
return next >= src.length || src[next] === '\n' ? str + '\n' : str;
|
3093
3087
|
} // ^(---|...)
|
3094
3088
|
|
@@ -3167,12 +3161,12 @@ class Node {
|
|
3167
3161
|
|
3168
3162
|
|
3169
3163
|
static endOfBlockIndent(src, indent, lineStart) {
|
3170
|
-
const inEnd = Node.endOfIndent(src, lineStart);
|
3164
|
+
const inEnd = Node$1.endOfIndent(src, lineStart);
|
3171
3165
|
|
3172
3166
|
if (inEnd > lineStart + indent) {
|
3173
3167
|
return inEnd;
|
3174
3168
|
} else {
|
3175
|
-
const wsEnd = Node.endOfWhiteSpace(src, inEnd);
|
3169
|
+
const wsEnd = Node$1.endOfWhiteSpace(src, inEnd);
|
3176
3170
|
const ch = src[wsEnd];
|
3177
3171
|
if (!ch || ch === '\n') return wsEnd;
|
3178
3172
|
}
|
@@ -3194,7 +3188,7 @@ class Node {
|
|
3194
3188
|
|
3195
3189
|
static normalizeOffset(src, offset) {
|
3196
3190
|
const ch = src[offset];
|
3197
|
-
return !ch ? offset : ch !== '\n' && src[offset - 1] === '\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);
|
3191
|
+
return !ch ? offset : ch !== '\n' && src[offset - 1] === '\n' ? offset - 1 : Node$1.endOfWhiteSpace(src, offset);
|
3198
3192
|
} // fold single newline into space, multiple newlines to N - 1 newlines
|
3199
3193
|
// presumes src[offset] === '\n'
|
3200
3194
|
|
@@ -3215,7 +3209,7 @@ class Node {
|
|
3215
3209
|
|
3216
3210
|
case '\t':
|
3217
3211
|
if (inCount <= indent) error = true;
|
3218
|
-
offset = Node.endOfWhiteSpace(src, offset + 2) - 1;
|
3212
|
+
offset = Node$1.endOfWhiteSpace(src, offset + 2) - 1;
|
3219
3213
|
break;
|
3220
3214
|
|
3221
3215
|
case ' ':
|
@@ -3287,7 +3281,7 @@ class Node {
|
|
3287
3281
|
const {
|
3288
3282
|
end
|
3289
3283
|
} = this.valueRange;
|
3290
|
-
return start !== end || Node.atBlank(src, end - 1);
|
3284
|
+
return start !== end || Node$1.atBlank(src, end - 1);
|
3291
3285
|
}
|
3292
3286
|
|
3293
3287
|
get hasComment() {
|
@@ -3393,7 +3387,7 @@ class Node {
|
|
3393
3387
|
} = this.context;
|
3394
3388
|
|
3395
3389
|
if (src[start] === Char.COMMENT) {
|
3396
|
-
const end = Node.endOfLine(src, start + 1);
|
3390
|
+
const end = Node$1.endOfLine(src, start + 1);
|
3397
3391
|
const commentRange = new Range(start, end);
|
3398
3392
|
this.props.push(commentRange);
|
3399
3393
|
return end;
|
@@ -3428,14 +3422,14 @@ class Node {
|
|
3428
3422
|
} = this;
|
3429
3423
|
if (value != null) return value;
|
3430
3424
|
const str = src.slice(range.start, range.end);
|
3431
|
-
return Node.addStringTerminator(src, range.end, str);
|
3425
|
+
return Node$1.addStringTerminator(src, range.end, str);
|
3432
3426
|
}
|
3433
3427
|
|
3434
3428
|
}
|
3435
3429
|
|
3436
3430
|
class YAMLError extends Error {
|
3437
3431
|
constructor(name, source, message) {
|
3438
|
-
if (!message || !(source instanceof Node)) throw new Error(`Invalid arguments for new ${name}`);
|
3432
|
+
if (!message || !(source instanceof Node$1)) throw new Error(`Invalid arguments for new ${name}`);
|
3439
3433
|
super();
|
3440
3434
|
this.name = name;
|
3441
3435
|
this.message = message;
|
@@ -3526,7 +3520,7 @@ function _defineProperty(obj, key, value) {
|
|
3526
3520
|
return obj;
|
3527
3521
|
}
|
3528
3522
|
|
3529
|
-
class PlainValue extends Node {
|
3523
|
+
class PlainValue extends Node$1 {
|
3530
3524
|
static endOfLine(src, start, inFlow) {
|
3531
3525
|
let ch = src[start];
|
3532
3526
|
let offset = start;
|
@@ -3565,7 +3559,7 @@ class PlainValue extends Node {
|
|
3565
3559
|
const {
|
3566
3560
|
fold,
|
3567
3561
|
offset
|
3568
|
-
} = Node.foldNewline(src, i, -1);
|
3562
|
+
} = Node$1.foldNewline(src, i, -1);
|
3569
3563
|
str += fold;
|
3570
3564
|
i = offset;
|
3571
3565
|
} else if (ch === ' ' || ch === '\t') {
|
@@ -3623,8 +3617,8 @@ class PlainValue extends Node {
|
|
3623
3617
|
let valueEnd = start;
|
3624
3618
|
|
3625
3619
|
for (let ch = src[offset]; ch === '\n'; ch = src[offset]) {
|
3626
|
-
if (Node.atDocumentBoundary(src, offset + 1)) break;
|
3627
|
-
const end = Node.endOfBlockIndent(src, indent, offset + 1);
|
3620
|
+
if (Node$1.atDocumentBoundary(src, offset + 1)) break;
|
3621
|
+
const end = Node$1.endOfBlockIndent(src, indent, offset + 1);
|
3628
3622
|
if (end === null || src[end] === '#') break;
|
3629
3623
|
|
3630
3624
|
if (src[end] === '\n') {
|
@@ -3680,7 +3674,7 @@ class PlainValue extends Node {
|
|
3680
3674
|
}
|
3681
3675
|
|
3682
3676
|
this.valueRange = new Range(start, offset);
|
3683
|
-
offset = Node.endOfWhiteSpace(src, offset);
|
3677
|
+
offset = Node$1.endOfWhiteSpace(src, offset);
|
3684
3678
|
offset = this.parseComment(offset);
|
3685
3679
|
|
3686
3680
|
if (!this.hasComment || this.valueRange.isEmpty()) {
|
@@ -3693,7 +3687,7 @@ class PlainValue extends Node {
|
|
3693
3687
|
}
|
3694
3688
|
|
3695
3689
|
var Char_1 = Char;
|
3696
|
-
var Node_1 = Node;
|
3690
|
+
var Node_1$1 = Node$1;
|
3697
3691
|
var PlainValue_1 = PlainValue;
|
3698
3692
|
var Range_1 = Range;
|
3699
3693
|
var Type_1 = Type;
|
@@ -3707,7 +3701,7 @@ var defaultTagPrefix_1 = defaultTagPrefix;
|
|
3707
3701
|
var defaultTags_1 = defaultTags;
|
3708
3702
|
var PlainValueEc8e588e = {
|
3709
3703
|
Char: Char_1,
|
3710
|
-
Node: Node_1,
|
3704
|
+
Node: Node_1$1,
|
3711
3705
|
PlainValue: PlainValue_1,
|
3712
3706
|
Range: Range_1,
|
3713
3707
|
Type: Type_1,
|
@@ -3893,7 +3887,7 @@ function grabCollectionEndComments(node) {
|
|
3893
3887
|
|
3894
3888
|
while (cnode instanceof CollectionItem) cnode = cnode.node;
|
3895
3889
|
|
3896
|
-
if (!(cnode instanceof Collection)) return null;
|
3890
|
+
if (!(cnode instanceof Collection$1)) return null;
|
3897
3891
|
const len = cnode.items.length;
|
3898
3892
|
let ci = -1;
|
3899
3893
|
|
@@ -3925,7 +3919,7 @@ function grabCollectionEndComments(node) {
|
|
3925
3919
|
return ca;
|
3926
3920
|
}
|
3927
3921
|
|
3928
|
-
class Collection extends PlainValueEc8e588e.Node {
|
3922
|
+
class Collection$1 extends PlainValueEc8e588e.Node {
|
3929
3923
|
static nextContentHasIndent(src, offset, indent) {
|
3930
3924
|
const lineStart = PlainValueEc8e588e.Node.endOfLine(src, offset) + 1;
|
3931
3925
|
offset = PlainValueEc8e588e.Node.endOfWhiteSpace(src, lineStart);
|
@@ -3933,7 +3927,7 @@ class Collection extends PlainValueEc8e588e.Node {
|
|
3933
3927
|
if (!ch) return false;
|
3934
3928
|
if (offset >= lineStart + indent) return true;
|
3935
3929
|
if (ch !== '#' && ch !== '\n') return false;
|
3936
|
-
return Collection.nextContentHasIndent(src, offset, indent);
|
3930
|
+
return Collection$1.nextContentHasIndent(src, offset, indent);
|
3937
3931
|
}
|
3938
3932
|
|
3939
3933
|
constructor(firstItem) {
|
@@ -4003,7 +3997,7 @@ class Collection extends PlainValueEc8e588e.Node {
|
|
4003
3997
|
this.items.push(blankLine);
|
4004
3998
|
offset -= 1; // blankLine.parse() consumes terminal newline
|
4005
3999
|
} else if (ch === '#') {
|
4006
|
-
if (offset < lineStart + indent && !Collection.nextContentHasIndent(src, offset, indent)) {
|
4000
|
+
if (offset < lineStart + indent && !Collection$1.nextContentHasIndent(src, offset, indent)) {
|
4007
4001
|
return offset;
|
4008
4002
|
}
|
4009
4003
|
|
@@ -4187,7 +4181,7 @@ class Directive extends PlainValueEc8e588e.Node {
|
|
4187
4181
|
|
4188
4182
|
}
|
4189
4183
|
|
4190
|
-
class Document extends PlainValueEc8e588e.Node {
|
4184
|
+
class Document$2 extends PlainValueEc8e588e.Node {
|
4191
4185
|
static startCommentOrEndBlankLine(src, start) {
|
4192
4186
|
const offset = PlainValueEc8e588e.Node.endOfWhiteSpace(src, start);
|
4193
4187
|
const ch = src[offset];
|
@@ -4212,7 +4206,7 @@ class Document extends PlainValueEc8e588e.Node {
|
|
4212
4206
|
let offset = start;
|
4213
4207
|
|
4214
4208
|
while (!PlainValueEc8e588e.Node.atDocumentBoundary(src, offset, PlainValueEc8e588e.Char.DIRECTIVES_END)) {
|
4215
|
-
offset = Document.startCommentOrEndBlankLine(src, offset);
|
4209
|
+
offset = Document$2.startCommentOrEndBlankLine(src, offset);
|
4216
4210
|
|
4217
4211
|
switch (src[offset]) {
|
4218
4212
|
case '\n':
|
@@ -4350,7 +4344,7 @@ class Document extends PlainValueEc8e588e.Node {
|
|
4350
4344
|
}
|
4351
4345
|
}
|
4352
4346
|
|
4353
|
-
offset = Document.startCommentOrEndBlankLine(src, offset);
|
4347
|
+
offset = Document$2.startCommentOrEndBlankLine(src, offset);
|
4354
4348
|
}
|
4355
4349
|
|
4356
4350
|
this.valueRange.end = offset;
|
@@ -4439,7 +4433,7 @@ class Document extends PlainValueEc8e588e.Node {
|
|
4439
4433
|
|
4440
4434
|
}
|
4441
4435
|
|
4442
|
-
class Alias extends PlainValueEc8e588e.Node {
|
4436
|
+
class Alias$1 extends PlainValueEc8e588e.Node {
|
4443
4437
|
/**
|
4444
4438
|
* Parses an *alias from the source
|
4445
4439
|
*
|
@@ -5206,7 +5200,7 @@ class QuoteSingle extends PlainValueEc8e588e.Node {
|
|
5206
5200
|
function createNewNode(type, props) {
|
5207
5201
|
switch (type) {
|
5208
5202
|
case PlainValueEc8e588e.Type.ALIAS:
|
5209
|
-
return new Alias(type, props);
|
5203
|
+
return new Alias$1(type, props);
|
5210
5204
|
|
5211
5205
|
case PlainValueEc8e588e.Type.BLOCK_FOLDED:
|
5212
5206
|
case PlainValueEc8e588e.Type.BLOCK_LITERAL:
|
@@ -5322,7 +5316,7 @@ class ParseContext {
|
|
5322
5316
|
node.error = new PlainValueEc8e588e.YAMLSyntaxError(node, 'Block collection must not have preceding content here (e.g. directives-end indicator)');
|
5323
5317
|
}
|
5324
5318
|
|
5325
|
-
const collection = new Collection(node);
|
5319
|
+
const collection = new Collection$1(node);
|
5326
5320
|
offset = collection.parse(new ParseContext(context), offset);
|
5327
5321
|
collection.range = new PlainValueEc8e588e.Range(start, offset);
|
5328
5322
|
return collection;
|
@@ -5371,11 +5365,17 @@ class ParseContext {
|
|
5371
5365
|
|
5372
5366
|
while (ch === PlainValueEc8e588e.Char.ANCHOR || ch === PlainValueEc8e588e.Char.COMMENT || ch === PlainValueEc8e588e.Char.TAG || ch === '\n') {
|
5373
5367
|
if (ch === '\n') {
|
5374
|
-
|
5375
|
-
|
5368
|
+
let inEnd = offset;
|
5369
|
+
let lineStart;
|
5370
|
+
|
5371
|
+
do {
|
5372
|
+
lineStart = inEnd + 1;
|
5373
|
+
inEnd = PlainValueEc8e588e.Node.endOfIndent(src, lineStart);
|
5374
|
+
} while (src[inEnd] === '\n');
|
5375
|
+
|
5376
5376
|
const indentDiff = inEnd - (lineStart + this.indent);
|
5377
5377
|
const noIndicatorAsIndent = parent.type === PlainValueEc8e588e.Type.SEQ_ITEM && parent.context.atLineStart;
|
5378
|
-
if (!PlainValueEc8e588e.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;
|
5378
|
+
if (src[inEnd] !== '#' && !PlainValueEc8e588e.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;
|
5379
5379
|
this.atLineStart = true;
|
5380
5380
|
this.lineStart = lineStart;
|
5381
5381
|
lineHasProps = false;
|
@@ -5423,7 +5423,7 @@ class ParseContext {
|
|
5423
5423
|
} // Published as 'yaml/parse-cst'
|
5424
5424
|
|
5425
5425
|
|
5426
|
-
function parse(src) {
|
5426
|
+
function parse$1(src) {
|
5427
5427
|
const cr = [];
|
5428
5428
|
|
5429
5429
|
if (src.indexOf('\r') !== -1) {
|
@@ -5437,7 +5437,7 @@ function parse(src) {
|
|
5437
5437
|
let offset = 0;
|
5438
5438
|
|
5439
5439
|
do {
|
5440
|
-
const doc = new Document();
|
5440
|
+
const doc = new Document$2();
|
5441
5441
|
const context = new ParseContext({
|
5442
5442
|
src
|
5443
5443
|
});
|
@@ -5465,7 +5465,7 @@ function parse(src) {
|
|
5465
5465
|
return documents;
|
5466
5466
|
}
|
5467
5467
|
|
5468
|
-
var parse_1 = parse;
|
5468
|
+
var parse_1 = parse$1;
|
5469
5469
|
var parseCst = {
|
5470
5470
|
parse: parse_1
|
5471
5471
|
};
|
@@ -5480,7 +5480,7 @@ function addComment(str, indent, comment) {
|
|
5480
5480
|
return !comment ? str : comment.indexOf('\n') === -1 ? `${str} #${comment}` : `${str}\n` + comment.replace(/^/gm, `${indent || ''}#`);
|
5481
5481
|
}
|
5482
5482
|
|
5483
|
-
class Node
|
5483
|
+
class Node {}
|
5484
5484
|
|
5485
5485
|
function toJSON(value, arg, ctx) {
|
5486
5486
|
if (Array.isArray(value)) return value.map((v, i) => toJSON(v, String(i), ctx));
|
@@ -5500,7 +5500,7 @@ function toJSON(value, arg, ctx) {
|
|
5500
5500
|
return value;
|
5501
5501
|
}
|
5502
5502
|
|
5503
|
-
class Scalar extends Node
|
5503
|
+
class Scalar extends Node {
|
5504
5504
|
constructor(value) {
|
5505
5505
|
super();
|
5506
5506
|
this.value = value;
|
@@ -5521,9 +5521,21 @@ function collectionFromPath(schema, path, value) {
|
|
5521
5521
|
|
5522
5522
|
for (let i = path.length - 1; i >= 0; --i) {
|
5523
5523
|
const k = path[i];
|
5524
|
-
|
5525
|
-
|
5526
|
-
|
5524
|
+
|
5525
|
+
if (Number.isInteger(k) && k >= 0) {
|
5526
|
+
const a = [];
|
5527
|
+
a[k] = v;
|
5528
|
+
v = a;
|
5529
|
+
} else {
|
5530
|
+
const o = {};
|
5531
|
+
Object.defineProperty(o, k, {
|
5532
|
+
value: v,
|
5533
|
+
writable: true,
|
5534
|
+
enumerable: true,
|
5535
|
+
configurable: true
|
5536
|
+
});
|
5537
|
+
v = o;
|
5538
|
+
}
|
5527
5539
|
}
|
5528
5540
|
|
5529
5541
|
return schema.createNode(v, false);
|
@@ -5532,7 +5544,7 @@ function collectionFromPath(schema, path, value) {
|
|
5532
5544
|
|
5533
5545
|
const isEmptyPath = path => path == null || typeof path === 'object' && path[Symbol.iterator]().next().done;
|
5534
5546
|
|
5535
|
-
class Collection
|
5547
|
+
class Collection extends Node {
|
5536
5548
|
constructor(schema) {
|
5537
5549
|
super();
|
5538
5550
|
|
@@ -5545,19 +5557,19 @@ class Collection$1 extends Node$1 {
|
|
5545
5557
|
if (isEmptyPath(path)) this.add(value);else {
|
5546
5558
|
const [key, ...rest] = path;
|
5547
5559
|
const node = this.get(key, true);
|
5548
|
-
if (node instanceof Collection
|
5560
|
+
if (node instanceof Collection) node.addIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
5549
5561
|
}
|
5550
5562
|
}
|
5551
5563
|
|
5552
5564
|
deleteIn([key, ...rest]) {
|
5553
5565
|
if (rest.length === 0) return this.delete(key);
|
5554
5566
|
const node = this.get(key, true);
|
5555
|
-
if (node instanceof Collection
|
5567
|
+
if (node instanceof Collection) return node.deleteIn(rest);else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
5556
5568
|
}
|
5557
5569
|
|
5558
5570
|
getIn([key, ...rest], keepScalar) {
|
5559
5571
|
const node = this.get(key, true);
|
5560
|
-
if (rest.length === 0) return !keepScalar && node instanceof Scalar ? node.value : node;else return node instanceof Collection
|
5572
|
+
if (rest.length === 0) return !keepScalar && node instanceof Scalar ? node.value : node;else return node instanceof Collection ? node.getIn(rest, keepScalar) : undefined;
|
5561
5573
|
}
|
5562
5574
|
|
5563
5575
|
hasAllNullValues() {
|
@@ -5571,7 +5583,7 @@ class Collection$1 extends Node$1 {
|
|
5571
5583
|
hasIn([key, ...rest]) {
|
5572
5584
|
if (rest.length === 0) return this.has(key);
|
5573
5585
|
const node = this.get(key, true);
|
5574
|
-
return node instanceof Collection
|
5586
|
+
return node instanceof Collection ? node.hasIn(rest) : false;
|
5575
5587
|
}
|
5576
5588
|
|
5577
5589
|
setIn([key, ...rest], value) {
|
@@ -5579,7 +5591,7 @@ class Collection$1 extends Node$1 {
|
|
5579
5591
|
this.set(key, value);
|
5580
5592
|
} else {
|
5581
5593
|
const node = this.get(key, true);
|
5582
|
-
if (node instanceof Collection
|
5594
|
+
if (node instanceof Collection) node.setIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
5583
5595
|
}
|
5584
5596
|
} // overridden in implementations
|
5585
5597
|
|
@@ -5653,7 +5665,7 @@ class Collection$1 extends Node$1 {
|
|
5653
5665
|
} = flowChars;
|
5654
5666
|
const strings = nodes.map(n => n.str);
|
5655
5667
|
|
5656
|
-
if (hasItemWithNewLine || strings.reduce((sum, str) => sum + str.length + 2, 2) > Collection
|
5668
|
+
if (hasItemWithNewLine || strings.reduce((sum, str) => sum + str.length + 2, 2) > Collection.maxFlowStringSingleLineLength) {
|
5657
5669
|
str = start;
|
5658
5670
|
|
5659
5671
|
for (const s of strings) {
|
@@ -5681,7 +5693,7 @@ class Collection$1 extends Node$1 {
|
|
5681
5693
|
|
5682
5694
|
}
|
5683
5695
|
|
5684
|
-
PlainValueEc8e588e._defineProperty(Collection
|
5696
|
+
PlainValueEc8e588e._defineProperty(Collection, "maxFlowStringSingleLineLength", 60);
|
5685
5697
|
|
5686
5698
|
function asItemIndex(key) {
|
5687
5699
|
let idx = key instanceof Scalar ? key.value : key;
|
@@ -5689,7 +5701,7 @@ function asItemIndex(key) {
|
|
5689
5701
|
return Number.isInteger(idx) && idx >= 0 ? idx : null;
|
5690
5702
|
}
|
5691
5703
|
|
5692
|
-
class YAMLSeq extends Collection
|
5704
|
+
class YAMLSeq extends Collection {
|
5693
5705
|
add(value) {
|
5694
5706
|
this.items.push(value);
|
5695
5707
|
}
|
@@ -5747,8 +5759,8 @@ class YAMLSeq extends Collection$1 {
|
|
5747
5759
|
const stringifyKey = (key, jsKey, ctx) => {
|
5748
5760
|
if (jsKey === null) return '';
|
5749
5761
|
if (typeof jsKey !== 'object') return String(jsKey);
|
5750
|
-
if (key instanceof Node
|
5751
|
-
anchors:
|
5762
|
+
if (key instanceof Node && ctx && ctx.doc) return key.toString({
|
5763
|
+
anchors: Object.create(null),
|
5752
5764
|
doc: ctx.doc,
|
5753
5765
|
indent: '',
|
5754
5766
|
indentStep: ctx.indentStep,
|
@@ -5759,7 +5771,7 @@ const stringifyKey = (key, jsKey, ctx) => {
|
|
5759
5771
|
return JSON.stringify(jsKey);
|
5760
5772
|
};
|
5761
5773
|
|
5762
|
-
class Pair extends Node
|
5774
|
+
class Pair extends Node {
|
5763
5775
|
constructor(key, value = null) {
|
5764
5776
|
super();
|
5765
5777
|
this.key = key;
|
@@ -5768,12 +5780,12 @@ class Pair extends Node$1 {
|
|
5768
5780
|
}
|
5769
5781
|
|
5770
5782
|
get commentBefore() {
|
5771
|
-
return this.key instanceof Node
|
5783
|
+
return this.key instanceof Node ? this.key.commentBefore : undefined;
|
5772
5784
|
}
|
5773
5785
|
|
5774
5786
|
set commentBefore(cb) {
|
5775
5787
|
if (this.key == null) this.key = new Scalar(null);
|
5776
|
-
if (this.key instanceof Node
|
5788
|
+
if (this.key instanceof Node) this.key.commentBefore = cb;else {
|
5777
5789
|
const msg = 'Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.';
|
5778
5790
|
throw new Error(msg);
|
5779
5791
|
}
|
@@ -5789,7 +5801,13 @@ class Pair extends Node$1 {
|
|
5789
5801
|
map.add(key);
|
5790
5802
|
} else {
|
5791
5803
|
const stringKey = stringifyKey(this.key, key, ctx);
|
5792
|
-
|
5804
|
+
const value = toJSON(this.value, stringKey, ctx);
|
5805
|
+
if (stringKey in map) Object.defineProperty(map, stringKey, {
|
5806
|
+
value,
|
5807
|
+
writable: true,
|
5808
|
+
enumerable: true,
|
5809
|
+
configurable: true
|
5810
|
+
});else map[stringKey] = value;
|
5793
5811
|
}
|
5794
5812
|
|
5795
5813
|
return map;
|
@@ -5811,20 +5829,20 @@ class Pair extends Node$1 {
|
|
5811
5829
|
key,
|
5812
5830
|
value
|
5813
5831
|
} = this;
|
5814
|
-
let keyComment = key instanceof Node
|
5832
|
+
let keyComment = key instanceof Node && key.comment;
|
5815
5833
|
|
5816
5834
|
if (simpleKeys) {
|
5817
5835
|
if (keyComment) {
|
5818
5836
|
throw new Error('With simple keys, key nodes cannot have comments');
|
5819
5837
|
}
|
5820
5838
|
|
5821
|
-
if (key instanceof Collection
|
5839
|
+
if (key instanceof Collection) {
|
5822
5840
|
const msg = 'With simple keys, collection cannot be used as a key value';
|
5823
5841
|
throw new Error(msg);
|
5824
5842
|
}
|
5825
5843
|
}
|
5826
5844
|
|
5827
|
-
|
5845
|
+
let explicitKey = !simpleKeys && (!key || keyComment || (key instanceof Node ? key instanceof Collection || key.type === PlainValueEc8e588e.Type.BLOCK_FOLDED || key.type === PlainValueEc8e588e.Type.BLOCK_LITERAL : typeof key === 'object'));
|
5828
5846
|
const {
|
5829
5847
|
doc,
|
5830
5848
|
indent,
|
@@ -5839,13 +5857,18 @@ class Pair extends Node$1 {
|
|
5839
5857
|
let str = stringify(key, ctx, () => keyComment = null, () => chompKeep = true);
|
5840
5858
|
str = addComment(str, ctx.indent, keyComment);
|
5841
5859
|
|
5860
|
+
if (!explicitKey && str.length > 1024) {
|
5861
|
+
if (simpleKeys) throw new Error('With simple keys, single line scalar must not span more than 1024 characters');
|
5862
|
+
explicitKey = true;
|
5863
|
+
}
|
5864
|
+
|
5842
5865
|
if (ctx.allNullValues && !simpleKeys) {
|
5843
5866
|
if (this.comment) {
|
5844
5867
|
str = addComment(str, ctx.indent, this.comment);
|
5845
5868
|
if (onComment) onComment();
|
5846
5869
|
} else if (chompKeep && !keyComment && onChompKeep) onChompKeep();
|
5847
5870
|
|
5848
|
-
return ctx.inFlow ? str : `? ${str}`;
|
5871
|
+
return ctx.inFlow && !explicitKey ? str : `? ${str}`;
|
5849
5872
|
}
|
5850
5873
|
|
5851
5874
|
str = explicitKey ? `? ${str}\n${indent}:` : `${str}:`;
|
@@ -5859,7 +5882,7 @@ class Pair extends Node$1 {
|
|
5859
5882
|
let vcb = '';
|
5860
5883
|
let valueComment = null;
|
5861
5884
|
|
5862
|
-
if (value instanceof Node
|
5885
|
+
if (value instanceof Node) {
|
5863
5886
|
if (value.spaceBefore) vcb = '\n';
|
5864
5887
|
|
5865
5888
|
if (value.commentBefore) {
|
@@ -5886,10 +5909,10 @@ class Pair extends Node$1 {
|
|
5886
5909
|
|
5887
5910
|
if (vcb || this.comment) {
|
5888
5911
|
ws = `${vcb}\n${ctx.indent}`;
|
5889
|
-
} else if (!explicitKey && value instanceof Collection
|
5912
|
+
} else if (!explicitKey && value instanceof Collection) {
|
5890
5913
|
const flow = valueStr[0] === '[' || valueStr[0] === '{';
|
5891
5914
|
if (!flow || valueStr.includes('\n')) ws = `\n${ctx.indent}`;
|
5892
|
-
}
|
5915
|
+
} else if (valueStr[0] === '\n') ws = '';
|
5893
5916
|
|
5894
5917
|
if (chompKeep && !valueComment && onChompKeep) onChompKeep();
|
5895
5918
|
return addComment(str + ws + valueStr, ctx.indent, valueComment);
|
@@ -5903,10 +5926,10 @@ PlainValueEc8e588e._defineProperty(Pair, "Type", {
|
|
5903
5926
|
});
|
5904
5927
|
|
5905
5928
|
const getAliasCount = (node, anchors) => {
|
5906
|
-
if (node instanceof Alias
|
5929
|
+
if (node instanceof Alias) {
|
5907
5930
|
const anchor = anchors.get(node.source);
|
5908
5931
|
return anchor.count * anchor.aliasCount;
|
5909
|
-
} else if (node instanceof Collection
|
5932
|
+
} else if (node instanceof Collection) {
|
5910
5933
|
let count = 0;
|
5911
5934
|
|
5912
5935
|
for (const item of node.items) {
|
@@ -5924,7 +5947,7 @@ const getAliasCount = (node, anchors) => {
|
|
5924
5947
|
return 1;
|
5925
5948
|
};
|
5926
5949
|
|
5927
|
-
class Alias
|
5950
|
+
class Alias extends Node {
|
5928
5951
|
static stringify({
|
5929
5952
|
range,
|
5930
5953
|
source
|
@@ -5981,12 +6004,12 @@ class Alias$1 extends Node$1 {
|
|
5981
6004
|
|
5982
6005
|
|
5983
6006
|
toString(ctx) {
|
5984
|
-
return Alias
|
6007
|
+
return Alias.stringify(this, ctx);
|
5985
6008
|
}
|
5986
6009
|
|
5987
6010
|
}
|
5988
6011
|
|
5989
|
-
PlainValueEc8e588e._defineProperty(Alias
|
6012
|
+
PlainValueEc8e588e._defineProperty(Alias, "default", true);
|
5990
6013
|
|
5991
6014
|
function findPair(items, key) {
|
5992
6015
|
const k = key instanceof Scalar ? key.value : key;
|
@@ -6001,7 +6024,7 @@ function findPair(items, key) {
|
|
6001
6024
|
return undefined;
|
6002
6025
|
}
|
6003
6026
|
|
6004
|
-
class YAMLMap extends Collection
|
6027
|
+
class YAMLMap extends Collection {
|
6005
6028
|
add(pair, overwrite) {
|
6006
6029
|
if (!pair) pair = new Pair(pair);else if (!(pair instanceof Pair)) pair = new Pair(pair.key || pair, pair.value);
|
6007
6030
|
const prev = findPair(this.items, pair.key);
|
@@ -6115,8 +6138,13 @@ class Merge extends Pair {
|
|
6115
6138
|
if (!map.has(key)) map.set(key, value);
|
6116
6139
|
} else if (map instanceof Set) {
|
6117
6140
|
map.add(key);
|
6118
|
-
} else {
|
6119
|
-
|
6141
|
+
} else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
6142
|
+
Object.defineProperty(map, key, {
|
6143
|
+
value,
|
6144
|
+
writable: true,
|
6145
|
+
enumerable: true,
|
6146
|
+
configurable: true
|
6147
|
+
});
|
6120
6148
|
}
|
6121
6149
|
}
|
6122
6150
|
}
|
@@ -6216,7 +6244,7 @@ const consumeMoreIndentedLines = (text, i) => {
|
|
6216
6244
|
* the first line, defaulting to `indent.length`
|
6217
6245
|
* @param {number} [options.lineWidth=80]
|
6218
6246
|
* @param {number} [options.minContentWidth=20] Allow highly indented lines to
|
6219
|
-
* stretch the line width
|
6247
|
+
* stretch the line width or indent content from the start
|
6220
6248
|
* @param {function} options.onFold Called once if the text is folded
|
6221
6249
|
* @param {function} options.onFold Called once if any line of text exceeds
|
6222
6250
|
* lineWidth characters
|
@@ -6235,11 +6263,18 @@ function foldFlowLines(text, indent, mode, {
|
|
6235
6263
|
if (text.length <= endStep) return text;
|
6236
6264
|
const folds = [];
|
6237
6265
|
const escapedFolds = {};
|
6238
|
-
let end = lineWidth -
|
6266
|
+
let end = lineWidth - indent.length;
|
6267
|
+
|
6268
|
+
if (typeof indentAtStart === 'number') {
|
6269
|
+
if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);else end = lineWidth - indentAtStart;
|
6270
|
+
}
|
6271
|
+
|
6239
6272
|
let split = undefined;
|
6240
6273
|
let prev = undefined;
|
6241
6274
|
let overflow = false;
|
6242
6275
|
let i = -1;
|
6276
|
+
let escStart = -1;
|
6277
|
+
let escEnd = -1;
|
6243
6278
|
|
6244
6279
|
if (mode === FOLD_BLOCK) {
|
6245
6280
|
i = consumeMoreIndentedLines(text, i);
|
@@ -6248,6 +6283,8 @@ function foldFlowLines(text, indent, mode, {
|
|
6248
6283
|
|
6249
6284
|
for (let ch; ch = text[i += 1];) {
|
6250
6285
|
if (mode === FOLD_QUOTED && ch === '\\') {
|
6286
|
+
escStart = i;
|
6287
|
+
|
6251
6288
|
switch (text[i + 1]) {
|
6252
6289
|
case 'x':
|
6253
6290
|
i += 3;
|
@@ -6264,6 +6301,8 @@ function foldFlowLines(text, indent, mode, {
|
|
6264
6301
|
default:
|
6265
6302
|
i += 1;
|
6266
6303
|
}
|
6304
|
+
|
6305
|
+
escEnd = i;
|
6267
6306
|
}
|
6268
6307
|
|
6269
6308
|
if (ch === '\n') {
|
@@ -6288,12 +6327,15 @@ function foldFlowLines(text, indent, mode, {
|
|
6288
6327
|
prev = ch;
|
6289
6328
|
ch = text[i += 1];
|
6290
6329
|
overflow = true;
|
6291
|
-
} //
|
6330
|
+
} // Account for newline escape, but don't break preceding escape
|
6331
|
+
|
6292
6332
|
|
6333
|
+
const j = i > escEnd + 1 ? i - 2 : escStart - 1; // Bail out if lineWidth & minContentWidth are shorter than an escape string
|
6293
6334
|
|
6294
|
-
|
6295
|
-
|
6296
|
-
|
6335
|
+
if (escapedFolds[j]) return text;
|
6336
|
+
folds.push(j);
|
6337
|
+
escapedFolds[j] = true;
|
6338
|
+
end = j + endStep;
|
6297
6339
|
split = undefined;
|
6298
6340
|
} else {
|
6299
6341
|
overflow = true;
|
@@ -6312,8 +6354,10 @@ function foldFlowLines(text, indent, mode, {
|
|
6312
6354
|
for (let i = 0; i < folds.length; ++i) {
|
6313
6355
|
const fold = folds[i];
|
6314
6356
|
const end = folds[i + 1] || text.length;
|
6315
|
-
if (
|
6316
|
-
|
6357
|
+
if (fold === 0) res = `\n${indent}${text.slice(0, end)}`;else {
|
6358
|
+
if (mode === FOLD_QUOTED && escapedFolds[fold]) res += `${text[fold]}\\`;
|
6359
|
+
res += `\n${indent}${text.slice(fold + 1, end)}`;
|
6360
|
+
}
|
6317
6361
|
}
|
6318
6362
|
|
6319
6363
|
return res;
|
@@ -6329,7 +6373,9 @@ const getFoldOptions = ({
|
|
6329
6373
|
|
6330
6374
|
const containsDocumentMarker = str => /^(%|---|\.\.\.)/m.test(str);
|
6331
6375
|
|
6332
|
-
function lineLengthOverLimit(str,
|
6376
|
+
function lineLengthOverLimit(str, lineWidth, indentLength) {
|
6377
|
+
if (!lineWidth || lineWidth < 0) return false;
|
6378
|
+
const limit = lineWidth - indentLength;
|
6333
6379
|
const strLen = str.length;
|
6334
6380
|
if (strLen <= limit) return false;
|
6335
6381
|
|
@@ -6472,7 +6518,7 @@ function blockString({
|
|
6472
6518
|
const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');
|
6473
6519
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
6474
6520
|
|
6475
|
-
const literal = type === PlainValueEc8e588e.Type.BLOCK_FOLDED ? false : type === PlainValueEc8e588e.Type.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, strOptions.fold.lineWidth
|
6521
|
+
const literal = type === PlainValueEc8e588e.Type.BLOCK_FOLDED ? false : type === PlainValueEc8e588e.Type.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, strOptions.fold.lineWidth, indent.length);
|
6476
6522
|
let header = literal ? '|' : '>';
|
6477
6523
|
if (!value) return header + '\n';
|
6478
6524
|
let wsStart = '';
|
@@ -6857,7 +6903,7 @@ function resolveByTagName(doc, node, tagName) {
|
|
6857
6903
|
if (tag.tag === tagName) {
|
6858
6904
|
if (tag.test) matchWithTest.push(tag);else {
|
6859
6905
|
const res = tag.resolve(doc, node);
|
6860
|
-
return res instanceof Collection
|
6906
|
+
return res instanceof Collection ? res : new Scalar(res);
|
6861
6907
|
}
|
6862
6908
|
}
|
6863
6909
|
}
|
@@ -6999,7 +7045,7 @@ function resolveNodeValue(doc, node) {
|
|
6999
7045
|
} // Lazy resolution for circular references
|
7000
7046
|
|
7001
7047
|
|
7002
|
-
const res = new Alias
|
7048
|
+
const res = new Alias(src);
|
7003
7049
|
|
7004
7050
|
anchors._cstAliases.push(res);
|
7005
7051
|
|
@@ -7094,14 +7140,14 @@ function resolveMap(doc, cst) {
|
|
7094
7140
|
const {
|
7095
7141
|
key: iKey
|
7096
7142
|
} = items[i];
|
7097
|
-
if (iKey instanceof Collection
|
7143
|
+
if (iKey instanceof Collection) hasCollectionKey = true;
|
7098
7144
|
|
7099
7145
|
if (doc.schema.merge && iKey && iKey.value === MERGE_KEY) {
|
7100
7146
|
items[i] = new Merge(items[i]);
|
7101
7147
|
const sources = items[i].value.items;
|
7102
7148
|
let error = null;
|
7103
7149
|
sources.some(node => {
|
7104
|
-
if (node instanceof Alias
|
7150
|
+
if (node instanceof Alias) {
|
7105
7151
|
// During parsing, alias sources are CST nodes; to account for
|
7106
7152
|
// circular references their resolved values can't be used here.
|
7107
7153
|
const {
|
@@ -7406,7 +7452,7 @@ function resolveSeq(doc, cst) {
|
|
7406
7452
|
seq.items = items;
|
7407
7453
|
resolveComments(seq, comments);
|
7408
7454
|
|
7409
|
-
if (!doc.options.mapAsMap && items.some(it => it instanceof Pair && it.key instanceof Collection
|
7455
|
+
if (!doc.options.mapAsMap && items.some(it => it instanceof Pair && it.key instanceof Collection)) {
|
7410
7456
|
const warn = 'Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.';
|
7411
7457
|
doc.warnings.push(new PlainValueEc8e588e.YAMLWarning(cst, warn));
|
7412
7458
|
}
|
@@ -7565,10 +7611,10 @@ function resolveFlowSeqItems(doc, cst) {
|
|
7565
7611
|
};
|
7566
7612
|
}
|
7567
7613
|
|
7568
|
-
var Alias_1 = Alias
|
7569
|
-
var Collection_1 = Collection
|
7614
|
+
var Alias_1 = Alias;
|
7615
|
+
var Collection_1 = Collection;
|
7570
7616
|
var Merge_1 = Merge;
|
7571
|
-
var Node_1
|
7617
|
+
var Node_1 = Node;
|
7572
7618
|
var Pair_1 = Pair;
|
7573
7619
|
var Scalar_1 = Scalar;
|
7574
7620
|
var YAMLMap_1 = YAMLMap;
|
@@ -7588,11 +7634,11 @@ var strOptions_1 = strOptions;
|
|
7588
7634
|
var stringifyNumber_1 = stringifyNumber;
|
7589
7635
|
var stringifyString_1 = stringifyString;
|
7590
7636
|
var toJSON_1 = toJSON;
|
7591
|
-
var
|
7637
|
+
var resolveSeqD03cb037 = {
|
7592
7638
|
Alias: Alias_1,
|
7593
7639
|
Collection: Collection_1,
|
7594
7640
|
Merge: Merge_1,
|
7595
|
-
Node: Node_1
|
7641
|
+
Node: Node_1,
|
7596
7642
|
Pair: Pair_1,
|
7597
7643
|
Scalar: Scalar_1,
|
7598
7644
|
YAMLMap: YAMLMap_1,
|
@@ -7614,7 +7660,790 @@ var resolveSeq4a68b39b = {
|
|
7614
7660
|
toJSON: toJSON_1
|
7615
7661
|
};
|
7616
7662
|
|
7617
|
-
|
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
|
+
|
8446
|
+
/* global atob, btoa, Buffer */
|
7618
8447
|
|
7619
8448
|
|
7620
8449
|
const binary = {
|
@@ -7632,7 +8461,7 @@ const binary = {
|
|
7632
8461
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
7633
8462
|
*/
|
7634
8463
|
resolve: (doc, node) => {
|
7635
|
-
const src =
|
8464
|
+
const src = resolveSeqD03cb037.resolveString(doc, node);
|
7636
8465
|
|
7637
8466
|
if (typeof Buffer === 'function') {
|
7638
8467
|
return Buffer.from(src, 'base64');
|
@@ -7650,7 +8479,7 @@ const binary = {
|
|
7650
8479
|
return null;
|
7651
8480
|
}
|
7652
8481
|
},
|
7653
|
-
options:
|
8482
|
+
options: resolveSeqD03cb037.binaryOptions,
|
7654
8483
|
stringify: ({
|
7655
8484
|
comment,
|
7656
8485
|
type,
|
@@ -7670,14 +8499,14 @@ const binary = {
|
|
7670
8499
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
7671
8500
|
}
|
7672
8501
|
|
7673
|
-
if (!type) type =
|
8502
|
+
if (!type) type = resolveSeqD03cb037.binaryOptions.defaultType;
|
7674
8503
|
|
7675
8504
|
if (type === PlainValueEc8e588e.Type.QUOTE_DOUBLE) {
|
7676
8505
|
value = src;
|
7677
8506
|
} else {
|
7678
8507
|
const {
|
7679
8508
|
lineWidth
|
7680
|
-
} =
|
8509
|
+
} = resolveSeqD03cb037.binaryOptions;
|
7681
8510
|
const n = Math.ceil(src.length / lineWidth);
|
7682
8511
|
const lines = new Array(n);
|
7683
8512
|
|
@@ -7688,7 +8517,7 @@ const binary = {
|
|
7688
8517
|
value = lines.join(type === PlainValueEc8e588e.Type.BLOCK_LITERAL ? '\n' : ' ');
|
7689
8518
|
}
|
7690
8519
|
|
7691
|
-
return
|
8520
|
+
return resolveSeqD03cb037.stringifyString({
|
7692
8521
|
comment,
|
7693
8522
|
type,
|
7694
8523
|
value
|
@@ -7697,29 +8526,29 @@ const binary = {
|
|
7697
8526
|
};
|
7698
8527
|
|
7699
8528
|
function parsePairs(doc, cst) {
|
7700
|
-
const seq =
|
8529
|
+
const seq = resolveSeqD03cb037.resolveSeq(doc, cst);
|
7701
8530
|
|
7702
8531
|
for (let i = 0; i < seq.items.length; ++i) {
|
7703
8532
|
let item = seq.items[i];
|
7704
|
-
if (item instanceof
|
8533
|
+
if (item instanceof resolveSeqD03cb037.Pair) continue;else if (item instanceof resolveSeqD03cb037.YAMLMap) {
|
7705
8534
|
if (item.items.length > 1) {
|
7706
8535
|
const msg = 'Each pair must have its own sequence indicator';
|
7707
8536
|
throw new PlainValueEc8e588e.YAMLSemanticError(cst, msg);
|
7708
8537
|
}
|
7709
8538
|
|
7710
|
-
const pair = item.items[0] || new
|
8539
|
+
const pair = item.items[0] || new resolveSeqD03cb037.Pair();
|
7711
8540
|
if (item.commentBefore) pair.commentBefore = pair.commentBefore ? `${item.commentBefore}\n${pair.commentBefore}` : item.commentBefore;
|
7712
8541
|
if (item.comment) pair.comment = pair.comment ? `${item.comment}\n${pair.comment}` : item.comment;
|
7713
8542
|
item = pair;
|
7714
8543
|
}
|
7715
|
-
seq.items[i] = item instanceof
|
8544
|
+
seq.items[i] = item instanceof resolveSeqD03cb037.Pair ? item : new resolveSeqD03cb037.Pair(item);
|
7716
8545
|
}
|
7717
8546
|
|
7718
8547
|
return seq;
|
7719
8548
|
}
|
7720
8549
|
|
7721
8550
|
function createPairs(schema, iterable, ctx) {
|
7722
|
-
const pairs = new
|
8551
|
+
const pairs = new resolveSeqD03cb037.YAMLSeq(schema);
|
7723
8552
|
pairs.tag = 'tag:yaml.org,2002:pairs';
|
7724
8553
|
|
7725
8554
|
for (const it of iterable) {
|
@@ -7755,19 +8584,19 @@ const pairs = {
|
|
7755
8584
|
createNode: createPairs
|
7756
8585
|
};
|
7757
8586
|
|
7758
|
-
class YAMLOMap extends
|
8587
|
+
class YAMLOMap extends resolveSeqD03cb037.YAMLSeq {
|
7759
8588
|
constructor() {
|
7760
8589
|
super();
|
7761
8590
|
|
7762
|
-
PlainValueEc8e588e._defineProperty(this, "add",
|
8591
|
+
PlainValueEc8e588e._defineProperty(this, "add", resolveSeqD03cb037.YAMLMap.prototype.add.bind(this));
|
7763
8592
|
|
7764
|
-
PlainValueEc8e588e._defineProperty(this, "delete",
|
8593
|
+
PlainValueEc8e588e._defineProperty(this, "delete", resolveSeqD03cb037.YAMLMap.prototype.delete.bind(this));
|
7765
8594
|
|
7766
|
-
PlainValueEc8e588e._defineProperty(this, "get",
|
8595
|
+
PlainValueEc8e588e._defineProperty(this, "get", resolveSeqD03cb037.YAMLMap.prototype.get.bind(this));
|
7767
8596
|
|
7768
|
-
PlainValueEc8e588e._defineProperty(this, "has",
|
8597
|
+
PlainValueEc8e588e._defineProperty(this, "has", resolveSeqD03cb037.YAMLMap.prototype.has.bind(this));
|
7769
8598
|
|
7770
|
-
PlainValueEc8e588e._defineProperty(this, "set",
|
8599
|
+
PlainValueEc8e588e._defineProperty(this, "set", resolveSeqD03cb037.YAMLMap.prototype.set.bind(this));
|
7771
8600
|
|
7772
8601
|
this.tag = YAMLOMap.tag;
|
7773
8602
|
}
|
@@ -7779,11 +8608,11 @@ class YAMLOMap extends resolveSeq4a68b39b.YAMLSeq {
|
|
7779
8608
|
for (const pair of this.items) {
|
7780
8609
|
let key, value;
|
7781
8610
|
|
7782
|
-
if (pair instanceof
|
7783
|
-
key =
|
7784
|
-
value =
|
8611
|
+
if (pair instanceof resolveSeqD03cb037.Pair) {
|
8612
|
+
key = resolveSeqD03cb037.toJSON(pair.key, '', ctx);
|
8613
|
+
value = resolveSeqD03cb037.toJSON(pair.value, key, ctx);
|
7785
8614
|
} else {
|
7786
|
-
key =
|
8615
|
+
key = resolveSeqD03cb037.toJSON(pair, '', ctx);
|
7787
8616
|
}
|
7788
8617
|
|
7789
8618
|
if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');
|
@@ -7804,7 +8633,7 @@ function parseOMap(doc, cst) {
|
|
7804
8633
|
for (const {
|
7805
8634
|
key
|
7806
8635
|
} of pairs.items) {
|
7807
|
-
if (key instanceof
|
8636
|
+
if (key instanceof resolveSeqD03cb037.Scalar) {
|
7808
8637
|
if (seenKeys.includes(key.value)) {
|
7809
8638
|
const msg = 'Ordered maps must not include duplicate keys';
|
7810
8639
|
throw new PlainValueEc8e588e.YAMLSemanticError(cst, msg);
|
@@ -7833,31 +8662,31 @@ const omap = {
|
|
7833
8662
|
createNode: createOMap
|
7834
8663
|
};
|
7835
8664
|
|
7836
|
-
class YAMLSet extends
|
8665
|
+
class YAMLSet extends resolveSeqD03cb037.YAMLMap {
|
7837
8666
|
constructor() {
|
7838
8667
|
super();
|
7839
8668
|
this.tag = YAMLSet.tag;
|
7840
8669
|
}
|
7841
8670
|
|
7842
8671
|
add(key) {
|
7843
|
-
const pair = key instanceof
|
7844
|
-
const prev =
|
8672
|
+
const pair = key instanceof resolveSeqD03cb037.Pair ? key : new resolveSeqD03cb037.Pair(key);
|
8673
|
+
const prev = resolveSeqD03cb037.findPair(this.items, pair.key);
|
7845
8674
|
if (!prev) this.items.push(pair);
|
7846
8675
|
}
|
7847
8676
|
|
7848
8677
|
get(key, keepPair) {
|
7849
|
-
const pair =
|
7850
|
-
return !keepPair && pair instanceof
|
8678
|
+
const pair = resolveSeqD03cb037.findPair(this.items, key);
|
8679
|
+
return !keepPair && pair instanceof resolveSeqD03cb037.Pair ? pair.key instanceof resolveSeqD03cb037.Scalar ? pair.key.value : pair.key : pair;
|
7851
8680
|
}
|
7852
8681
|
|
7853
8682
|
set(key, value) {
|
7854
8683
|
if (typeof value !== 'boolean') throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
|
7855
|
-
const prev =
|
8684
|
+
const prev = resolveSeqD03cb037.findPair(this.items, key);
|
7856
8685
|
|
7857
8686
|
if (prev && !value) {
|
7858
8687
|
this.items.splice(this.items.indexOf(prev), 1);
|
7859
8688
|
} else if (!prev && value) {
|
7860
|
-
this.items.push(new
|
8689
|
+
this.items.push(new resolveSeqD03cb037.Pair(key));
|
7861
8690
|
}
|
7862
8691
|
}
|
7863
8692
|
|
@@ -7875,7 +8704,7 @@ class YAMLSet extends resolveSeq4a68b39b.YAMLMap {
|
|
7875
8704
|
PlainValueEc8e588e._defineProperty(YAMLSet, "tag", 'tag:yaml.org,2002:set');
|
7876
8705
|
|
7877
8706
|
function parseSet(doc, cst) {
|
7878
|
-
const map =
|
8707
|
+
const map = resolveSeqD03cb037.resolveMap(doc, cst);
|
7879
8708
|
if (!map.hasAllNullValues()) throw new PlainValueEc8e588e.YAMLSemanticError(cst, 'Set items must all have null values');
|
7880
8709
|
return Object.assign(new YAMLSet(), map);
|
7881
8710
|
}
|
@@ -7906,7 +8735,7 @@ const parseSexagesimal = (sign, parts) => {
|
|
7906
8735
|
const stringifySexagesimal = ({
|
7907
8736
|
value
|
7908
8737
|
}) => {
|
7909
|
-
if (isNaN(value) || !isFinite(value)) return
|
8738
|
+
if (isNaN(value) || !isFinite(value)) return resolveSeqD03cb037.stringifyNumber(value);
|
7910
8739
|
let sign = '';
|
7911
8740
|
|
7912
8741
|
if (value < 0) {
|
@@ -8032,7 +8861,7 @@ var timestamp_1 = timestamp;
|
|
8032
8861
|
var warn_1 = warn;
|
8033
8862
|
var warnFileDeprecation_1 = warnFileDeprecation;
|
8034
8863
|
var warnOptionDeprecation_1 = warnOptionDeprecation;
|
8035
|
-
var
|
8864
|
+
var warnings1000a372 = {
|
8036
8865
|
binary: binary_1,
|
8037
8866
|
floatTime: floatTime_1,
|
8038
8867
|
intTime: intTime_1,
|
@@ -8046,7 +8875,7 @@ var warnings39684f17 = {
|
|
8046
8875
|
};
|
8047
8876
|
|
8048
8877
|
function createMap(schema, obj, ctx) {
|
8049
|
-
const map = new
|
8878
|
+
const map = new resolveSeqD03cb037.YAMLMap(schema);
|
8050
8879
|
|
8051
8880
|
if (obj instanceof Map) {
|
8052
8881
|
for (const [key, value] of obj) map.items.push(schema.createPair(key, value, ctx));
|
@@ -8064,13 +8893,13 @@ function createMap(schema, obj, ctx) {
|
|
8064
8893
|
const map = {
|
8065
8894
|
createNode: createMap,
|
8066
8895
|
default: true,
|
8067
|
-
nodeClass:
|
8896
|
+
nodeClass: resolveSeqD03cb037.YAMLMap,
|
8068
8897
|
tag: 'tag:yaml.org,2002:map',
|
8069
|
-
resolve:
|
8898
|
+
resolve: resolveSeqD03cb037.resolveMap
|
8070
8899
|
};
|
8071
8900
|
|
8072
8901
|
function createSeq(schema, obj, ctx) {
|
8073
|
-
const seq = new
|
8902
|
+
const seq = new resolveSeqD03cb037.YAMLSeq(schema);
|
8074
8903
|
|
8075
8904
|
if (obj && obj[Symbol.iterator]) {
|
8076
8905
|
for (const it of obj) {
|
@@ -8085,49 +8914,49 @@ function createSeq(schema, obj, ctx) {
|
|
8085
8914
|
const seq = {
|
8086
8915
|
createNode: createSeq,
|
8087
8916
|
default: true,
|
8088
|
-
nodeClass:
|
8917
|
+
nodeClass: resolveSeqD03cb037.YAMLSeq,
|
8089
8918
|
tag: 'tag:yaml.org,2002:seq',
|
8090
|
-
resolve:
|
8919
|
+
resolve: resolveSeqD03cb037.resolveSeq
|
8091
8920
|
};
|
8092
8921
|
const string = {
|
8093
8922
|
identify: value => typeof value === 'string',
|
8094
8923
|
default: true,
|
8095
8924
|
tag: 'tag:yaml.org,2002:str',
|
8096
|
-
resolve:
|
8925
|
+
resolve: resolveSeqD03cb037.resolveString,
|
8097
8926
|
|
8098
8927
|
stringify(item, ctx, onComment, onChompKeep) {
|
8099
8928
|
ctx = Object.assign({
|
8100
8929
|
actualString: true
|
8101
8930
|
}, ctx);
|
8102
|
-
return
|
8931
|
+
return resolveSeqD03cb037.stringifyString(item, ctx, onComment, onChompKeep);
|
8103
8932
|
},
|
8104
8933
|
|
8105
|
-
options:
|
8934
|
+
options: resolveSeqD03cb037.strOptions
|
8106
8935
|
};
|
8107
8936
|
const failsafe = [map, seq, string];
|
8108
8937
|
/* global BigInt */
|
8109
8938
|
|
8110
|
-
const intIdentify = value => typeof value === 'bigint' || Number.isInteger(value);
|
8939
|
+
const intIdentify$2 = value => typeof value === 'bigint' || Number.isInteger(value);
|
8111
8940
|
|
8112
|
-
const intResolve = (src, part, radix) =>
|
8941
|
+
const intResolve$1 = (src, part, radix) => resolveSeqD03cb037.intOptions.asBigInt ? BigInt(src) : parseInt(part, radix);
|
8113
8942
|
|
8114
|
-
function intStringify(node, radix, prefix) {
|
8943
|
+
function intStringify$1(node, radix, prefix) {
|
8115
8944
|
const {
|
8116
8945
|
value
|
8117
8946
|
} = node;
|
8118
|
-
if (intIdentify(value) && value >= 0) return prefix + value.toString(radix);
|
8119
|
-
return
|
8947
|
+
if (intIdentify$2(value) && value >= 0) return prefix + value.toString(radix);
|
8948
|
+
return resolveSeqD03cb037.stringifyNumber(node);
|
8120
8949
|
}
|
8121
8950
|
|
8122
8951
|
const nullObj = {
|
8123
8952
|
identify: value => value == null,
|
8124
|
-
createNode: (schema, value, ctx) => ctx.wrapScalars ? new
|
8953
|
+
createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeqD03cb037.Scalar(null) : null,
|
8125
8954
|
default: true,
|
8126
8955
|
tag: 'tag:yaml.org,2002:null',
|
8127
8956
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
8128
8957
|
resolve: () => null,
|
8129
|
-
options:
|
8130
|
-
stringify: () =>
|
8958
|
+
options: resolveSeqD03cb037.nullOptions,
|
8959
|
+
stringify: () => resolveSeqD03cb037.nullOptions.nullStr
|
8131
8960
|
};
|
8132
8961
|
const boolObj = {
|
8133
8962
|
identify: value => typeof value === 'boolean',
|
@@ -8135,39 +8964,39 @@ const boolObj = {
|
|
8135
8964
|
tag: 'tag:yaml.org,2002:bool',
|
8136
8965
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
8137
8966
|
resolve: str => str[0] === 't' || str[0] === 'T',
|
8138
|
-
options:
|
8967
|
+
options: resolveSeqD03cb037.boolOptions,
|
8139
8968
|
stringify: ({
|
8140
8969
|
value
|
8141
|
-
}) => value ?
|
8970
|
+
}) => value ? resolveSeqD03cb037.boolOptions.trueStr : resolveSeqD03cb037.boolOptions.falseStr
|
8142
8971
|
};
|
8143
8972
|
const octObj = {
|
8144
|
-
identify: value => intIdentify(value) && value >= 0,
|
8973
|
+
identify: value => intIdentify$2(value) && value >= 0,
|
8145
8974
|
default: true,
|
8146
8975
|
tag: 'tag:yaml.org,2002:int',
|
8147
8976
|
format: 'OCT',
|
8148
8977
|
test: /^0o([0-7]+)$/,
|
8149
|
-
resolve: (str, oct) => intResolve(str, oct, 8),
|
8150
|
-
options:
|
8151
|
-
stringify: node => intStringify(node, 8, '0o')
|
8978
|
+
resolve: (str, oct) => intResolve$1(str, oct, 8),
|
8979
|
+
options: resolveSeqD03cb037.intOptions,
|
8980
|
+
stringify: node => intStringify$1(node, 8, '0o')
|
8152
8981
|
};
|
8153
8982
|
const intObj = {
|
8154
|
-
identify: intIdentify,
|
8983
|
+
identify: intIdentify$2,
|
8155
8984
|
default: true,
|
8156
8985
|
tag: 'tag:yaml.org,2002:int',
|
8157
8986
|
test: /^[-+]?[0-9]+$/,
|
8158
|
-
resolve: str => intResolve(str, str, 10),
|
8159
|
-
options:
|
8160
|
-
stringify:
|
8987
|
+
resolve: str => intResolve$1(str, str, 10),
|
8988
|
+
options: resolveSeqD03cb037.intOptions,
|
8989
|
+
stringify: resolveSeqD03cb037.stringifyNumber
|
8161
8990
|
};
|
8162
8991
|
const hexObj = {
|
8163
|
-
identify: value => intIdentify(value) && value >= 0,
|
8992
|
+
identify: value => intIdentify$2(value) && value >= 0,
|
8164
8993
|
default: true,
|
8165
8994
|
tag: 'tag:yaml.org,2002:int',
|
8166
8995
|
format: 'HEX',
|
8167
8996
|
test: /^0x([0-9a-fA-F]+)$/,
|
8168
|
-
resolve: (str, hex) => intResolve(str, hex, 16),
|
8169
|
-
options:
|
8170
|
-
stringify: node => intStringify(node, 16, '0x')
|
8997
|
+
resolve: (str, hex) => intResolve$1(str, hex, 16),
|
8998
|
+
options: resolveSeqD03cb037.intOptions,
|
8999
|
+
stringify: node => intStringify$1(node, 16, '0x')
|
8171
9000
|
};
|
8172
9001
|
const nanObj = {
|
8173
9002
|
identify: value => typeof value === 'number',
|
@@ -8175,7 +9004,7 @@ const nanObj = {
|
|
8175
9004
|
tag: 'tag:yaml.org,2002:float',
|
8176
9005
|
test: /^(?:[-+]?\.inf|(\.nan))$/i,
|
8177
9006
|
resolve: (str, nan) => nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
8178
|
-
stringify:
|
9007
|
+
stringify: resolveSeqD03cb037.stringifyNumber
|
8179
9008
|
};
|
8180
9009
|
const expObj = {
|
8181
9010
|
identify: value => typeof value === 'number',
|
@@ -8196,12 +9025,12 @@ const floatObj = {
|
|
8196
9025
|
|
8197
9026
|
resolve(str, frac1, frac2) {
|
8198
9027
|
const frac = frac1 || frac2;
|
8199
|
-
const node = new
|
9028
|
+
const node = new resolveSeqD03cb037.Scalar(parseFloat(str));
|
8200
9029
|
if (frac && frac[frac.length - 1] === '0') node.minFractionDigits = frac.length;
|
8201
9030
|
return node;
|
8202
9031
|
},
|
8203
9032
|
|
8204
|
-
stringify:
|
9033
|
+
stringify: resolveSeqD03cb037.stringifyNumber
|
8205
9034
|
};
|
8206
9035
|
const core = failsafe.concat([nullObj, boolObj, octObj, intObj, hexObj, nanObj, expObj, floatObj]);
|
8207
9036
|
/* global BigInt */
|
@@ -8216,11 +9045,11 @@ const json = [map, seq, {
|
|
8216
9045
|
identify: value => typeof value === 'string',
|
8217
9046
|
default: true,
|
8218
9047
|
tag: 'tag:yaml.org,2002:str',
|
8219
|
-
resolve:
|
9048
|
+
resolve: resolveSeqD03cb037.resolveString,
|
8220
9049
|
stringify: stringifyJSON
|
8221
9050
|
}, {
|
8222
9051
|
identify: value => value == null,
|
8223
|
-
createNode: (schema, value, ctx) => ctx.wrapScalars ? new
|
9052
|
+
createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeqD03cb037.Scalar(null) : null,
|
8224
9053
|
default: true,
|
8225
9054
|
tag: 'tag:yaml.org,2002:null',
|
8226
9055
|
test: /^null$/,
|
@@ -8238,7 +9067,7 @@ const json = [map, seq, {
|
|
8238
9067
|
default: true,
|
8239
9068
|
tag: 'tag:yaml.org,2002:int',
|
8240
9069
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
8241
|
-
resolve: str =>
|
9070
|
+
resolve: str => resolveSeqD03cb037.intOptions.asBigInt ? BigInt(str) : parseInt(str, 10),
|
8242
9071
|
stringify: ({
|
8243
9072
|
value
|
8244
9073
|
}) => intIdentify$1(value) ? value.toString() : JSON.stringify(value)
|
@@ -8259,14 +9088,14 @@ json.scalarFallback = str => {
|
|
8259
9088
|
|
8260
9089
|
const boolStringify = ({
|
8261
9090
|
value
|
8262
|
-
}) => value ?
|
9091
|
+
}) => value ? resolveSeqD03cb037.boolOptions.trueStr : resolveSeqD03cb037.boolOptions.falseStr;
|
8263
9092
|
|
8264
|
-
const intIdentify
|
9093
|
+
const intIdentify = value => typeof value === 'bigint' || Number.isInteger(value);
|
8265
9094
|
|
8266
|
-
function intResolve
|
9095
|
+
function intResolve(sign, src, radix) {
|
8267
9096
|
let str = src.replace(/_/g, '');
|
8268
9097
|
|
8269
|
-
if (
|
9098
|
+
if (resolveSeqD03cb037.intOptions.asBigInt) {
|
8270
9099
|
switch (radix) {
|
8271
9100
|
case 2:
|
8272
9101
|
str = `0b${str}`;
|
@@ -8289,35 +9118,35 @@ function intResolve$1(sign, src, radix) {
|
|
8289
9118
|
return sign === '-' ? -1 * n : n;
|
8290
9119
|
}
|
8291
9120
|
|
8292
|
-
function intStringify
|
9121
|
+
function intStringify(node, radix, prefix) {
|
8293
9122
|
const {
|
8294
9123
|
value
|
8295
9124
|
} = node;
|
8296
9125
|
|
8297
|
-
if (intIdentify
|
9126
|
+
if (intIdentify(value)) {
|
8298
9127
|
const str = value.toString(radix);
|
8299
9128
|
return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;
|
8300
9129
|
}
|
8301
9130
|
|
8302
|
-
return
|
9131
|
+
return resolveSeqD03cb037.stringifyNumber(node);
|
8303
9132
|
}
|
8304
9133
|
|
8305
9134
|
const yaml11 = failsafe.concat([{
|
8306
9135
|
identify: value => value == null,
|
8307
|
-
createNode: (schema, value, ctx) => ctx.wrapScalars ? new
|
9136
|
+
createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeqD03cb037.Scalar(null) : null,
|
8308
9137
|
default: true,
|
8309
9138
|
tag: 'tag:yaml.org,2002:null',
|
8310
9139
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
8311
9140
|
resolve: () => null,
|
8312
|
-
options:
|
8313
|
-
stringify: () =>
|
9141
|
+
options: resolveSeqD03cb037.nullOptions,
|
9142
|
+
stringify: () => resolveSeqD03cb037.nullOptions.nullStr
|
8314
9143
|
}, {
|
8315
9144
|
identify: value => typeof value === 'boolean',
|
8316
9145
|
default: true,
|
8317
9146
|
tag: 'tag:yaml.org,2002:bool',
|
8318
9147
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
8319
9148
|
resolve: () => true,
|
8320
|
-
options:
|
9149
|
+
options: resolveSeqD03cb037.boolOptions,
|
8321
9150
|
stringify: boolStringify
|
8322
9151
|
}, {
|
8323
9152
|
identify: value => typeof value === 'boolean',
|
@@ -8325,46 +9154,46 @@ const yaml11 = failsafe.concat([{
|
|
8325
9154
|
tag: 'tag:yaml.org,2002:bool',
|
8326
9155
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,
|
8327
9156
|
resolve: () => false,
|
8328
|
-
options:
|
9157
|
+
options: resolveSeqD03cb037.boolOptions,
|
8329
9158
|
stringify: boolStringify
|
8330
9159
|
}, {
|
8331
|
-
identify: intIdentify
|
9160
|
+
identify: intIdentify,
|
8332
9161
|
default: true,
|
8333
9162
|
tag: 'tag:yaml.org,2002:int',
|
8334
9163
|
format: 'BIN',
|
8335
9164
|
test: /^([-+]?)0b([0-1_]+)$/,
|
8336
|
-
resolve: (str, sign, bin) => intResolve
|
8337
|
-
stringify: node => intStringify
|
9165
|
+
resolve: (str, sign, bin) => intResolve(sign, bin, 2),
|
9166
|
+
stringify: node => intStringify(node, 2, '0b')
|
8338
9167
|
}, {
|
8339
|
-
identify: intIdentify
|
9168
|
+
identify: intIdentify,
|
8340
9169
|
default: true,
|
8341
9170
|
tag: 'tag:yaml.org,2002:int',
|
8342
9171
|
format: 'OCT',
|
8343
9172
|
test: /^([-+]?)0([0-7_]+)$/,
|
8344
|
-
resolve: (str, sign, oct) => intResolve
|
8345
|
-
stringify: node => intStringify
|
9173
|
+
resolve: (str, sign, oct) => intResolve(sign, oct, 8),
|
9174
|
+
stringify: node => intStringify(node, 8, '0')
|
8346
9175
|
}, {
|
8347
|
-
identify: intIdentify
|
9176
|
+
identify: intIdentify,
|
8348
9177
|
default: true,
|
8349
9178
|
tag: 'tag:yaml.org,2002:int',
|
8350
9179
|
test: /^([-+]?)([0-9][0-9_]*)$/,
|
8351
|
-
resolve: (str, sign, abs) => intResolve
|
8352
|
-
stringify:
|
9180
|
+
resolve: (str, sign, abs) => intResolve(sign, abs, 10),
|
9181
|
+
stringify: resolveSeqD03cb037.stringifyNumber
|
8353
9182
|
}, {
|
8354
|
-
identify: intIdentify
|
9183
|
+
identify: intIdentify,
|
8355
9184
|
default: true,
|
8356
9185
|
tag: 'tag:yaml.org,2002:int',
|
8357
9186
|
format: 'HEX',
|
8358
9187
|
test: /^([-+]?)0x([0-9a-fA-F_]+)$/,
|
8359
|
-
resolve: (str, sign, hex) => intResolve
|
8360
|
-
stringify: node => intStringify
|
9188
|
+
resolve: (str, sign, hex) => intResolve(sign, hex, 16),
|
9189
|
+
stringify: node => intStringify(node, 16, '0x')
|
8361
9190
|
}, {
|
8362
9191
|
identify: value => typeof value === 'number',
|
8363
9192
|
default: true,
|
8364
9193
|
tag: 'tag:yaml.org,2002:float',
|
8365
9194
|
test: /^(?:[-+]?\.inf|(\.nan))$/i,
|
8366
9195
|
resolve: (str, nan) => nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
8367
|
-
stringify:
|
9196
|
+
stringify: resolveSeqD03cb037.stringifyNumber
|
8368
9197
|
}, {
|
8369
9198
|
identify: value => typeof value === 'number',
|
8370
9199
|
default: true,
|
@@ -8382,7 +9211,7 @@ const yaml11 = failsafe.concat([{
|
|
8382
9211
|
test: /^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,
|
8383
9212
|
|
8384
9213
|
resolve(str, frac) {
|
8385
|
-
const node = new
|
9214
|
+
const node = new resolveSeqD03cb037.Scalar(parseFloat(str.replace(/_/g, '')));
|
8386
9215
|
|
8387
9216
|
if (frac) {
|
8388
9217
|
const f = frac.replace(/_/g, '');
|
@@ -8392,8 +9221,8 @@ const yaml11 = failsafe.concat([{
|
|
8392
9221
|
return node;
|
8393
9222
|
},
|
8394
9223
|
|
8395
|
-
stringify:
|
8396
|
-
}],
|
9224
|
+
stringify: resolveSeqD03cb037.stringifyNumber
|
9225
|
+
}], warnings1000a372.binary, warnings1000a372.omap, warnings1000a372.pairs, warnings1000a372.set, warnings1000a372.intTime, warnings1000a372.floatTime, warnings1000a372.timestamp);
|
8397
9226
|
const schemas = {
|
8398
9227
|
core,
|
8399
9228
|
failsafe,
|
@@ -8401,23 +9230,23 @@ const schemas = {
|
|
8401
9230
|
yaml11
|
8402
9231
|
};
|
8403
9232
|
const tags = {
|
8404
|
-
binary:
|
9233
|
+
binary: warnings1000a372.binary,
|
8405
9234
|
bool: boolObj,
|
8406
9235
|
float: floatObj,
|
8407
9236
|
floatExp: expObj,
|
8408
9237
|
floatNaN: nanObj,
|
8409
|
-
floatTime:
|
9238
|
+
floatTime: warnings1000a372.floatTime,
|
8410
9239
|
int: intObj,
|
8411
9240
|
intHex: hexObj,
|
8412
9241
|
intOct: octObj,
|
8413
|
-
intTime:
|
9242
|
+
intTime: warnings1000a372.intTime,
|
8414
9243
|
map,
|
8415
9244
|
null: nullObj,
|
8416
|
-
omap:
|
8417
|
-
pairs:
|
9245
|
+
omap: warnings1000a372.omap,
|
9246
|
+
pairs: warnings1000a372.pairs,
|
8418
9247
|
seq,
|
8419
|
-
set:
|
8420
|
-
timestamp:
|
9248
|
+
set: warnings1000a372.set,
|
9249
|
+
timestamp: warnings1000a372.timestamp
|
8421
9250
|
};
|
8422
9251
|
|
8423
9252
|
function findTagObject(value, tagName, tags) {
|
@@ -8432,8 +9261,8 @@ function findTagObject(value, tagName, tags) {
|
|
8432
9261
|
return tags.find(t => (t.identify && t.identify(value) || t.class && value instanceof t.class) && !t.format);
|
8433
9262
|
}
|
8434
9263
|
|
8435
|
-
function createNode(value, tagName, ctx) {
|
8436
|
-
if (value instanceof
|
9264
|
+
function createNode$1(value, tagName, ctx) {
|
9265
|
+
if (value instanceof resolveSeqD03cb037.Node) return value;
|
8437
9266
|
const {
|
8438
9267
|
defaultPrefix,
|
8439
9268
|
onTagObj,
|
@@ -8446,7 +9275,7 @@ function createNode(value, tagName, ctx) {
|
|
8446
9275
|
|
8447
9276
|
if (!tagObj) {
|
8448
9277
|
if (typeof value.toJSON === 'function') value = value.toJSON();
|
8449
|
-
if (typeof value !== 'object') return wrapScalars ? new
|
9278
|
+
if (!value || typeof value !== 'object') return wrapScalars ? new resolveSeqD03cb037.Scalar(value) : value;
|
8450
9279
|
tagObj = value instanceof Map ? map : value[Symbol.iterator] ? seq : map;
|
8451
9280
|
}
|
8452
9281
|
|
@@ -8457,13 +9286,16 @@ function createNode(value, tagName, ctx) {
|
|
8457
9286
|
// after first. The `obj` wrapper allows for circular references to resolve.
|
8458
9287
|
|
8459
9288
|
|
8460
|
-
const obj = {
|
9289
|
+
const obj = {
|
9290
|
+
value: undefined,
|
9291
|
+
node: undefined
|
9292
|
+
};
|
8461
9293
|
|
8462
9294
|
if (value && typeof value === 'object' && prevObjects) {
|
8463
9295
|
const prev = prevObjects.get(value);
|
8464
9296
|
|
8465
9297
|
if (prev) {
|
8466
|
-
const alias = new
|
9298
|
+
const alias = new resolveSeqD03cb037.Alias(prev); // leaves source dirty; must be cleaned by caller
|
8467
9299
|
|
8468
9300
|
ctx.aliasNodes.push(alias); // defined along with prevObjects
|
8469
9301
|
|
@@ -8474,8 +9306,8 @@ function createNode(value, tagName, ctx) {
|
|
8474
9306
|
prevObjects.set(value, obj);
|
8475
9307
|
}
|
8476
9308
|
|
8477
|
-
obj.node = tagObj.createNode ? tagObj.createNode(ctx.schema, value, ctx) : wrapScalars ? new
|
8478
|
-
if (tagName && obj.node instanceof
|
9309
|
+
obj.node = tagObj.createNode ? tagObj.createNode(ctx.schema, value, ctx) : wrapScalars ? new resolveSeqD03cb037.Scalar(value) : value;
|
9310
|
+
if (tagName && obj.node instanceof resolveSeqD03cb037.Node) obj.node.tag = tagName;
|
8479
9311
|
return obj.node;
|
8480
9312
|
}
|
8481
9313
|
|
@@ -8526,7 +9358,7 @@ class Schema {
|
|
8526
9358
|
this.merge = !!merge;
|
8527
9359
|
this.name = schema;
|
8528
9360
|
this.sortMapEntries = sortMapEntries === true ? sortMapEntriesByKey : sortMapEntries || null;
|
8529
|
-
if (!customTags && deprecatedCustomTags)
|
9361
|
+
if (!customTags && deprecatedCustomTags) warnings1000a372.warnOptionDeprecation('tags', 'customTags');
|
8530
9362
|
this.tags = getSchemaTags(schemas, tags, customTags || deprecatedCustomTags, schema);
|
8531
9363
|
}
|
8532
9364
|
|
@@ -8537,7 +9369,7 @@ class Schema {
|
|
8537
9369
|
wrapScalars
|
8538
9370
|
};
|
8539
9371
|
const createCtx = ctx ? Object.assign(ctx, baseCtx) : baseCtx;
|
8540
|
-
return createNode(value, tagName, createCtx);
|
9372
|
+
return createNode$1(value, tagName, createCtx);
|
8541
9373
|
}
|
8542
9374
|
|
8543
9375
|
createPair(key, value, ctx) {
|
@@ -8546,7 +9378,7 @@ class Schema {
|
|
8546
9378
|
};
|
8547
9379
|
const k = this.createNode(key, ctx.wrapScalars, null, ctx);
|
8548
9380
|
const v = this.createNode(value, ctx.wrapScalars, null, ctx);
|
8549
|
-
return new
|
9381
|
+
return new resolveSeqD03cb037.Pair(k, v);
|
8550
9382
|
}
|
8551
9383
|
|
8552
9384
|
}
|
@@ -8556,7 +9388,7 @@ PlainValueEc8e588e._defineProperty(Schema, "defaultPrefix", PlainValueEc8e588e.d
|
|
8556
9388
|
PlainValueEc8e588e._defineProperty(Schema, "defaultTags", PlainValueEc8e588e.defaultTags);
|
8557
9389
|
|
8558
9390
|
var Schema_1 = Schema;
|
8559
|
-
var
|
9391
|
+
var Schema88e323a7 = {
|
8560
9392
|
Schema: Schema_1
|
8561
9393
|
};
|
8562
9394
|
|
@@ -8577,43 +9409,43 @@ const defaultOptions = {
|
|
8577
9409
|
};
|
8578
9410
|
const scalarOptions = {
|
8579
9411
|
get binary() {
|
8580
|
-
return
|
9412
|
+
return resolveSeqD03cb037.binaryOptions;
|
8581
9413
|
},
|
8582
9414
|
|
8583
9415
|
set binary(opt) {
|
8584
|
-
Object.assign(
|
9416
|
+
Object.assign(resolveSeqD03cb037.binaryOptions, opt);
|
8585
9417
|
},
|
8586
9418
|
|
8587
9419
|
get bool() {
|
8588
|
-
return
|
9420
|
+
return resolveSeqD03cb037.boolOptions;
|
8589
9421
|
},
|
8590
9422
|
|
8591
9423
|
set bool(opt) {
|
8592
|
-
Object.assign(
|
9424
|
+
Object.assign(resolveSeqD03cb037.boolOptions, opt);
|
8593
9425
|
},
|
8594
9426
|
|
8595
9427
|
get int() {
|
8596
|
-
return
|
9428
|
+
return resolveSeqD03cb037.intOptions;
|
8597
9429
|
},
|
8598
9430
|
|
8599
9431
|
set int(opt) {
|
8600
|
-
Object.assign(
|
9432
|
+
Object.assign(resolveSeqD03cb037.intOptions, opt);
|
8601
9433
|
},
|
8602
9434
|
|
8603
9435
|
get null() {
|
8604
|
-
return
|
9436
|
+
return resolveSeqD03cb037.nullOptions;
|
8605
9437
|
},
|
8606
9438
|
|
8607
9439
|
set null(opt) {
|
8608
|
-
Object.assign(
|
9440
|
+
Object.assign(resolveSeqD03cb037.nullOptions, opt);
|
8609
9441
|
},
|
8610
9442
|
|
8611
9443
|
get str() {
|
8612
|
-
return
|
9444
|
+
return resolveSeqD03cb037.strOptions;
|
8613
9445
|
},
|
8614
9446
|
|
8615
9447
|
set str(opt) {
|
8616
|
-
Object.assign(
|
9448
|
+
Object.assign(resolveSeqD03cb037.strOptions, opt);
|
8617
9449
|
}
|
8618
9450
|
|
8619
9451
|
};
|
@@ -8629,7 +9461,7 @@ const documentOptions = {
|
|
8629
9461
|
prefix: 'tag:private.yaml.org,2002:'
|
8630
9462
|
}]
|
8631
9463
|
},
|
8632
|
-
|
9464
|
+
1.1: {
|
8633
9465
|
schema: 'yaml-1.1',
|
8634
9466
|
merge: true,
|
8635
9467
|
tagPrefixes: [{
|
@@ -8640,7 +9472,7 @@ const documentOptions = {
|
|
8640
9472
|
prefix: PlainValueEc8e588e.defaultTagPrefix
|
8641
9473
|
}]
|
8642
9474
|
},
|
8643
|
-
|
9475
|
+
1.2: {
|
8644
9476
|
schema: 'core',
|
8645
9477
|
merge: false,
|
8646
9478
|
tagPrefixes: [{
|
@@ -8681,7 +9513,7 @@ function stringifyTag(doc, tag) {
|
|
8681
9513
|
}
|
8682
9514
|
|
8683
9515
|
function getTagObject(tags, item) {
|
8684
|
-
if (item instanceof
|
9516
|
+
if (item instanceof resolveSeqD03cb037.Alias) return resolveSeqD03cb037.Alias;
|
8685
9517
|
|
8686
9518
|
if (item.tag) {
|
8687
9519
|
const match = tags.filter(t => t.tag === item.tag);
|
@@ -8690,7 +9522,7 @@ function getTagObject(tags, item) {
|
|
8690
9522
|
|
8691
9523
|
let tagObj, obj;
|
8692
9524
|
|
8693
|
-
if (item instanceof
|
9525
|
+
if (item instanceof resolveSeqD03cb037.Scalar) {
|
8694
9526
|
obj = item.value; // TODO: deprecate/remove class check
|
8695
9527
|
|
8696
9528
|
const match = tags.filter(t => t.identify && t.identify(obj) || t.class && obj instanceof t.class);
|
@@ -8730,14 +9562,14 @@ function stringifyProps(node, tagObj, {
|
|
8730
9562
|
return props.join(' ');
|
8731
9563
|
}
|
8732
9564
|
|
8733
|
-
function stringify(item, ctx, onComment, onChompKeep) {
|
9565
|
+
function stringify$1(item, ctx, onComment, onChompKeep) {
|
8734
9566
|
const {
|
8735
9567
|
anchors,
|
8736
9568
|
schema
|
8737
9569
|
} = ctx.doc;
|
8738
9570
|
let tagObj;
|
8739
9571
|
|
8740
|
-
if (!(item instanceof
|
9572
|
+
if (!(item instanceof resolveSeqD03cb037.Node)) {
|
8741
9573
|
const createCtx = {
|
8742
9574
|
aliasNodes: [],
|
8743
9575
|
onTagObj: o => tagObj = o,
|
@@ -8756,37 +9588,37 @@ function stringify(item, ctx, onComment, onChompKeep) {
|
|
8756
9588
|
}
|
8757
9589
|
}
|
8758
9590
|
|
8759
|
-
if (item instanceof
|
9591
|
+
if (item instanceof resolveSeqD03cb037.Pair) return item.toString(ctx, onComment, onChompKeep);
|
8760
9592
|
if (!tagObj) tagObj = getTagObject(schema.tags, item);
|
8761
9593
|
const props = stringifyProps(item, tagObj, ctx);
|
8762
9594
|
if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart || 0) + props.length + 1;
|
8763
|
-
const str = typeof tagObj.stringify === 'function' ? tagObj.stringify(item, ctx, onComment, onChompKeep) : item instanceof
|
9595
|
+
const str = typeof tagObj.stringify === 'function' ? tagObj.stringify(item, ctx, onComment, onChompKeep) : item instanceof resolveSeqD03cb037.Scalar ? resolveSeqD03cb037.stringifyString(item, ctx, onComment, onChompKeep) : item.toString(ctx, onComment, onChompKeep);
|
8764
9596
|
if (!props) return str;
|
8765
|
-
return item instanceof
|
9597
|
+
return item instanceof resolveSeqD03cb037.Scalar || str[0] === '{' || str[0] === '[' ? `${props} ${str}` : `${props}\n${ctx.indent}${str}`;
|
8766
9598
|
}
|
8767
9599
|
|
8768
9600
|
class Anchors {
|
8769
9601
|
static validAnchorNode(node) {
|
8770
|
-
return node instanceof
|
9602
|
+
return node instanceof resolveSeqD03cb037.Scalar || node instanceof resolveSeqD03cb037.YAMLSeq || node instanceof resolveSeqD03cb037.YAMLMap;
|
8771
9603
|
}
|
8772
9604
|
|
8773
9605
|
constructor(prefix) {
|
8774
|
-
PlainValueEc8e588e._defineProperty(this, "map",
|
9606
|
+
PlainValueEc8e588e._defineProperty(this, "map", Object.create(null));
|
8775
9607
|
|
8776
9608
|
this.prefix = prefix;
|
8777
9609
|
}
|
8778
9610
|
|
8779
9611
|
createAlias(node, name) {
|
8780
9612
|
this.setAnchor(node, name);
|
8781
|
-
return new
|
9613
|
+
return new resolveSeqD03cb037.Alias(node);
|
8782
9614
|
}
|
8783
9615
|
|
8784
9616
|
createMergePair(...sources) {
|
8785
|
-
const merge = new
|
9617
|
+
const merge = new resolveSeqD03cb037.Merge();
|
8786
9618
|
merge.value.items = sources.map(s => {
|
8787
|
-
if (s instanceof
|
8788
|
-
if (s.source instanceof
|
8789
|
-
} else if (s instanceof
|
9619
|
+
if (s instanceof resolveSeqD03cb037.Alias) {
|
9620
|
+
if (s.source instanceof resolveSeqD03cb037.YAMLMap) return s;
|
9621
|
+
} else if (s instanceof resolveSeqD03cb037.YAMLMap) {
|
8790
9622
|
return this.createAlias(s);
|
8791
9623
|
}
|
8792
9624
|
|
@@ -8878,13 +9710,13 @@ const visit = (node, tags) => {
|
|
8878
9710
|
tag
|
8879
9711
|
} = node;
|
8880
9712
|
|
8881
|
-
if (node instanceof
|
9713
|
+
if (node instanceof resolveSeqD03cb037.Collection) {
|
8882
9714
|
if (tag) tags[tag] = true;
|
8883
9715
|
node.items.forEach(n => visit(n, tags));
|
8884
|
-
} else if (node instanceof
|
9716
|
+
} else if (node instanceof resolveSeqD03cb037.Pair) {
|
8885
9717
|
visit(node.key, tags);
|
8886
9718
|
visit(node.value, tags);
|
8887
|
-
} else if (node instanceof
|
9719
|
+
} else if (node instanceof resolveSeqD03cb037.Scalar) {
|
8888
9720
|
if (tag) tags[tag] = true;
|
8889
9721
|
}
|
8890
9722
|
}
|
@@ -8910,7 +9742,7 @@ function parseContents(doc, contents) {
|
|
8910
9742
|
break;
|
8911
9743
|
}
|
8912
9744
|
|
8913
|
-
const res =
|
9745
|
+
const res = resolveSeqD03cb037.resolveNode(doc, node);
|
8914
9746
|
|
8915
9747
|
if (spaceBefore) {
|
8916
9748
|
res.spaceBefore = true;
|
@@ -8940,7 +9772,7 @@ function parseContents(doc, contents) {
|
|
8940
9772
|
const cb = comments.before.join('\n');
|
8941
9773
|
|
8942
9774
|
if (cb) {
|
8943
|
-
const cbNode = body instanceof
|
9775
|
+
const cbNode = body instanceof resolveSeqD03cb037.Collection && body.items[0] ? body.items[0] : body;
|
8944
9776
|
cbNode.commentBefore = cbNode.commentBefore ? `${cb}\n${cbNode.commentBefore}` : cb;
|
8945
9777
|
}
|
8946
9778
|
|
@@ -9052,7 +9884,7 @@ function parseDirectives(doc, directives, prevDoc) {
|
|
9052
9884
|
}
|
9053
9885
|
|
9054
9886
|
function assertCollection(contents) {
|
9055
|
-
if (contents instanceof
|
9887
|
+
if (contents instanceof resolveSeqD03cb037.Collection) return true;
|
9056
9888
|
throw new Error('Expected a YAML collection as document contents');
|
9057
9889
|
}
|
9058
9890
|
|
@@ -9087,7 +9919,7 @@ class Document$1 {
|
|
9087
9919
|
}
|
9088
9920
|
|
9089
9921
|
deleteIn(path) {
|
9090
|
-
if (
|
9922
|
+
if (resolveSeqD03cb037.isEmptyPath(path)) {
|
9091
9923
|
if (this.contents == null) return false;
|
9092
9924
|
this.contents = null;
|
9093
9925
|
return true;
|
@@ -9102,21 +9934,21 @@ class Document$1 {
|
|
9102
9934
|
}
|
9103
9935
|
|
9104
9936
|
get(key, keepScalar) {
|
9105
|
-
return this.contents instanceof
|
9937
|
+
return this.contents instanceof resolveSeqD03cb037.Collection ? this.contents.get(key, keepScalar) : undefined;
|
9106
9938
|
}
|
9107
9939
|
|
9108
9940
|
getIn(path, keepScalar) {
|
9109
|
-
if (
|
9110
|
-
return this.contents instanceof
|
9941
|
+
if (resolveSeqD03cb037.isEmptyPath(path)) return !keepScalar && this.contents instanceof resolveSeqD03cb037.Scalar ? this.contents.value : this.contents;
|
9942
|
+
return this.contents instanceof resolveSeqD03cb037.Collection ? this.contents.getIn(path, keepScalar) : undefined;
|
9111
9943
|
}
|
9112
9944
|
|
9113
9945
|
has(key) {
|
9114
|
-
return this.contents instanceof
|
9946
|
+
return this.contents instanceof resolveSeqD03cb037.Collection ? this.contents.has(key) : false;
|
9115
9947
|
}
|
9116
9948
|
|
9117
9949
|
hasIn(path) {
|
9118
|
-
if (
|
9119
|
-
return this.contents instanceof
|
9950
|
+
if (resolveSeqD03cb037.isEmptyPath(path)) return this.contents !== undefined;
|
9951
|
+
return this.contents instanceof resolveSeqD03cb037.Collection ? this.contents.hasIn(path) : false;
|
9120
9952
|
}
|
9121
9953
|
|
9122
9954
|
set(key, value) {
|
@@ -9125,7 +9957,7 @@ class Document$1 {
|
|
9125
9957
|
}
|
9126
9958
|
|
9127
9959
|
setIn(path, value) {
|
9128
|
-
if (
|
9960
|
+
if (resolveSeqD03cb037.isEmptyPath(path)) this.contents = value;else {
|
9129
9961
|
assertCollection(this.contents);
|
9130
9962
|
this.contents.setIn(path, value);
|
9131
9963
|
}
|
@@ -9144,7 +9976,7 @@ class Document$1 {
|
|
9144
9976
|
|
9145
9977
|
if (Array.isArray(customTags)) this.options.customTags = customTags;
|
9146
9978
|
const opt = Object.assign({}, this.getDefaults(), this.options);
|
9147
|
-
this.schema = new
|
9979
|
+
this.schema = new Schema88e323a7.Schema(opt);
|
9148
9980
|
}
|
9149
9981
|
|
9150
9982
|
parse(node, prevDoc) {
|
@@ -9181,7 +10013,7 @@ class Document$1 {
|
|
9181
10013
|
}
|
9182
10014
|
|
9183
10015
|
listNonDefaultTags() {
|
9184
|
-
return listTagNames(this.contents).filter(t => t.indexOf(
|
10016
|
+
return listTagNames(this.contents).filter(t => t.indexOf(Schema88e323a7.Schema.defaultPrefix) !== 0);
|
9185
10017
|
}
|
9186
10018
|
|
9187
10019
|
setTagPrefix(handle, prefix) {
|
@@ -9204,14 +10036,14 @@ class Document$1 {
|
|
9204
10036
|
mapAsMap,
|
9205
10037
|
maxAliasCount
|
9206
10038
|
} = this.options;
|
9207
|
-
const keep = keepBlobsInJSON && (typeof arg !== 'string' || !(this.contents instanceof
|
10039
|
+
const keep = keepBlobsInJSON && (typeof arg !== 'string' || !(this.contents instanceof resolveSeqD03cb037.Scalar));
|
9208
10040
|
const ctx = {
|
9209
10041
|
doc: this,
|
9210
10042
|
indentStep: ' ',
|
9211
10043
|
keep,
|
9212
10044
|
mapAsMap: keep && !!mapAsMap,
|
9213
10045
|
maxAliasCount,
|
9214
|
-
stringify // Requiring directly in Pair would create circular dependencies
|
10046
|
+
stringify: stringify$1 // Requiring directly in Pair would create circular dependencies
|
9215
10047
|
|
9216
10048
|
};
|
9217
10049
|
const anchorNames = Object.keys(this.anchors.map);
|
@@ -9220,7 +10052,7 @@ class Document$1 {
|
|
9220
10052
|
aliasCount: 0,
|
9221
10053
|
count: 1
|
9222
10054
|
}]));
|
9223
|
-
const res =
|
10055
|
+
const res = resolveSeqD03cb037.toJSON(this.contents, arg, ctx);
|
9224
10056
|
if (typeof onAnchor === 'function' && ctx.anchors) for (const {
|
9225
10057
|
count,
|
9226
10058
|
res
|
@@ -9270,18 +10102,18 @@ class Document$1 {
|
|
9270
10102
|
}
|
9271
10103
|
|
9272
10104
|
const ctx = {
|
9273
|
-
anchors:
|
10105
|
+
anchors: Object.create(null),
|
9274
10106
|
doc: this,
|
9275
10107
|
indent: '',
|
9276
10108
|
indentStep: ' '.repeat(indentSize),
|
9277
|
-
stringify // Requiring directly in nodes would create circular dependencies
|
10109
|
+
stringify: stringify$1 // Requiring directly in nodes would create circular dependencies
|
9278
10110
|
|
9279
10111
|
};
|
9280
10112
|
let chompKeep = false;
|
9281
10113
|
let contentComment = null;
|
9282
10114
|
|
9283
10115
|
if (this.contents) {
|
9284
|
-
if (this.contents instanceof
|
10116
|
+
if (this.contents instanceof resolveSeqD03cb037.Node) {
|
9285
10117
|
if (this.contents.spaceBefore && (hasDirectives || this.directivesEndMarker)) lines.push('');
|
9286
10118
|
if (this.contents.commentBefore) lines.push(this.contents.commentBefore.replace(/^/gm, '#')); // top-level block scalars need to be indented if followed by a comment
|
9287
10119
|
|
@@ -9290,10 +10122,10 @@ class Document$1 {
|
|
9290
10122
|
}
|
9291
10123
|
|
9292
10124
|
const onChompKeep = contentComment ? null : () => chompKeep = true;
|
9293
|
-
const body = stringify(this.contents, ctx, () => contentComment = null, onChompKeep);
|
9294
|
-
lines.push(
|
10125
|
+
const body = stringify$1(this.contents, ctx, () => contentComment = null, onChompKeep);
|
10126
|
+
lines.push(resolveSeqD03cb037.addComment(body, '', contentComment));
|
9295
10127
|
} else if (this.contents !== undefined) {
|
9296
|
-
lines.push(stringify(this.contents, ctx));
|
10128
|
+
lines.push(stringify$1(this.contents, ctx));
|
9297
10129
|
}
|
9298
10130
|
|
9299
10131
|
if (this.comment) {
|
@@ -9311,26 +10143,26 @@ PlainValueEc8e588e._defineProperty(Document$1, "defaults", documentOptions);
|
|
9311
10143
|
var Document_1 = Document$1;
|
9312
10144
|
var defaultOptions_1 = defaultOptions;
|
9313
10145
|
var scalarOptions_1 = scalarOptions;
|
9314
|
-
var
|
10146
|
+
var Document9b4560a1 = {
|
9315
10147
|
Document: Document_1,
|
9316
10148
|
defaultOptions: defaultOptions_1,
|
9317
10149
|
scalarOptions: scalarOptions_1
|
9318
10150
|
};
|
9319
10151
|
|
9320
|
-
function createNode
|
10152
|
+
function createNode(value, wrapScalars = true, tag) {
|
9321
10153
|
if (tag === undefined && typeof wrapScalars === 'string') {
|
9322
10154
|
tag = wrapScalars;
|
9323
10155
|
wrapScalars = true;
|
9324
10156
|
}
|
9325
10157
|
|
9326
|
-
const options = Object.assign({},
|
9327
|
-
const schema = new
|
10158
|
+
const options = Object.assign({}, Document9b4560a1.Document.defaults[Document9b4560a1.defaultOptions.version], Document9b4560a1.defaultOptions);
|
10159
|
+
const schema = new Schema88e323a7.Schema(options);
|
9328
10160
|
return schema.createNode(value, wrapScalars, tag);
|
9329
10161
|
}
|
9330
10162
|
|
9331
|
-
class Document
|
10163
|
+
class Document extends Document9b4560a1.Document {
|
9332
10164
|
constructor(options) {
|
9333
|
-
super(Object.assign({},
|
10165
|
+
super(Object.assign({}, Document9b4560a1.defaultOptions, options));
|
9334
10166
|
}
|
9335
10167
|
|
9336
10168
|
}
|
@@ -9340,7 +10172,7 @@ function parseAllDocuments(src, options) {
|
|
9340
10172
|
let prev;
|
9341
10173
|
|
9342
10174
|
for (const cstDoc of parseCst.parse(src)) {
|
9343
|
-
const doc = new Document
|
10175
|
+
const doc = new Document(options);
|
9344
10176
|
doc.parse(cstDoc, prev);
|
9345
10177
|
stream.push(doc);
|
9346
10178
|
prev = doc;
|
@@ -9351,7 +10183,7 @@ function parseAllDocuments(src, options) {
|
|
9351
10183
|
|
9352
10184
|
function parseDocument(src, options) {
|
9353
10185
|
const cst = parseCst.parse(src);
|
9354
|
-
const doc = new Document
|
10186
|
+
const doc = new Document(options).parse(cst[0]);
|
9355
10187
|
|
9356
10188
|
if (cst.length > 1) {
|
9357
10189
|
const errMsg = 'Source contains multiple documents; please use YAML.parseAllDocuments()';
|
@@ -9361,29 +10193,29 @@ function parseDocument(src, options) {
|
|
9361
10193
|
return doc;
|
9362
10194
|
}
|
9363
10195
|
|
9364
|
-
function parse
|
10196
|
+
function parse(src, options) {
|
9365
10197
|
const doc = parseDocument(src, options);
|
9366
|
-
doc.warnings.forEach(warning =>
|
10198
|
+
doc.warnings.forEach(warning => warnings1000a372.warn(warning));
|
9367
10199
|
if (doc.errors.length > 0) throw doc.errors[0];
|
9368
10200
|
return doc.toJSON();
|
9369
10201
|
}
|
9370
10202
|
|
9371
|
-
function stringify
|
9372
|
-
const doc = new Document
|
10203
|
+
function stringify(value, options) {
|
10204
|
+
const doc = new Document(options);
|
9373
10205
|
doc.contents = value;
|
9374
10206
|
return String(doc);
|
9375
10207
|
}
|
9376
10208
|
|
9377
10209
|
const YAML = {
|
9378
|
-
createNode
|
9379
|
-
defaultOptions:
|
9380
|
-
Document
|
9381
|
-
parse
|
10210
|
+
createNode,
|
10211
|
+
defaultOptions: Document9b4560a1.defaultOptions,
|
10212
|
+
Document,
|
10213
|
+
parse,
|
9382
10214
|
parseAllDocuments,
|
9383
10215
|
parseCST: parseCst.parse,
|
9384
10216
|
parseDocument,
|
9385
|
-
scalarOptions:
|
9386
|
-
stringify
|
10217
|
+
scalarOptions: Document9b4560a1.scalarOptions,
|
10218
|
+
stringify
|
9387
10219
|
};
|
9388
10220
|
var YAML_1 = YAML;
|
9389
10221
|
var dist$1 = {
|
@@ -9415,7 +10247,7 @@ var loaders_1 = createCommonjsModule(function (module, exports) {
|
|
9415
10247
|
|
9416
10248
|
const loadJson = function loadJson(filepath, content) {
|
9417
10249
|
if (parseJson === undefined) {
|
9418
|
-
parseJson =
|
10250
|
+
parseJson = parseJson_1;
|
9419
10251
|
}
|
9420
10252
|
|
9421
10253
|
try {
|
@@ -9453,32 +10285,32 @@ var loaders_1 = createCommonjsModule(function (module, exports) {
|
|
9453
10285
|
exports.loaders = loaders;
|
9454
10286
|
});
|
9455
10287
|
|
9456
|
-
var
|
10288
|
+
var getPropertyByPath_2 = getPropertyByPath; // Resolves property names or property paths defined with period-delimited
|
10289
|
+
// strings or arrays of strings. Property names that are found on the source
|
10290
|
+
// object are used directly (even if they include a period).
|
10291
|
+
// Nested property names that include periods, within a path, are only
|
10292
|
+
// understood in array paths.
|
9457
10293
|
|
9458
|
-
|
9459
|
-
|
9460
|
-
|
9461
|
-
|
9462
|
-
// strings or arrays of strings. Property names that are found on the source
|
9463
|
-
// object are used directly (even if they include a period).
|
9464
|
-
// Nested property names that include periods, within a path, are only
|
9465
|
-
// understood in array paths.
|
10294
|
+
function getPropertyByPath(source, path) {
|
10295
|
+
if (typeof path === 'string' && Object.prototype.hasOwnProperty.call(source, path)) {
|
10296
|
+
return source[path];
|
10297
|
+
}
|
9466
10298
|
|
9467
|
-
|
9468
|
-
if (typeof path === 'string' && Object.prototype.hasOwnProperty.call(source, path)) {
|
9469
|
-
return source[path];
|
9470
|
-
}
|
10299
|
+
const parsedPath = typeof path === 'string' ? path.split('.') : path; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
9471
10300
|
|
9472
|
-
|
10301
|
+
return parsedPath.reduce((previous, key) => {
|
10302
|
+
if (previous === undefined) {
|
10303
|
+
return previous;
|
10304
|
+
}
|
9473
10305
|
|
9474
|
-
return
|
9475
|
-
|
9476
|
-
|
9477
|
-
}
|
10306
|
+
return previous[key];
|
10307
|
+
}, source);
|
10308
|
+
}
|
9478
10309
|
|
9479
|
-
|
9480
|
-
|
9481
|
-
|
10310
|
+
var getPropertyByPath_1 = /*#__PURE__*/Object.defineProperty({
|
10311
|
+
getPropertyByPath: getPropertyByPath_2
|
10312
|
+
}, '__esModule', {
|
10313
|
+
value: true
|
9482
10314
|
});
|
9483
10315
|
|
9484
10316
|
var ExplorerBase_1 = createCommonjsModule(function (module, exports) {
|
@@ -9624,98 +10456,100 @@ var ExplorerBase_1 = createCommonjsModule(function (module, exports) {
|
|
9624
10456
|
}
|
9625
10457
|
});
|
9626
10458
|
|
9627
|
-
var
|
10459
|
+
var readFile_2 = readFile;
|
10460
|
+
var readFileSync_1 = readFileSync;
|
9628
10461
|
|
9629
|
-
|
9630
|
-
value: true
|
9631
|
-
});
|
9632
|
-
exports.readFile = readFile;
|
9633
|
-
exports.readFileSync = readFileSync;
|
10462
|
+
var _fs = _interopRequireDefault$1(fs__default['default']);
|
9634
10463
|
|
9635
|
-
|
9636
|
-
|
9637
|
-
|
9638
|
-
|
9639
|
-
|
9640
|
-
};
|
9641
|
-
}
|
10464
|
+
function _interopRequireDefault$1(obj) {
|
10465
|
+
return obj && obj.__esModule ? obj : {
|
10466
|
+
default: obj
|
10467
|
+
};
|
10468
|
+
}
|
9642
10469
|
|
9643
|
-
|
9644
|
-
|
9645
|
-
|
9646
|
-
|
9647
|
-
|
9648
|
-
|
9649
|
-
|
10470
|
+
async function fsReadFileAsync(pathname, encoding) {
|
10471
|
+
return new Promise((resolve, reject) => {
|
10472
|
+
_fs.default.readFile(pathname, encoding, (error, contents) => {
|
10473
|
+
if (error) {
|
10474
|
+
reject(error);
|
10475
|
+
return;
|
10476
|
+
}
|
9650
10477
|
|
9651
|
-
|
9652
|
-
});
|
10478
|
+
resolve(contents);
|
9653
10479
|
});
|
9654
|
-
}
|
10480
|
+
});
|
10481
|
+
}
|
9655
10482
|
|
9656
|
-
|
9657
|
-
|
10483
|
+
async function readFile(filepath, options = {}) {
|
10484
|
+
const throwNotFound = options.throwNotFound === true;
|
9658
10485
|
|
9659
|
-
|
9660
|
-
|
9661
|
-
|
9662
|
-
|
9663
|
-
|
9664
|
-
|
9665
|
-
}
|
9666
|
-
|
9667
|
-
throw error;
|
10486
|
+
try {
|
10487
|
+
const content = await fsReadFileAsync(filepath, 'utf8');
|
10488
|
+
return content;
|
10489
|
+
} catch (error) {
|
10490
|
+
if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) {
|
10491
|
+
return null;
|
9668
10492
|
}
|
9669
|
-
}
|
9670
10493
|
|
9671
|
-
|
9672
|
-
|
10494
|
+
throw error;
|
10495
|
+
}
|
10496
|
+
}
|
9673
10497
|
|
9674
|
-
|
9675
|
-
|
10498
|
+
function readFileSync(filepath, options = {}) {
|
10499
|
+
const throwNotFound = options.throwNotFound === true;
|
9676
10500
|
|
9677
|
-
|
9678
|
-
|
9679
|
-
if (throwNotFound === false && error.code === 'ENOENT') {
|
9680
|
-
return null;
|
9681
|
-
}
|
10501
|
+
try {
|
10502
|
+
const content = _fs.default.readFileSync(filepath, 'utf8');
|
9682
10503
|
|
9683
|
-
|
10504
|
+
return content;
|
10505
|
+
} catch (error) {
|
10506
|
+
if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) {
|
10507
|
+
return null;
|
9684
10508
|
}
|
9685
|
-
}
|
9686
|
-
});
|
9687
10509
|
|
9688
|
-
|
10510
|
+
throw error;
|
10511
|
+
}
|
10512
|
+
}
|
9689
10513
|
|
9690
|
-
|
9691
|
-
|
9692
|
-
|
9693
|
-
|
9694
|
-
|
10514
|
+
var readFile_1 = /*#__PURE__*/Object.defineProperty({
|
10515
|
+
readFile: readFile_2,
|
10516
|
+
readFileSync: readFileSync_1
|
10517
|
+
}, '__esModule', {
|
10518
|
+
value: true
|
10519
|
+
});
|
9695
10520
|
|
9696
|
-
|
9697
|
-
|
10521
|
+
var cacheWrapper_2 = cacheWrapper;
|
10522
|
+
var cacheWrapperSync_1 = cacheWrapperSync;
|
9698
10523
|
|
9699
|
-
|
9700
|
-
|
9701
|
-
}
|
10524
|
+
async function cacheWrapper(cache, key, fn) {
|
10525
|
+
const cached = cache.get(key);
|
9702
10526
|
|
9703
|
-
|
9704
|
-
|
9705
|
-
return result;
|
10527
|
+
if (cached !== undefined) {
|
10528
|
+
return cached;
|
9706
10529
|
}
|
9707
10530
|
|
9708
|
-
|
9709
|
-
|
10531
|
+
const result = await fn();
|
10532
|
+
cache.set(key, result);
|
10533
|
+
return result;
|
10534
|
+
}
|
9710
10535
|
|
9711
|
-
|
9712
|
-
|
9713
|
-
}
|
10536
|
+
function cacheWrapperSync(cache, key, fn) {
|
10537
|
+
const cached = cache.get(key);
|
9714
10538
|
|
9715
|
-
|
9716
|
-
|
9717
|
-
return result;
|
10539
|
+
if (cached !== undefined) {
|
10540
|
+
return cached;
|
9718
10541
|
}
|
10542
|
+
|
10543
|
+
const result = fn();
|
10544
|
+
cache.set(key, result);
|
10545
|
+
return result;
|
10546
|
+
}
|
10547
|
+
|
10548
|
+
var cacheWrapper_1 = /*#__PURE__*/Object.defineProperty({
|
10549
|
+
cacheWrapper: cacheWrapper_2,
|
10550
|
+
cacheWrapperSync: cacheWrapperSync_1
|
10551
|
+
}, '__esModule', {
|
10552
|
+
value: true
|
9719
10553
|
});
|
9720
10554
|
|
9721
10555
|
const {
|
@@ -9770,45 +10604,46 @@ var pathType = {
|
|
9770
10604
|
isSymlinkSync: isSymlinkSync
|
9771
10605
|
};
|
9772
10606
|
|
9773
|
-
var
|
10607
|
+
var getDirectory_2 = getDirectory;
|
10608
|
+
var getDirectorySync_1 = getDirectorySync;
|
9774
10609
|
|
9775
|
-
|
9776
|
-
value: true
|
9777
|
-
});
|
9778
|
-
exports.getDirectory = getDirectory;
|
9779
|
-
exports.getDirectorySync = getDirectorySync;
|
10610
|
+
var _path = _interopRequireDefault(path__default['default']);
|
9780
10611
|
|
9781
|
-
|
10612
|
+
function _interopRequireDefault(obj) {
|
10613
|
+
return obj && obj.__esModule ? obj : {
|
10614
|
+
default: obj
|
10615
|
+
};
|
10616
|
+
}
|
9782
10617
|
|
9783
|
-
|
9784
|
-
|
9785
|
-
|
9786
|
-
|
10618
|
+
async function getDirectory(filepath) {
|
10619
|
+
const filePathIsDirectory = await (0, pathType.isDirectory)(filepath);
|
10620
|
+
|
10621
|
+
if (filePathIsDirectory === true) {
|
10622
|
+
return filepath;
|
9787
10623
|
}
|
9788
10624
|
|
9789
|
-
|
9790
|
-
const filePathIsDirectory = await (0, pathType.isDirectory)(filepath);
|
10625
|
+
const directory = _path.default.dirname(filepath);
|
9791
10626
|
|
9792
|
-
|
9793
|
-
|
9794
|
-
}
|
10627
|
+
return directory;
|
10628
|
+
}
|
9795
10629
|
|
9796
|
-
|
10630
|
+
function getDirectorySync(filepath) {
|
10631
|
+
const filePathIsDirectory = (0, pathType.isDirectorySync)(filepath);
|
9797
10632
|
|
9798
|
-
|
10633
|
+
if (filePathIsDirectory === true) {
|
10634
|
+
return filepath;
|
9799
10635
|
}
|
9800
10636
|
|
9801
|
-
|
9802
|
-
const filePathIsDirectory = (0, pathType.isDirectorySync)(filepath);
|
9803
|
-
|
9804
|
-
if (filePathIsDirectory === true) {
|
9805
|
-
return filepath;
|
9806
|
-
}
|
10637
|
+
const directory = _path.default.dirname(filepath);
|
9807
10638
|
|
9808
|
-
|
10639
|
+
return directory;
|
10640
|
+
}
|
9809
10641
|
|
9810
|
-
|
9811
|
-
|
10642
|
+
var getDirectory_1 = /*#__PURE__*/Object.defineProperty({
|
10643
|
+
getDirectory: getDirectory_2,
|
10644
|
+
getDirectorySync: getDirectorySync_1
|
10645
|
+
}, '__esModule', {
|
10646
|
+
value: true
|
9812
10647
|
});
|
9813
10648
|
|
9814
10649
|
var Explorer_1 = createCommonjsModule(function (module, exports) {
|
@@ -10041,7 +10876,7 @@ var ExplorerSync_1 = createCommonjsModule(function (module, exports) {
|
|
10041
10876
|
exports.ExplorerSync = ExplorerSync;
|
10042
10877
|
});
|
10043
10878
|
|
10044
|
-
var dist
|
10879
|
+
var dist = createCommonjsModule(function (module, exports) {
|
10045
10880
|
|
10046
10881
|
Object.defineProperty(exports, "__esModule", {
|
10047
10882
|
value: true
|
@@ -10111,8 +10946,8 @@ var dist$2 = createCommonjsModule(function (module, exports) {
|
|
10111
10946
|
transform: identity,
|
10112
10947
|
loaders: defaultLoaders
|
10113
10948
|
};
|
10114
|
-
const normalizedOptions = Object.assign({}, defaults, options, {
|
10115
|
-
loaders: Object.assign({}, defaults.loaders, options.loaders)
|
10949
|
+
const normalizedOptions = Object.assign(Object.assign(Object.assign({}, defaults), options), {}, {
|
10950
|
+
loaders: Object.assign(Object.assign({}, defaults.loaders), options.loaders)
|
10116
10951
|
});
|
10117
10952
|
return normalizedOptions;
|
10118
10953
|
}
|
@@ -10205,6 +11040,11 @@ var vendors = [
|
|
10205
11040
|
env: "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",
|
10206
11041
|
pr: "SYSTEM_PULLREQUEST_PULLREQUESTID"
|
10207
11042
|
},
|
11043
|
+
{
|
11044
|
+
name: "Appcircle",
|
11045
|
+
constant: "APPCIRCLE",
|
11046
|
+
env: "AC_APPCIRCLE"
|
11047
|
+
},
|
10208
11048
|
{
|
10209
11049
|
name: "Bamboo",
|
10210
11050
|
constant: "BAMBOO",
|
@@ -10254,6 +11094,17 @@ var vendors = [
|
|
10254
11094
|
constant: "CODEBUILD",
|
10255
11095
|
env: "CODEBUILD_BUILD_ARN"
|
10256
11096
|
},
|
11097
|
+
{
|
11098
|
+
name: "Codefresh",
|
11099
|
+
constant: "CODEFRESH",
|
11100
|
+
env: "CF_BUILD_ID",
|
11101
|
+
pr: {
|
11102
|
+
any: [
|
11103
|
+
"CF_PULL_REQUEST_NUMBER",
|
11104
|
+
"CF_PULL_REQUEST_ID"
|
11105
|
+
]
|
11106
|
+
}
|
11107
|
+
},
|
10257
11108
|
{
|
10258
11109
|
name: "Codeship",
|
10259
11110
|
constant: "CODESHIP",
|
@@ -10285,13 +11136,20 @@ var vendors = [
|
|
10285
11136
|
{
|
10286
11137
|
name: "GitLab CI",
|
10287
11138
|
constant: "GITLAB",
|
10288
|
-
env: "GITLAB_CI"
|
11139
|
+
env: "GITLAB_CI",
|
11140
|
+
pr: "CI_MERGE_REQUEST_ID"
|
10289
11141
|
},
|
10290
11142
|
{
|
10291
11143
|
name: "GoCD",
|
10292
11144
|
constant: "GOCD",
|
10293
11145
|
env: "GO_PIPELINE_LABEL"
|
10294
11146
|
},
|
11147
|
+
{
|
11148
|
+
name: "LayerCI",
|
11149
|
+
constant: "LAYERCI",
|
11150
|
+
env: "LAYERCI",
|
11151
|
+
pr: "LAYERCI_PULL_REQUEST"
|
11152
|
+
},
|
10295
11153
|
{
|
10296
11154
|
name: "Hudson",
|
10297
11155
|
constant: "HUDSON",
|
@@ -10311,11 +11169,6 @@ var vendors = [
|
|
10311
11169
|
]
|
10312
11170
|
}
|
10313
11171
|
},
|
10314
|
-
{
|
10315
|
-
name: "ZEIT Now",
|
10316
|
-
constant: "ZEIT_NOW",
|
10317
|
-
env: "NOW_BUILDER"
|
10318
|
-
},
|
10319
11172
|
{
|
10320
11173
|
name: "Magnum CI",
|
10321
11174
|
constant: "MAGNUM",
|
@@ -10359,6 +11212,15 @@ var vendors = [
|
|
10359
11212
|
env: "SEMAPHORE",
|
10360
11213
|
pr: "PULL_REQUEST_NUMBER"
|
10361
11214
|
},
|
11215
|
+
{
|
11216
|
+
name: "Screwdriver",
|
11217
|
+
constant: "SCREWDRIVER",
|
11218
|
+
env: "SCREWDRIVER",
|
11219
|
+
pr: {
|
11220
|
+
env: "SD_PULL_REQUEST",
|
11221
|
+
ne: "false"
|
11222
|
+
}
|
11223
|
+
},
|
10362
11224
|
{
|
10363
11225
|
name: "Shippable",
|
10364
11226
|
constant: "SHIPPABLE",
|
@@ -10399,12 +11261,22 @@ var vendors = [
|
|
10399
11261
|
env: "TRAVIS_PULL_REQUEST",
|
10400
11262
|
ne: "false"
|
10401
11263
|
}
|
11264
|
+
},
|
11265
|
+
{
|
11266
|
+
name: "Vercel",
|
11267
|
+
constant: "VERCEL",
|
11268
|
+
env: "NOW_BUILDER"
|
11269
|
+
},
|
11270
|
+
{
|
11271
|
+
name: "Visual Studio App Center",
|
11272
|
+
constant: "APPCENTER",
|
11273
|
+
env: "APPCENTER_BUILD_ID"
|
10402
11274
|
}
|
10403
11275
|
];
|
10404
11276
|
|
10405
11277
|
var ciInfo = createCommonjsModule(function (module, exports) {
|
10406
11278
|
|
10407
|
-
|
11279
|
+
const env = process.env; // Used for testing only
|
10408
11280
|
|
10409
11281
|
Object.defineProperty(exports, '_vendors', {
|
10410
11282
|
value: vendors.map(function (v) {
|
@@ -10414,8 +11286,8 @@ var ciInfo = createCommonjsModule(function (module, exports) {
|
|
10414
11286
|
exports.name = null;
|
10415
11287
|
exports.isPR = null;
|
10416
11288
|
vendors.forEach(function (vendor) {
|
10417
|
-
|
10418
|
-
|
11289
|
+
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
|
11290
|
+
const isCI = envs.every(function (obj) {
|
10419
11291
|
return checkEnv(obj);
|
10420
11292
|
});
|
10421
11293
|
exports[vendor.constant] = isCI;
|
@@ -10466,8 +11338,8 @@ var ciInfo = createCommonjsModule(function (module, exports) {
|
|
10466
11338
|
});
|
10467
11339
|
|
10468
11340
|
var thirdParty = {
|
10469
|
-
cosmiconfig: dist
|
10470
|
-
cosmiconfigSync: dist
|
11341
|
+
cosmiconfig: dist.cosmiconfig,
|
11342
|
+
cosmiconfigSync: dist.cosmiconfigSync,
|
10471
11343
|
findParentDir: findParentDir.sync,
|
10472
11344
|
getStdin: getStdin,
|
10473
11345
|
isCI: () => ciInfo.isCI
|