@slidev/cli 0.27.20 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-LK5RLV7L.js → build-IHQEXPWU.js} +24 -25
- package/dist/{build-OT76Q4KA.mjs → build-MGE5AXXE.mjs} +15 -16
- package/dist/{chunk-FN2B33RM.mjs → chunk-2E3KKOOJ.mjs} +21 -19
- package/dist/{chunk-RUL3XRPS.js → chunk-BYTWGCY3.js} +9 -3
- package/dist/{chunk-XEDZVJCH.js → chunk-FHAYPMSG.js} +3468 -424
- package/dist/{chunk-3ND6GSCF.js → chunk-INYQJTKA.js} +71 -69
- package/dist/{chunk-JGWGLMRC.mjs → chunk-MP2CDYSZ.mjs} +3237 -193
- package/dist/{chunk-3LH2GTGU.mjs → chunk-OXQUV4ZP.mjs} +8 -2
- package/dist/{chunk-2TTM3NLX.mjs → chunk-RLNIZC66.mjs} +2 -2
- package/dist/{chunk-VN5XPBZO.js → chunk-Z64T7ZBU.js} +4 -4
- package/dist/cli.js +26 -26
- package/dist/cli.mjs +13 -13
- package/dist/{export-IU4RLVW7.mjs → export-7GHMNSMB.mjs} +2 -2
- package/dist/{export-FUMCNU5W.js → export-WXQSOLRA.js} +5 -5
- package/dist/index.d.ts +68 -4
- package/dist/index.js +9 -11
- package/dist/index.mjs +6 -8
- package/package.json +29 -28
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
|
|
8
11
|
|
|
9
12
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/constants.js
|
|
10
|
-
var require_constants =
|
|
13
|
+
var require_constants = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
11
14
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/constants.js"(exports, module) {
|
|
12
|
-
|
|
15
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
13
16
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
14
17
|
var MAX_LENGTH = 256;
|
|
15
18
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
@@ -24,9 +27,9 @@ var require_constants = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
24
27
|
});
|
|
25
28
|
|
|
26
29
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/debug.js
|
|
27
|
-
var require_debug =
|
|
30
|
+
var require_debug = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
28
31
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/debug.js"(exports, module) {
|
|
29
|
-
|
|
32
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
30
33
|
var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
31
34
|
};
|
|
32
35
|
module.exports = debug2;
|
|
@@ -34,9 +37,9 @@ var require_debug = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
34
37
|
});
|
|
35
38
|
|
|
36
39
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/re.js
|
|
37
|
-
var require_re =
|
|
40
|
+
var require_re = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
38
41
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/re.js"(exports, module) {
|
|
39
|
-
|
|
42
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
40
43
|
var { MAX_SAFE_COMPONENT_LENGTH } = require_constants();
|
|
41
44
|
var debug2 = require_debug();
|
|
42
45
|
exports = module.exports = {};
|
|
@@ -98,9 +101,9 @@ var require_re = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
98
101
|
});
|
|
99
102
|
|
|
100
103
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/parse-options.js
|
|
101
|
-
var require_parse_options =
|
|
104
|
+
var require_parse_options = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
102
105
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
103
|
-
|
|
106
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
104
107
|
var opts = ["includePrerelease", "loose", "rtl"];
|
|
105
108
|
var parseOptions = (options) => !options ? {} : typeof options !== "object" ? { loose: true } : opts.filter((k) => options[k]).reduce((options2, k) => {
|
|
106
109
|
options2[k] = true;
|
|
@@ -111,9 +114,9 @@ var require_parse_options = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
111
114
|
});
|
|
112
115
|
|
|
113
116
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/identifiers.js
|
|
114
|
-
var require_identifiers =
|
|
117
|
+
var require_identifiers = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
115
118
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
116
|
-
|
|
119
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
117
120
|
var numeric = /^[0-9]+$/;
|
|
118
121
|
var compareIdentifiers = (a, b) => {
|
|
119
122
|
const anum = numeric.test(a);
|
|
@@ -133,9 +136,9 @@ var require_identifiers = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
133
136
|
});
|
|
134
137
|
|
|
135
138
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/semver.js
|
|
136
|
-
var require_semver =
|
|
139
|
+
var require_semver = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
137
140
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/semver.js"(exports, module) {
|
|
138
|
-
|
|
141
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
139
142
|
var debug2 = require_debug();
|
|
140
143
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
141
144
|
var { re, t } = require_re();
|
|
@@ -358,14 +361,14 @@ var require_semver = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
358
361
|
});
|
|
359
362
|
|
|
360
363
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/parse.js
|
|
361
|
-
var require_parse2 =
|
|
364
|
+
var require_parse2 = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
362
365
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/parse.js"(exports, module) {
|
|
363
|
-
|
|
366
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
364
367
|
var { MAX_LENGTH } = require_constants();
|
|
365
368
|
var { re, t } = require_re();
|
|
366
369
|
var SemVer = require_semver();
|
|
367
370
|
var parseOptions = require_parse_options();
|
|
368
|
-
var
|
|
371
|
+
var parse2 = (version3, options) => {
|
|
369
372
|
options = parseOptions(options);
|
|
370
373
|
if (version3 instanceof SemVer) {
|
|
371
374
|
return version3;
|
|
@@ -386,17 +389,17 @@ var require_parse2 = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
386
389
|
return null;
|
|
387
390
|
}
|
|
388
391
|
};
|
|
389
|
-
module.exports =
|
|
392
|
+
module.exports = parse2;
|
|
390
393
|
}
|
|
391
394
|
});
|
|
392
395
|
|
|
393
396
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/valid.js
|
|
394
|
-
var require_valid =
|
|
397
|
+
var require_valid = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
395
398
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/valid.js"(exports, module) {
|
|
396
|
-
|
|
397
|
-
var
|
|
399
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
400
|
+
var parse2 = require_parse2();
|
|
398
401
|
var valid = (version3, options) => {
|
|
399
|
-
const v =
|
|
402
|
+
const v = parse2(version3, options);
|
|
400
403
|
return v ? v.version : null;
|
|
401
404
|
};
|
|
402
405
|
module.exports = valid;
|
|
@@ -404,12 +407,12 @@ var require_valid = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
404
407
|
});
|
|
405
408
|
|
|
406
409
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/clean.js
|
|
407
|
-
var require_clean =
|
|
410
|
+
var require_clean = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
408
411
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/clean.js"(exports, module) {
|
|
409
|
-
|
|
410
|
-
var
|
|
412
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
413
|
+
var parse2 = require_parse2();
|
|
411
414
|
var clean = (version3, options) => {
|
|
412
|
-
const s =
|
|
415
|
+
const s = parse2(version3.trim().replace(/^[=v]+/, ""), options);
|
|
413
416
|
return s ? s.version : null;
|
|
414
417
|
};
|
|
415
418
|
module.exports = clean;
|
|
@@ -417,9 +420,9 @@ var require_clean = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
417
420
|
});
|
|
418
421
|
|
|
419
422
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/inc.js
|
|
420
|
-
var require_inc =
|
|
423
|
+
var require_inc = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
421
424
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/inc.js"(exports, module) {
|
|
422
|
-
|
|
425
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
423
426
|
var SemVer = require_semver();
|
|
424
427
|
var inc = (version3, release, options, identifier) => {
|
|
425
428
|
if (typeof options === "string") {
|
|
@@ -437,9 +440,9 @@ var require_inc = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
437
440
|
});
|
|
438
441
|
|
|
439
442
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare.js
|
|
440
|
-
var require_compare =
|
|
443
|
+
var require_compare = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
441
444
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare.js"(exports, module) {
|
|
442
|
-
|
|
445
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
443
446
|
var SemVer = require_semver();
|
|
444
447
|
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
445
448
|
module.exports = compare;
|
|
@@ -447,9 +450,9 @@ var require_compare = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
447
450
|
});
|
|
448
451
|
|
|
449
452
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/eq.js
|
|
450
|
-
var require_eq =
|
|
453
|
+
var require_eq = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
451
454
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/eq.js"(exports, module) {
|
|
452
|
-
|
|
455
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
453
456
|
var compare = require_compare();
|
|
454
457
|
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
455
458
|
module.exports = eq;
|
|
@@ -457,17 +460,17 @@ var require_eq = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
457
460
|
});
|
|
458
461
|
|
|
459
462
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/diff.js
|
|
460
|
-
var require_diff =
|
|
463
|
+
var require_diff = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
461
464
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/diff.js"(exports, module) {
|
|
462
|
-
|
|
463
|
-
var
|
|
465
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
466
|
+
var parse2 = require_parse2();
|
|
464
467
|
var eq = require_eq();
|
|
465
468
|
var diff = (version1, version22) => {
|
|
466
469
|
if (eq(version1, version22)) {
|
|
467
470
|
return null;
|
|
468
471
|
} else {
|
|
469
|
-
const v1 =
|
|
470
|
-
const v2 =
|
|
472
|
+
const v1 = parse2(version1);
|
|
473
|
+
const v2 = parse2(version22);
|
|
471
474
|
const hasPre = v1.prerelease.length || v2.prerelease.length;
|
|
472
475
|
const prefix = hasPre ? "pre" : "";
|
|
473
476
|
const defaultResult = hasPre ? "prerelease" : "";
|
|
@@ -486,9 +489,9 @@ var require_diff = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
486
489
|
});
|
|
487
490
|
|
|
488
491
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/major.js
|
|
489
|
-
var require_major =
|
|
492
|
+
var require_major = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
490
493
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/major.js"(exports, module) {
|
|
491
|
-
|
|
494
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
492
495
|
var SemVer = require_semver();
|
|
493
496
|
var major = (a, loose) => new SemVer(a, loose).major;
|
|
494
497
|
module.exports = major;
|
|
@@ -496,9 +499,9 @@ var require_major = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
496
499
|
});
|
|
497
500
|
|
|
498
501
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/minor.js
|
|
499
|
-
var require_minor =
|
|
502
|
+
var require_minor = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
500
503
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/minor.js"(exports, module) {
|
|
501
|
-
|
|
504
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
502
505
|
var SemVer = require_semver();
|
|
503
506
|
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
504
507
|
module.exports = minor;
|
|
@@ -506,9 +509,9 @@ var require_minor = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
506
509
|
});
|
|
507
510
|
|
|
508
511
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/patch.js
|
|
509
|
-
var require_patch =
|
|
512
|
+
var require_patch = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
510
513
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/patch.js"(exports, module) {
|
|
511
|
-
|
|
514
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
512
515
|
var SemVer = require_semver();
|
|
513
516
|
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
514
517
|
module.exports = patch;
|
|
@@ -516,12 +519,12 @@ var require_patch = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
516
519
|
});
|
|
517
520
|
|
|
518
521
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/prerelease.js
|
|
519
|
-
var require_prerelease =
|
|
522
|
+
var require_prerelease = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
520
523
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
521
|
-
|
|
522
|
-
var
|
|
524
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
525
|
+
var parse2 = require_parse2();
|
|
523
526
|
var prerelease = (version3, options) => {
|
|
524
|
-
const parsed =
|
|
527
|
+
const parsed = parse2(version3, options);
|
|
525
528
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
526
529
|
};
|
|
527
530
|
module.exports = prerelease;
|
|
@@ -529,9 +532,9 @@ var require_prerelease = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
529
532
|
});
|
|
530
533
|
|
|
531
534
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/rcompare.js
|
|
532
|
-
var require_rcompare =
|
|
535
|
+
var require_rcompare = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
533
536
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
534
|
-
|
|
537
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
535
538
|
var compare = require_compare();
|
|
536
539
|
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
537
540
|
module.exports = rcompare;
|
|
@@ -539,9 +542,9 @@ var require_rcompare = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
539
542
|
});
|
|
540
543
|
|
|
541
544
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare-loose.js
|
|
542
|
-
var require_compare_loose =
|
|
545
|
+
var require_compare_loose = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
543
546
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
544
|
-
|
|
547
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
545
548
|
var compare = require_compare();
|
|
546
549
|
var compareLoose = (a, b) => compare(a, b, true);
|
|
547
550
|
module.exports = compareLoose;
|
|
@@ -549,9 +552,9 @@ var require_compare_loose = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
549
552
|
});
|
|
550
553
|
|
|
551
554
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare-build.js
|
|
552
|
-
var require_compare_build =
|
|
555
|
+
var require_compare_build = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
553
556
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
554
|
-
|
|
557
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
555
558
|
var SemVer = require_semver();
|
|
556
559
|
var compareBuild = (a, b, loose) => {
|
|
557
560
|
const versionA = new SemVer(a, loose);
|
|
@@ -563,9 +566,9 @@ var require_compare_build = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
563
566
|
});
|
|
564
567
|
|
|
565
568
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/sort.js
|
|
566
|
-
var require_sort =
|
|
569
|
+
var require_sort = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
567
570
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/sort.js"(exports, module) {
|
|
568
|
-
|
|
571
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
569
572
|
var compareBuild = require_compare_build();
|
|
570
573
|
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
571
574
|
module.exports = sort;
|
|
@@ -573,9 +576,9 @@ var require_sort = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
573
576
|
});
|
|
574
577
|
|
|
575
578
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/rsort.js
|
|
576
|
-
var require_rsort =
|
|
579
|
+
var require_rsort = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
577
580
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/rsort.js"(exports, module) {
|
|
578
|
-
|
|
581
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
579
582
|
var compareBuild = require_compare_build();
|
|
580
583
|
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
581
584
|
module.exports = rsort;
|
|
@@ -583,9 +586,9 @@ var require_rsort = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
583
586
|
});
|
|
584
587
|
|
|
585
588
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/gt.js
|
|
586
|
-
var require_gt =
|
|
589
|
+
var require_gt = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
587
590
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/gt.js"(exports, module) {
|
|
588
|
-
|
|
591
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
589
592
|
var compare = require_compare();
|
|
590
593
|
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
591
594
|
module.exports = gt;
|
|
@@ -593,9 +596,9 @@ var require_gt = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
593
596
|
});
|
|
594
597
|
|
|
595
598
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/lt.js
|
|
596
|
-
var require_lt =
|
|
599
|
+
var require_lt = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
597
600
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/lt.js"(exports, module) {
|
|
598
|
-
|
|
601
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
599
602
|
var compare = require_compare();
|
|
600
603
|
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
601
604
|
module.exports = lt;
|
|
@@ -603,9 +606,9 @@ var require_lt = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
603
606
|
});
|
|
604
607
|
|
|
605
608
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/neq.js
|
|
606
|
-
var require_neq =
|
|
609
|
+
var require_neq = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
607
610
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/neq.js"(exports, module) {
|
|
608
|
-
|
|
611
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
609
612
|
var compare = require_compare();
|
|
610
613
|
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
611
614
|
module.exports = neq;
|
|
@@ -613,9 +616,9 @@ var require_neq = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
613
616
|
});
|
|
614
617
|
|
|
615
618
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/gte.js
|
|
616
|
-
var require_gte =
|
|
619
|
+
var require_gte = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
617
620
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/gte.js"(exports, module) {
|
|
618
|
-
|
|
621
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
619
622
|
var compare = require_compare();
|
|
620
623
|
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
621
624
|
module.exports = gte;
|
|
@@ -623,9 +626,9 @@ var require_gte = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
623
626
|
});
|
|
624
627
|
|
|
625
628
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/lte.js
|
|
626
|
-
var require_lte =
|
|
629
|
+
var require_lte = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
627
630
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/lte.js"(exports, module) {
|
|
628
|
-
|
|
631
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
629
632
|
var compare = require_compare();
|
|
630
633
|
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
631
634
|
module.exports = lte;
|
|
@@ -633,9 +636,9 @@ var require_lte = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
633
636
|
});
|
|
634
637
|
|
|
635
638
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/cmp.js
|
|
636
|
-
var require_cmp =
|
|
639
|
+
var require_cmp = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
637
640
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
638
|
-
|
|
641
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
639
642
|
var eq = require_eq();
|
|
640
643
|
var neq = require_neq();
|
|
641
644
|
var gt = require_gt();
|
|
@@ -679,11 +682,11 @@ var require_cmp = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
679
682
|
});
|
|
680
683
|
|
|
681
684
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/coerce.js
|
|
682
|
-
var require_coerce =
|
|
685
|
+
var require_coerce = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
683
686
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
684
|
-
|
|
687
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
685
688
|
var SemVer = require_semver();
|
|
686
|
-
var
|
|
689
|
+
var parse2 = require_parse2();
|
|
687
690
|
var { re, t } = require_re();
|
|
688
691
|
var coerce = (version3, options) => {
|
|
689
692
|
if (version3 instanceof SemVer) {
|
|
@@ -711,17 +714,17 @@ var require_coerce = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
711
714
|
}
|
|
712
715
|
if (match === null)
|
|
713
716
|
return null;
|
|
714
|
-
return
|
|
717
|
+
return parse2(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options);
|
|
715
718
|
};
|
|
716
719
|
module.exports = coerce;
|
|
717
720
|
}
|
|
718
721
|
});
|
|
719
722
|
|
|
720
723
|
// ../../node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js
|
|
721
|
-
var require_iterator =
|
|
724
|
+
var require_iterator = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
722
725
|
"../../node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js"(exports, module) {
|
|
723
726
|
"use strict";
|
|
724
|
-
|
|
727
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
725
728
|
module.exports = function(Yallist) {
|
|
726
729
|
Yallist.prototype[Symbol.iterator] = function* () {
|
|
727
730
|
for (let walker = this.head; walker; walker = walker.next) {
|
|
@@ -733,10 +736,10 @@ var require_iterator = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
733
736
|
});
|
|
734
737
|
|
|
735
738
|
// ../../node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js
|
|
736
|
-
var require_yallist =
|
|
739
|
+
var require_yallist = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
737
740
|
"../../node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js"(exports, module) {
|
|
738
741
|
"use strict";
|
|
739
|
-
|
|
742
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
740
743
|
module.exports = Yallist;
|
|
741
744
|
Yallist.Node = Node;
|
|
742
745
|
Yallist.create = Yallist;
|
|
@@ -1103,10 +1106,10 @@ var require_yallist = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1103
1106
|
});
|
|
1104
1107
|
|
|
1105
1108
|
// ../../node_modules/.pnpm/lru-cache@6.0.0/node_modules/lru-cache/index.js
|
|
1106
|
-
var require_lru_cache =
|
|
1109
|
+
var require_lru_cache = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1107
1110
|
"../../node_modules/.pnpm/lru-cache@6.0.0/node_modules/lru-cache/index.js"(exports, module) {
|
|
1108
1111
|
"use strict";
|
|
1109
|
-
|
|
1112
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1110
1113
|
var Yallist = require_yallist();
|
|
1111
1114
|
var MAX = Symbol("max");
|
|
1112
1115
|
var LENGTH = Symbol("length");
|
|
@@ -1372,32 +1375,32 @@ var require_lru_cache = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1372
1375
|
});
|
|
1373
1376
|
|
|
1374
1377
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/range.js
|
|
1375
|
-
var require_range =
|
|
1378
|
+
var require_range = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1376
1379
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/range.js"(exports, module) {
|
|
1377
|
-
|
|
1380
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1378
1381
|
var Range = class {
|
|
1379
|
-
constructor(
|
|
1382
|
+
constructor(range2, options) {
|
|
1380
1383
|
options = parseOptions(options);
|
|
1381
|
-
if (
|
|
1382
|
-
if (
|
|
1383
|
-
return
|
|
1384
|
+
if (range2 instanceof Range) {
|
|
1385
|
+
if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
|
|
1386
|
+
return range2;
|
|
1384
1387
|
} else {
|
|
1385
|
-
return new Range(
|
|
1388
|
+
return new Range(range2.raw, options);
|
|
1386
1389
|
}
|
|
1387
1390
|
}
|
|
1388
|
-
if (
|
|
1389
|
-
this.raw =
|
|
1390
|
-
this.set = [[
|
|
1391
|
+
if (range2 instanceof Comparator) {
|
|
1392
|
+
this.raw = range2.value;
|
|
1393
|
+
this.set = [[range2]];
|
|
1391
1394
|
this.format();
|
|
1392
1395
|
return this;
|
|
1393
1396
|
}
|
|
1394
1397
|
this.options = options;
|
|
1395
1398
|
this.loose = !!options.loose;
|
|
1396
1399
|
this.includePrerelease = !!options.includePrerelease;
|
|
1397
|
-
this.raw =
|
|
1398
|
-
this.set =
|
|
1400
|
+
this.raw = range2;
|
|
1401
|
+
this.set = range2.split(/\s*\|\|\s*/).map((range3) => this.parseRange(range3.trim())).filter((c) => c.length);
|
|
1399
1402
|
if (!this.set.length) {
|
|
1400
|
-
throw new TypeError(`Invalid SemVer Range: ${
|
|
1403
|
+
throw new TypeError(`Invalid SemVer Range: ${range2}`);
|
|
1401
1404
|
}
|
|
1402
1405
|
if (this.set.length > 1) {
|
|
1403
1406
|
const first = this.set[0];
|
|
@@ -1424,24 +1427,24 @@ var require_range = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1424
1427
|
toString() {
|
|
1425
1428
|
return this.range;
|
|
1426
1429
|
}
|
|
1427
|
-
parseRange(
|
|
1428
|
-
|
|
1430
|
+
parseRange(range2) {
|
|
1431
|
+
range2 = range2.trim();
|
|
1429
1432
|
const memoOpts = Object.keys(this.options).join(",");
|
|
1430
|
-
const memoKey = `parseRange:${memoOpts}:${
|
|
1433
|
+
const memoKey = `parseRange:${memoOpts}:${range2}`;
|
|
1431
1434
|
const cached = cache.get(memoKey);
|
|
1432
1435
|
if (cached)
|
|
1433
1436
|
return cached;
|
|
1434
1437
|
const loose = this.options.loose;
|
|
1435
1438
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1436
|
-
|
|
1437
|
-
debug2("hyphen replace",
|
|
1438
|
-
|
|
1439
|
-
debug2("comparator trim",
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1439
|
+
range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1440
|
+
debug2("hyphen replace", range2);
|
|
1441
|
+
range2 = range2.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1442
|
+
debug2("comparator trim", range2, re[t.COMPARATORTRIM]);
|
|
1443
|
+
range2 = range2.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1444
|
+
range2 = range2.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1445
|
+
range2 = range2.split(/\s+/).join(" ");
|
|
1443
1446
|
const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1444
|
-
const rangeList =
|
|
1447
|
+
const rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)).filter(this.options.loose ? (comp) => !!comp.match(compRe) : () => true).map((comp) => new Comparator(comp, this.options));
|
|
1445
1448
|
const l = rangeList.length;
|
|
1446
1449
|
const rangeMap = /* @__PURE__ */ new Map();
|
|
1447
1450
|
for (const comp of rangeList) {
|
|
@@ -1455,12 +1458,12 @@ var require_range = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1455
1458
|
cache.set(memoKey, result);
|
|
1456
1459
|
return result;
|
|
1457
1460
|
}
|
|
1458
|
-
intersects(
|
|
1459
|
-
if (!(
|
|
1461
|
+
intersects(range2, options) {
|
|
1462
|
+
if (!(range2 instanceof Range)) {
|
|
1460
1463
|
throw new TypeError("a Range is required");
|
|
1461
1464
|
}
|
|
1462
1465
|
return this.set.some((thisComparators) => {
|
|
1463
|
-
return isSatisfiable(thisComparators, options) &&
|
|
1466
|
+
return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => {
|
|
1464
1467
|
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1465
1468
|
return rangeComparators.every((rangeComparator) => {
|
|
1466
1469
|
return thisComparator.intersects(rangeComparator, options);
|
|
@@ -1695,20 +1698,20 @@ var require_range = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1695
1698
|
}
|
|
1696
1699
|
return `${from} ${to}`.trim();
|
|
1697
1700
|
};
|
|
1698
|
-
var testSet = (
|
|
1699
|
-
for (let i = 0; i <
|
|
1700
|
-
if (!
|
|
1701
|
+
var testSet = (set2, version3, options) => {
|
|
1702
|
+
for (let i = 0; i < set2.length; i++) {
|
|
1703
|
+
if (!set2[i].test(version3)) {
|
|
1701
1704
|
return false;
|
|
1702
1705
|
}
|
|
1703
1706
|
}
|
|
1704
1707
|
if (version3.prerelease.length && !options.includePrerelease) {
|
|
1705
|
-
for (let i = 0; i <
|
|
1706
|
-
debug2(
|
|
1707
|
-
if (
|
|
1708
|
+
for (let i = 0; i < set2.length; i++) {
|
|
1709
|
+
debug2(set2[i].semver);
|
|
1710
|
+
if (set2[i].semver === Comparator.ANY) {
|
|
1708
1711
|
continue;
|
|
1709
1712
|
}
|
|
1710
|
-
if (
|
|
1711
|
-
const allowed =
|
|
1713
|
+
if (set2[i].semver.prerelease.length > 0) {
|
|
1714
|
+
const allowed = set2[i].semver;
|
|
1712
1715
|
if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) {
|
|
1713
1716
|
return true;
|
|
1714
1717
|
}
|
|
@@ -1722,9 +1725,9 @@ var require_range = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1722
1725
|
});
|
|
1723
1726
|
|
|
1724
1727
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/comparator.js
|
|
1725
|
-
var require_comparator =
|
|
1728
|
+
var require_comparator = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1726
1729
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1727
|
-
|
|
1730
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1728
1731
|
var ANY = Symbol("SemVer ANY");
|
|
1729
1732
|
var Comparator = class {
|
|
1730
1733
|
static get ANY() {
|
|
@@ -1824,44 +1827,44 @@ var require_comparator = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1824
1827
|
});
|
|
1825
1828
|
|
|
1826
1829
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/satisfies.js
|
|
1827
|
-
var require_satisfies =
|
|
1830
|
+
var require_satisfies = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1828
1831
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1829
|
-
|
|
1832
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1830
1833
|
var Range = require_range();
|
|
1831
|
-
var satisfies2 = (version3,
|
|
1834
|
+
var satisfies2 = (version3, range2, options) => {
|
|
1832
1835
|
try {
|
|
1833
|
-
|
|
1836
|
+
range2 = new Range(range2, options);
|
|
1834
1837
|
} catch (er) {
|
|
1835
1838
|
return false;
|
|
1836
1839
|
}
|
|
1837
|
-
return
|
|
1840
|
+
return range2.test(version3);
|
|
1838
1841
|
};
|
|
1839
1842
|
module.exports = satisfies2;
|
|
1840
1843
|
}
|
|
1841
1844
|
});
|
|
1842
1845
|
|
|
1843
1846
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/to-comparators.js
|
|
1844
|
-
var require_to_comparators =
|
|
1847
|
+
var require_to_comparators = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1845
1848
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1846
|
-
|
|
1849
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1847
1850
|
var Range = require_range();
|
|
1848
|
-
var toComparators = (
|
|
1851
|
+
var toComparators = (range2, options) => new Range(range2, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1849
1852
|
module.exports = toComparators;
|
|
1850
1853
|
}
|
|
1851
1854
|
});
|
|
1852
1855
|
|
|
1853
1856
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/max-satisfying.js
|
|
1854
|
-
var require_max_satisfying =
|
|
1857
|
+
var require_max_satisfying = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1855
1858
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1856
|
-
|
|
1859
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1857
1860
|
var SemVer = require_semver();
|
|
1858
1861
|
var Range = require_range();
|
|
1859
|
-
var maxSatisfying = (versions,
|
|
1862
|
+
var maxSatisfying = (versions, range2, options) => {
|
|
1860
1863
|
let max = null;
|
|
1861
1864
|
let maxSV = null;
|
|
1862
1865
|
let rangeObj = null;
|
|
1863
1866
|
try {
|
|
1864
|
-
rangeObj = new Range(
|
|
1867
|
+
rangeObj = new Range(range2, options);
|
|
1865
1868
|
} catch (er) {
|
|
1866
1869
|
return null;
|
|
1867
1870
|
}
|
|
@@ -1880,17 +1883,17 @@ var require_max_satisfying = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1880
1883
|
});
|
|
1881
1884
|
|
|
1882
1885
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/min-satisfying.js
|
|
1883
|
-
var require_min_satisfying =
|
|
1886
|
+
var require_min_satisfying = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1884
1887
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1885
|
-
|
|
1888
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1886
1889
|
var SemVer = require_semver();
|
|
1887
1890
|
var Range = require_range();
|
|
1888
|
-
var minSatisfying = (versions,
|
|
1891
|
+
var minSatisfying = (versions, range2, options) => {
|
|
1889
1892
|
let min = null;
|
|
1890
1893
|
let minSV = null;
|
|
1891
1894
|
let rangeObj = null;
|
|
1892
1895
|
try {
|
|
1893
|
-
rangeObj = new Range(
|
|
1896
|
+
rangeObj = new Range(range2, options);
|
|
1894
1897
|
} catch (er) {
|
|
1895
1898
|
return null;
|
|
1896
1899
|
}
|
|
@@ -1909,25 +1912,25 @@ var require_min_satisfying = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1909
1912
|
});
|
|
1910
1913
|
|
|
1911
1914
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/min-version.js
|
|
1912
|
-
var require_min_version =
|
|
1915
|
+
var require_min_version = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1913
1916
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1914
|
-
|
|
1917
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1915
1918
|
var SemVer = require_semver();
|
|
1916
1919
|
var Range = require_range();
|
|
1917
1920
|
var gt = require_gt();
|
|
1918
|
-
var minVersion = (
|
|
1919
|
-
|
|
1921
|
+
var minVersion = (range2, loose) => {
|
|
1922
|
+
range2 = new Range(range2, loose);
|
|
1920
1923
|
let minver = new SemVer("0.0.0");
|
|
1921
|
-
if (
|
|
1924
|
+
if (range2.test(minver)) {
|
|
1922
1925
|
return minver;
|
|
1923
1926
|
}
|
|
1924
1927
|
minver = new SemVer("0.0.0-0");
|
|
1925
|
-
if (
|
|
1928
|
+
if (range2.test(minver)) {
|
|
1926
1929
|
return minver;
|
|
1927
1930
|
}
|
|
1928
1931
|
minver = null;
|
|
1929
|
-
for (let i = 0; i <
|
|
1930
|
-
const comparators =
|
|
1932
|
+
for (let i = 0; i < range2.set.length; ++i) {
|
|
1933
|
+
const comparators = range2.set[i];
|
|
1931
1934
|
let setMin = null;
|
|
1932
1935
|
comparators.forEach((comparator) => {
|
|
1933
1936
|
const compver = new SemVer(comparator.semver.version);
|
|
@@ -1955,7 +1958,7 @@ var require_min_version = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1955
1958
|
if (setMin && (!minver || gt(minver, setMin)))
|
|
1956
1959
|
minver = setMin;
|
|
1957
1960
|
}
|
|
1958
|
-
if (minver &&
|
|
1961
|
+
if (minver && range2.test(minver)) {
|
|
1959
1962
|
return minver;
|
|
1960
1963
|
}
|
|
1961
1964
|
return null;
|
|
@@ -1965,13 +1968,13 @@ var require_min_version = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1965
1968
|
});
|
|
1966
1969
|
|
|
1967
1970
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/valid.js
|
|
1968
|
-
var require_valid2 =
|
|
1971
|
+
var require_valid2 = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1969
1972
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1970
|
-
|
|
1973
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1971
1974
|
var Range = require_range();
|
|
1972
|
-
var validRange = (
|
|
1975
|
+
var validRange = (range2, options) => {
|
|
1973
1976
|
try {
|
|
1974
|
-
return new Range(
|
|
1977
|
+
return new Range(range2, options).range || "*";
|
|
1975
1978
|
} catch (er) {
|
|
1976
1979
|
return null;
|
|
1977
1980
|
}
|
|
@@ -1981,9 +1984,9 @@ var require_valid2 = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1981
1984
|
});
|
|
1982
1985
|
|
|
1983
1986
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/outside.js
|
|
1984
|
-
var require_outside =
|
|
1987
|
+
var require_outside = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
1985
1988
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1986
|
-
|
|
1989
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1987
1990
|
var SemVer = require_semver();
|
|
1988
1991
|
var Comparator = require_comparator();
|
|
1989
1992
|
var { ANY } = Comparator;
|
|
@@ -1993,9 +1996,9 @@ var require_outside = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
1993
1996
|
var lt = require_lt();
|
|
1994
1997
|
var lte = require_lte();
|
|
1995
1998
|
var gte = require_gte();
|
|
1996
|
-
var outside = (version3,
|
|
1999
|
+
var outside = (version3, range2, hilo, options) => {
|
|
1997
2000
|
version3 = new SemVer(version3, options);
|
|
1998
|
-
|
|
2001
|
+
range2 = new Range(range2, options);
|
|
1999
2002
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
2000
2003
|
switch (hilo) {
|
|
2001
2004
|
case ">":
|
|
@@ -2015,11 +2018,11 @@ var require_outside = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
2015
2018
|
default:
|
|
2016
2019
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
2017
2020
|
}
|
|
2018
|
-
if (satisfies2(version3,
|
|
2021
|
+
if (satisfies2(version3, range2, options)) {
|
|
2019
2022
|
return false;
|
|
2020
2023
|
}
|
|
2021
|
-
for (let i = 0; i <
|
|
2022
|
-
const comparators =
|
|
2024
|
+
for (let i = 0; i < range2.set.length; ++i) {
|
|
2025
|
+
const comparators = range2.set[i];
|
|
2023
2026
|
let high = null;
|
|
2024
2027
|
let low = null;
|
|
2025
2028
|
comparators.forEach((comparator) => {
|
|
@@ -2050,29 +2053,29 @@ var require_outside = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
2050
2053
|
});
|
|
2051
2054
|
|
|
2052
2055
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/gtr.js
|
|
2053
|
-
var require_gtr =
|
|
2056
|
+
var require_gtr = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
2054
2057
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
2055
|
-
|
|
2058
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2056
2059
|
var outside = require_outside();
|
|
2057
|
-
var gtr = (version3,
|
|
2060
|
+
var gtr = (version3, range2, options) => outside(version3, range2, ">", options);
|
|
2058
2061
|
module.exports = gtr;
|
|
2059
2062
|
}
|
|
2060
2063
|
});
|
|
2061
2064
|
|
|
2062
2065
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/ltr.js
|
|
2063
|
-
var require_ltr =
|
|
2066
|
+
var require_ltr = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
2064
2067
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
2065
|
-
|
|
2068
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2066
2069
|
var outside = require_outside();
|
|
2067
|
-
var ltr = (version3,
|
|
2070
|
+
var ltr = (version3, range2, options) => outside(version3, range2, "<", options);
|
|
2068
2071
|
module.exports = ltr;
|
|
2069
2072
|
}
|
|
2070
2073
|
});
|
|
2071
2074
|
|
|
2072
2075
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/intersects.js
|
|
2073
|
-
var require_intersects =
|
|
2076
|
+
var require_intersects = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
2074
2077
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
2075
|
-
|
|
2078
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2076
2079
|
var Range = require_range();
|
|
2077
2080
|
var intersects = (r1, r2, options) => {
|
|
2078
2081
|
r1 = new Range(r1, options);
|
|
@@ -2084,34 +2087,34 @@ var require_intersects = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
2084
2087
|
});
|
|
2085
2088
|
|
|
2086
2089
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/simplify.js
|
|
2087
|
-
var require_simplify =
|
|
2090
|
+
var require_simplify = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
2088
2091
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
2089
|
-
|
|
2092
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2090
2093
|
var satisfies2 = require_satisfies();
|
|
2091
2094
|
var compare = require_compare();
|
|
2092
|
-
module.exports = (versions,
|
|
2093
|
-
const
|
|
2095
|
+
module.exports = (versions, range2, options) => {
|
|
2096
|
+
const set2 = [];
|
|
2094
2097
|
let min = null;
|
|
2095
2098
|
let prev = null;
|
|
2096
2099
|
const v = versions.sort((a, b) => compare(a, b, options));
|
|
2097
2100
|
for (const version3 of v) {
|
|
2098
|
-
const included = satisfies2(version3,
|
|
2101
|
+
const included = satisfies2(version3, range2, options);
|
|
2099
2102
|
if (included) {
|
|
2100
2103
|
prev = version3;
|
|
2101
2104
|
if (!min)
|
|
2102
2105
|
min = version3;
|
|
2103
2106
|
} else {
|
|
2104
2107
|
if (prev) {
|
|
2105
|
-
|
|
2108
|
+
set2.push([min, prev]);
|
|
2106
2109
|
}
|
|
2107
2110
|
prev = null;
|
|
2108
2111
|
min = null;
|
|
2109
2112
|
}
|
|
2110
2113
|
}
|
|
2111
2114
|
if (min)
|
|
2112
|
-
|
|
2115
|
+
set2.push([min, null]);
|
|
2113
2116
|
const ranges = [];
|
|
2114
|
-
for (const [min2, max] of
|
|
2117
|
+
for (const [min2, max] of set2) {
|
|
2115
2118
|
if (min2 === max)
|
|
2116
2119
|
ranges.push(min2);
|
|
2117
2120
|
else if (!max && min2 === v[0])
|
|
@@ -2124,16 +2127,16 @@ var require_simplify = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
2124
2127
|
ranges.push(`${min2} - ${max}`);
|
|
2125
2128
|
}
|
|
2126
2129
|
const simplified = ranges.join(" || ");
|
|
2127
|
-
const original = typeof
|
|
2128
|
-
return simplified.length < original.length ? simplified :
|
|
2130
|
+
const original = typeof range2.raw === "string" ? range2.raw : String(range2);
|
|
2131
|
+
return simplified.length < original.length ? simplified : range2;
|
|
2129
2132
|
};
|
|
2130
2133
|
}
|
|
2131
2134
|
});
|
|
2132
2135
|
|
|
2133
2136
|
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/subset.js
|
|
2134
|
-
var require_subset =
|
|
2137
|
+
var require_subset = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
2135
2138
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/subset.js"(exports, module) {
|
|
2136
|
-
|
|
2139
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2137
2140
|
var Range = require_range();
|
|
2138
2141
|
var Comparator = require_comparator();
|
|
2139
2142
|
var { ANY } = Comparator;
|
|
@@ -2169,176 +2172,3216 @@ var require_subset = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
2169
2172
|
else
|
|
2170
2173
|
sub = [new Comparator(">=0.0.0")];
|
|
2171
2174
|
}
|
|
2172
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
2173
|
-
if (options.includePrerelease)
|
|
2174
|
-
return true;
|
|
2175
|
-
else
|
|
2176
|
-
dom = [new Comparator(">=0.0.0")];
|
|
2175
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
2176
|
+
if (options.includePrerelease)
|
|
2177
|
+
return true;
|
|
2178
|
+
else
|
|
2179
|
+
dom = [new Comparator(">=0.0.0")];
|
|
2180
|
+
}
|
|
2181
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
2182
|
+
let gt, lt;
|
|
2183
|
+
for (const c of sub) {
|
|
2184
|
+
if (c.operator === ">" || c.operator === ">=")
|
|
2185
|
+
gt = higherGT(gt, c, options);
|
|
2186
|
+
else if (c.operator === "<" || c.operator === "<=")
|
|
2187
|
+
lt = lowerLT(lt, c, options);
|
|
2188
|
+
else
|
|
2189
|
+
eqSet.add(c.semver);
|
|
2190
|
+
}
|
|
2191
|
+
if (eqSet.size > 1)
|
|
2192
|
+
return null;
|
|
2193
|
+
let gtltComp;
|
|
2194
|
+
if (gt && lt) {
|
|
2195
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
2196
|
+
if (gtltComp > 0)
|
|
2197
|
+
return null;
|
|
2198
|
+
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<="))
|
|
2199
|
+
return null;
|
|
2200
|
+
}
|
|
2201
|
+
for (const eq of eqSet) {
|
|
2202
|
+
if (gt && !satisfies2(eq, String(gt), options))
|
|
2203
|
+
return null;
|
|
2204
|
+
if (lt && !satisfies2(eq, String(lt), options))
|
|
2205
|
+
return null;
|
|
2206
|
+
for (const c of dom) {
|
|
2207
|
+
if (!satisfies2(eq, String(c), options))
|
|
2208
|
+
return false;
|
|
2209
|
+
}
|
|
2210
|
+
return true;
|
|
2211
|
+
}
|
|
2212
|
+
let higher, lower;
|
|
2213
|
+
let hasDomLT, hasDomGT;
|
|
2214
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
2215
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
2216
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
2217
|
+
needDomLTPre = false;
|
|
2218
|
+
}
|
|
2219
|
+
for (const c of dom) {
|
|
2220
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
2221
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
2222
|
+
if (gt) {
|
|
2223
|
+
if (needDomGTPre) {
|
|
2224
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
2225
|
+
needDomGTPre = false;
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
2229
|
+
higher = higherGT(gt, c, options);
|
|
2230
|
+
if (higher === c && higher !== gt)
|
|
2231
|
+
return false;
|
|
2232
|
+
} else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options))
|
|
2233
|
+
return false;
|
|
2234
|
+
}
|
|
2235
|
+
if (lt) {
|
|
2236
|
+
if (needDomLTPre) {
|
|
2237
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
2238
|
+
needDomLTPre = false;
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
2242
|
+
lower = lowerLT(lt, c, options);
|
|
2243
|
+
if (lower === c && lower !== lt)
|
|
2244
|
+
return false;
|
|
2245
|
+
} else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options))
|
|
2246
|
+
return false;
|
|
2247
|
+
}
|
|
2248
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0)
|
|
2249
|
+
return false;
|
|
2250
|
+
}
|
|
2251
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0)
|
|
2252
|
+
return false;
|
|
2253
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0)
|
|
2254
|
+
return false;
|
|
2255
|
+
if (needDomGTPre || needDomLTPre)
|
|
2256
|
+
return false;
|
|
2257
|
+
return true;
|
|
2258
|
+
};
|
|
2259
|
+
var higherGT = (a, b, options) => {
|
|
2260
|
+
if (!a)
|
|
2261
|
+
return b;
|
|
2262
|
+
const comp = compare(a.semver, b.semver, options);
|
|
2263
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
2264
|
+
};
|
|
2265
|
+
var lowerLT = (a, b, options) => {
|
|
2266
|
+
if (!a)
|
|
2267
|
+
return b;
|
|
2268
|
+
const comp = compare(a.semver, b.semver, options);
|
|
2269
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
2270
|
+
};
|
|
2271
|
+
module.exports = subset;
|
|
2272
|
+
}
|
|
2273
|
+
});
|
|
2274
|
+
|
|
2275
|
+
// ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/index.js
|
|
2276
|
+
var require_semver2 = _chunkBYTWGCY3js.__commonJS.call(void 0, {
|
|
2277
|
+
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/index.js"(exports, module) {
|
|
2278
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2279
|
+
var internalRe = require_re();
|
|
2280
|
+
module.exports = {
|
|
2281
|
+
re: internalRe.re,
|
|
2282
|
+
src: internalRe.src,
|
|
2283
|
+
tokens: internalRe.t,
|
|
2284
|
+
SEMVER_SPEC_VERSION: require_constants().SEMVER_SPEC_VERSION,
|
|
2285
|
+
SemVer: require_semver(),
|
|
2286
|
+
compareIdentifiers: require_identifiers().compareIdentifiers,
|
|
2287
|
+
rcompareIdentifiers: require_identifiers().rcompareIdentifiers,
|
|
2288
|
+
parse: require_parse2(),
|
|
2289
|
+
valid: require_valid(),
|
|
2290
|
+
clean: require_clean(),
|
|
2291
|
+
inc: require_inc(),
|
|
2292
|
+
diff: require_diff(),
|
|
2293
|
+
major: require_major(),
|
|
2294
|
+
minor: require_minor(),
|
|
2295
|
+
patch: require_patch(),
|
|
2296
|
+
prerelease: require_prerelease(),
|
|
2297
|
+
compare: require_compare(),
|
|
2298
|
+
rcompare: require_rcompare(),
|
|
2299
|
+
compareLoose: require_compare_loose(),
|
|
2300
|
+
compareBuild: require_compare_build(),
|
|
2301
|
+
sort: require_sort(),
|
|
2302
|
+
rsort: require_rsort(),
|
|
2303
|
+
gt: require_gt(),
|
|
2304
|
+
lt: require_lt(),
|
|
2305
|
+
eq: require_eq(),
|
|
2306
|
+
neq: require_neq(),
|
|
2307
|
+
gte: require_gte(),
|
|
2308
|
+
lte: require_lte(),
|
|
2309
|
+
cmp: require_cmp(),
|
|
2310
|
+
coerce: require_coerce(),
|
|
2311
|
+
Comparator: require_comparator(),
|
|
2312
|
+
Range: require_range(),
|
|
2313
|
+
satisfies: require_satisfies(),
|
|
2314
|
+
toComparators: require_to_comparators(),
|
|
2315
|
+
maxSatisfying: require_max_satisfying(),
|
|
2316
|
+
minSatisfying: require_min_satisfying(),
|
|
2317
|
+
minVersion: require_min_version(),
|
|
2318
|
+
validRange: require_valid2(),
|
|
2319
|
+
outside: require_outside(),
|
|
2320
|
+
gtr: require_gtr(),
|
|
2321
|
+
ltr: require_ltr(),
|
|
2322
|
+
intersects: require_intersects(),
|
|
2323
|
+
simplifyRange: require_simplify(),
|
|
2324
|
+
subset: require_subset()
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
|
|
2329
|
+
// ../parser/src/fs.ts
|
|
2330
|
+
var fs_exports = {};
|
|
2331
|
+
_chunkBYTWGCY3js.__export.call(void 0, fs_exports, {
|
|
2332
|
+
detectFeatures: () => detectFeatures,
|
|
2333
|
+
filterDisabled: () => filterDisabled,
|
|
2334
|
+
load: () => load2,
|
|
2335
|
+
mergeFeatureFlags: () => mergeFeatureFlags,
|
|
2336
|
+
parse: () => parse,
|
|
2337
|
+
parseAspectRatio: () => parseAspectRatio,
|
|
2338
|
+
parseRangeString: () => parseRangeString,
|
|
2339
|
+
parseSlide: () => parseSlide,
|
|
2340
|
+
prettify: () => prettify,
|
|
2341
|
+
prettifySlide: () => prettifySlide,
|
|
2342
|
+
resolveConfig: () => resolveConfig,
|
|
2343
|
+
resolveFonts: () => resolveFonts,
|
|
2344
|
+
save: () => save,
|
|
2345
|
+
saveExternalSlide: () => saveExternalSlide,
|
|
2346
|
+
scanMonacoModules: () => scanMonacoModules,
|
|
2347
|
+
stringify: () => stringify,
|
|
2348
|
+
stringifySlide: () => stringifySlide
|
|
2349
|
+
});
|
|
2350
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2351
|
+
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
2352
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
2353
|
+
|
|
2354
|
+
// ../parser/src/core.ts
|
|
2355
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2356
|
+
|
|
2357
|
+
// ../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs
|
|
2358
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2359
|
+
function isNothing(subject) {
|
|
2360
|
+
return typeof subject === "undefined" || subject === null;
|
|
2361
|
+
}
|
|
2362
|
+
function isObject(subject) {
|
|
2363
|
+
return typeof subject === "object" && subject !== null;
|
|
2364
|
+
}
|
|
2365
|
+
function toArray(sequence) {
|
|
2366
|
+
if (Array.isArray(sequence))
|
|
2367
|
+
return sequence;
|
|
2368
|
+
else if (isNothing(sequence))
|
|
2369
|
+
return [];
|
|
2370
|
+
return [sequence];
|
|
2371
|
+
}
|
|
2372
|
+
function extend(target, source) {
|
|
2373
|
+
var index, length, key, sourceKeys;
|
|
2374
|
+
if (source) {
|
|
2375
|
+
sourceKeys = Object.keys(source);
|
|
2376
|
+
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
2377
|
+
key = sourceKeys[index];
|
|
2378
|
+
target[key] = source[key];
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
return target;
|
|
2382
|
+
}
|
|
2383
|
+
function repeat(string, count) {
|
|
2384
|
+
var result = "", cycle;
|
|
2385
|
+
for (cycle = 0; cycle < count; cycle += 1) {
|
|
2386
|
+
result += string;
|
|
2387
|
+
}
|
|
2388
|
+
return result;
|
|
2389
|
+
}
|
|
2390
|
+
function isNegativeZero(number) {
|
|
2391
|
+
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
2392
|
+
}
|
|
2393
|
+
var isNothing_1 = isNothing;
|
|
2394
|
+
var isObject_1 = isObject;
|
|
2395
|
+
var toArray_1 = toArray;
|
|
2396
|
+
var repeat_1 = repeat;
|
|
2397
|
+
var isNegativeZero_1 = isNegativeZero;
|
|
2398
|
+
var extend_1 = extend;
|
|
2399
|
+
var common = {
|
|
2400
|
+
isNothing: isNothing_1,
|
|
2401
|
+
isObject: isObject_1,
|
|
2402
|
+
toArray: toArray_1,
|
|
2403
|
+
repeat: repeat_1,
|
|
2404
|
+
isNegativeZero: isNegativeZero_1,
|
|
2405
|
+
extend: extend_1
|
|
2406
|
+
};
|
|
2407
|
+
function formatError(exception2, compact) {
|
|
2408
|
+
var where = "", message = exception2.reason || "(unknown reason)";
|
|
2409
|
+
if (!exception2.mark)
|
|
2410
|
+
return message;
|
|
2411
|
+
if (exception2.mark.name) {
|
|
2412
|
+
where += 'in "' + exception2.mark.name + '" ';
|
|
2413
|
+
}
|
|
2414
|
+
where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
|
|
2415
|
+
if (!compact && exception2.mark.snippet) {
|
|
2416
|
+
where += "\n\n" + exception2.mark.snippet;
|
|
2417
|
+
}
|
|
2418
|
+
return message + " " + where;
|
|
2419
|
+
}
|
|
2420
|
+
function YAMLException$1(reason, mark) {
|
|
2421
|
+
Error.call(this);
|
|
2422
|
+
this.name = "YAMLException";
|
|
2423
|
+
this.reason = reason;
|
|
2424
|
+
this.mark = mark;
|
|
2425
|
+
this.message = formatError(this, false);
|
|
2426
|
+
if (Error.captureStackTrace) {
|
|
2427
|
+
Error.captureStackTrace(this, this.constructor);
|
|
2428
|
+
} else {
|
|
2429
|
+
this.stack = new Error().stack || "";
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
YAMLException$1.prototype = Object.create(Error.prototype);
|
|
2433
|
+
YAMLException$1.prototype.constructor = YAMLException$1;
|
|
2434
|
+
YAMLException$1.prototype.toString = function toString(compact) {
|
|
2435
|
+
return this.name + ": " + formatError(this, compact);
|
|
2436
|
+
};
|
|
2437
|
+
var exception = YAMLException$1;
|
|
2438
|
+
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
2439
|
+
var head = "";
|
|
2440
|
+
var tail = "";
|
|
2441
|
+
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
2442
|
+
if (position - lineStart > maxHalfLength) {
|
|
2443
|
+
head = " ... ";
|
|
2444
|
+
lineStart = position - maxHalfLength + head.length;
|
|
2445
|
+
}
|
|
2446
|
+
if (lineEnd - position > maxHalfLength) {
|
|
2447
|
+
tail = " ...";
|
|
2448
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
2449
|
+
}
|
|
2450
|
+
return {
|
|
2451
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
|
|
2452
|
+
pos: position - lineStart + head.length
|
|
2453
|
+
};
|
|
2454
|
+
}
|
|
2455
|
+
function padStart(string, max) {
|
|
2456
|
+
return common.repeat(" ", max - string.length) + string;
|
|
2457
|
+
}
|
|
2458
|
+
function makeSnippet(mark, options) {
|
|
2459
|
+
options = Object.create(options || null);
|
|
2460
|
+
if (!mark.buffer)
|
|
2461
|
+
return null;
|
|
2462
|
+
if (!options.maxLength)
|
|
2463
|
+
options.maxLength = 79;
|
|
2464
|
+
if (typeof options.indent !== "number")
|
|
2465
|
+
options.indent = 1;
|
|
2466
|
+
if (typeof options.linesBefore !== "number")
|
|
2467
|
+
options.linesBefore = 3;
|
|
2468
|
+
if (typeof options.linesAfter !== "number")
|
|
2469
|
+
options.linesAfter = 2;
|
|
2470
|
+
var re = /\r?\n|\r|\0/g;
|
|
2471
|
+
var lineStarts = [0];
|
|
2472
|
+
var lineEnds = [];
|
|
2473
|
+
var match;
|
|
2474
|
+
var foundLineNo = -1;
|
|
2475
|
+
while (match = re.exec(mark.buffer)) {
|
|
2476
|
+
lineEnds.push(match.index);
|
|
2477
|
+
lineStarts.push(match.index + match[0].length);
|
|
2478
|
+
if (mark.position <= match.index && foundLineNo < 0) {
|
|
2479
|
+
foundLineNo = lineStarts.length - 2;
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
if (foundLineNo < 0)
|
|
2483
|
+
foundLineNo = lineStarts.length - 1;
|
|
2484
|
+
var result = "", i, line;
|
|
2485
|
+
var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
2486
|
+
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
2487
|
+
for (i = 1; i <= options.linesBefore; i++) {
|
|
2488
|
+
if (foundLineNo - i < 0)
|
|
2489
|
+
break;
|
|
2490
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
2491
|
+
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
|
2492
|
+
}
|
|
2493
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
2494
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
2495
|
+
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
2496
|
+
for (i = 1; i <= options.linesAfter; i++) {
|
|
2497
|
+
if (foundLineNo + i >= lineEnds.length)
|
|
2498
|
+
break;
|
|
2499
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
2500
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
2501
|
+
}
|
|
2502
|
+
return result.replace(/\n$/, "");
|
|
2503
|
+
}
|
|
2504
|
+
var snippet = makeSnippet;
|
|
2505
|
+
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
2506
|
+
"kind",
|
|
2507
|
+
"multi",
|
|
2508
|
+
"resolve",
|
|
2509
|
+
"construct",
|
|
2510
|
+
"instanceOf",
|
|
2511
|
+
"predicate",
|
|
2512
|
+
"represent",
|
|
2513
|
+
"representName",
|
|
2514
|
+
"defaultStyle",
|
|
2515
|
+
"styleAliases"
|
|
2516
|
+
];
|
|
2517
|
+
var YAML_NODE_KINDS = [
|
|
2518
|
+
"scalar",
|
|
2519
|
+
"sequence",
|
|
2520
|
+
"mapping"
|
|
2521
|
+
];
|
|
2522
|
+
function compileStyleAliases(map2) {
|
|
2523
|
+
var result = {};
|
|
2524
|
+
if (map2 !== null) {
|
|
2525
|
+
Object.keys(map2).forEach(function(style) {
|
|
2526
|
+
map2[style].forEach(function(alias) {
|
|
2527
|
+
result[String(alias)] = style;
|
|
2528
|
+
});
|
|
2529
|
+
});
|
|
2530
|
+
}
|
|
2531
|
+
return result;
|
|
2532
|
+
}
|
|
2533
|
+
function Type$1(tag, options) {
|
|
2534
|
+
options = options || {};
|
|
2535
|
+
Object.keys(options).forEach(function(name) {
|
|
2536
|
+
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
2537
|
+
throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
2538
|
+
}
|
|
2539
|
+
});
|
|
2540
|
+
this.options = options;
|
|
2541
|
+
this.tag = tag;
|
|
2542
|
+
this.kind = options["kind"] || null;
|
|
2543
|
+
this.resolve = options["resolve"] || function() {
|
|
2544
|
+
return true;
|
|
2545
|
+
};
|
|
2546
|
+
this.construct = options["construct"] || function(data) {
|
|
2547
|
+
return data;
|
|
2548
|
+
};
|
|
2549
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
2550
|
+
this.predicate = options["predicate"] || null;
|
|
2551
|
+
this.represent = options["represent"] || null;
|
|
2552
|
+
this.representName = options["representName"] || null;
|
|
2553
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
2554
|
+
this.multi = options["multi"] || false;
|
|
2555
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
2556
|
+
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
2557
|
+
throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
var type = Type$1;
|
|
2561
|
+
function compileList(schema2, name) {
|
|
2562
|
+
var result = [];
|
|
2563
|
+
schema2[name].forEach(function(currentType) {
|
|
2564
|
+
var newIndex = result.length;
|
|
2565
|
+
result.forEach(function(previousType, previousIndex) {
|
|
2566
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
2567
|
+
newIndex = previousIndex;
|
|
2568
|
+
}
|
|
2569
|
+
});
|
|
2570
|
+
result[newIndex] = currentType;
|
|
2571
|
+
});
|
|
2572
|
+
return result;
|
|
2573
|
+
}
|
|
2574
|
+
function compileMap() {
|
|
2575
|
+
var result = {
|
|
2576
|
+
scalar: {},
|
|
2577
|
+
sequence: {},
|
|
2578
|
+
mapping: {},
|
|
2579
|
+
fallback: {},
|
|
2580
|
+
multi: {
|
|
2581
|
+
scalar: [],
|
|
2582
|
+
sequence: [],
|
|
2583
|
+
mapping: [],
|
|
2584
|
+
fallback: []
|
|
2585
|
+
}
|
|
2586
|
+
}, index, length;
|
|
2587
|
+
function collectType(type2) {
|
|
2588
|
+
if (type2.multi) {
|
|
2589
|
+
result.multi[type2.kind].push(type2);
|
|
2590
|
+
result.multi["fallback"].push(type2);
|
|
2591
|
+
} else {
|
|
2592
|
+
result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2595
|
+
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
2596
|
+
arguments[index].forEach(collectType);
|
|
2597
|
+
}
|
|
2598
|
+
return result;
|
|
2599
|
+
}
|
|
2600
|
+
function Schema$1(definition) {
|
|
2601
|
+
return this.extend(definition);
|
|
2602
|
+
}
|
|
2603
|
+
Schema$1.prototype.extend = function extend2(definition) {
|
|
2604
|
+
var implicit = [];
|
|
2605
|
+
var explicit = [];
|
|
2606
|
+
if (definition instanceof type) {
|
|
2607
|
+
explicit.push(definition);
|
|
2608
|
+
} else if (Array.isArray(definition)) {
|
|
2609
|
+
explicit = explicit.concat(definition);
|
|
2610
|
+
} else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
2611
|
+
if (definition.implicit)
|
|
2612
|
+
implicit = implicit.concat(definition.implicit);
|
|
2613
|
+
if (definition.explicit)
|
|
2614
|
+
explicit = explicit.concat(definition.explicit);
|
|
2615
|
+
} else {
|
|
2616
|
+
throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
2617
|
+
}
|
|
2618
|
+
implicit.forEach(function(type$1) {
|
|
2619
|
+
if (!(type$1 instanceof type)) {
|
|
2620
|
+
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
2621
|
+
}
|
|
2622
|
+
if (type$1.loadKind && type$1.loadKind !== "scalar") {
|
|
2623
|
+
throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
2624
|
+
}
|
|
2625
|
+
if (type$1.multi) {
|
|
2626
|
+
throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
2627
|
+
}
|
|
2628
|
+
});
|
|
2629
|
+
explicit.forEach(function(type$1) {
|
|
2630
|
+
if (!(type$1 instanceof type)) {
|
|
2631
|
+
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
2632
|
+
}
|
|
2633
|
+
});
|
|
2634
|
+
var result = Object.create(Schema$1.prototype);
|
|
2635
|
+
result.implicit = (this.implicit || []).concat(implicit);
|
|
2636
|
+
result.explicit = (this.explicit || []).concat(explicit);
|
|
2637
|
+
result.compiledImplicit = compileList(result, "implicit");
|
|
2638
|
+
result.compiledExplicit = compileList(result, "explicit");
|
|
2639
|
+
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
2640
|
+
return result;
|
|
2641
|
+
};
|
|
2642
|
+
var schema = Schema$1;
|
|
2643
|
+
var str = new type("tag:yaml.org,2002:str", {
|
|
2644
|
+
kind: "scalar",
|
|
2645
|
+
construct: function(data) {
|
|
2646
|
+
return data !== null ? data : "";
|
|
2647
|
+
}
|
|
2648
|
+
});
|
|
2649
|
+
var seq = new type("tag:yaml.org,2002:seq", {
|
|
2650
|
+
kind: "sequence",
|
|
2651
|
+
construct: function(data) {
|
|
2652
|
+
return data !== null ? data : [];
|
|
2653
|
+
}
|
|
2654
|
+
});
|
|
2655
|
+
var map = new type("tag:yaml.org,2002:map", {
|
|
2656
|
+
kind: "mapping",
|
|
2657
|
+
construct: function(data) {
|
|
2658
|
+
return data !== null ? data : {};
|
|
2659
|
+
}
|
|
2660
|
+
});
|
|
2661
|
+
var failsafe = new schema({
|
|
2662
|
+
explicit: [
|
|
2663
|
+
str,
|
|
2664
|
+
seq,
|
|
2665
|
+
map
|
|
2666
|
+
]
|
|
2667
|
+
});
|
|
2668
|
+
function resolveYamlNull(data) {
|
|
2669
|
+
if (data === null)
|
|
2670
|
+
return true;
|
|
2671
|
+
var max = data.length;
|
|
2672
|
+
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
2673
|
+
}
|
|
2674
|
+
function constructYamlNull() {
|
|
2675
|
+
return null;
|
|
2676
|
+
}
|
|
2677
|
+
function isNull(object) {
|
|
2678
|
+
return object === null;
|
|
2679
|
+
}
|
|
2680
|
+
var _null = new type("tag:yaml.org,2002:null", {
|
|
2681
|
+
kind: "scalar",
|
|
2682
|
+
resolve: resolveYamlNull,
|
|
2683
|
+
construct: constructYamlNull,
|
|
2684
|
+
predicate: isNull,
|
|
2685
|
+
represent: {
|
|
2686
|
+
canonical: function() {
|
|
2687
|
+
return "~";
|
|
2688
|
+
},
|
|
2689
|
+
lowercase: function() {
|
|
2690
|
+
return "null";
|
|
2691
|
+
},
|
|
2692
|
+
uppercase: function() {
|
|
2693
|
+
return "NULL";
|
|
2694
|
+
},
|
|
2695
|
+
camelcase: function() {
|
|
2696
|
+
return "Null";
|
|
2697
|
+
},
|
|
2698
|
+
empty: function() {
|
|
2699
|
+
return "";
|
|
2700
|
+
}
|
|
2701
|
+
},
|
|
2702
|
+
defaultStyle: "lowercase"
|
|
2703
|
+
});
|
|
2704
|
+
function resolveYamlBoolean(data) {
|
|
2705
|
+
if (data === null)
|
|
2706
|
+
return false;
|
|
2707
|
+
var max = data.length;
|
|
2708
|
+
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
2709
|
+
}
|
|
2710
|
+
function constructYamlBoolean(data) {
|
|
2711
|
+
return data === "true" || data === "True" || data === "TRUE";
|
|
2712
|
+
}
|
|
2713
|
+
function isBoolean(object) {
|
|
2714
|
+
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
2715
|
+
}
|
|
2716
|
+
var bool = new type("tag:yaml.org,2002:bool", {
|
|
2717
|
+
kind: "scalar",
|
|
2718
|
+
resolve: resolveYamlBoolean,
|
|
2719
|
+
construct: constructYamlBoolean,
|
|
2720
|
+
predicate: isBoolean,
|
|
2721
|
+
represent: {
|
|
2722
|
+
lowercase: function(object) {
|
|
2723
|
+
return object ? "true" : "false";
|
|
2724
|
+
},
|
|
2725
|
+
uppercase: function(object) {
|
|
2726
|
+
return object ? "TRUE" : "FALSE";
|
|
2727
|
+
},
|
|
2728
|
+
camelcase: function(object) {
|
|
2729
|
+
return object ? "True" : "False";
|
|
2730
|
+
}
|
|
2731
|
+
},
|
|
2732
|
+
defaultStyle: "lowercase"
|
|
2733
|
+
});
|
|
2734
|
+
function isHexCode(c) {
|
|
2735
|
+
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
2736
|
+
}
|
|
2737
|
+
function isOctCode(c) {
|
|
2738
|
+
return 48 <= c && c <= 55;
|
|
2739
|
+
}
|
|
2740
|
+
function isDecCode(c) {
|
|
2741
|
+
return 48 <= c && c <= 57;
|
|
2742
|
+
}
|
|
2743
|
+
function resolveYamlInteger(data) {
|
|
2744
|
+
if (data === null)
|
|
2745
|
+
return false;
|
|
2746
|
+
var max = data.length, index = 0, hasDigits = false, ch;
|
|
2747
|
+
if (!max)
|
|
2748
|
+
return false;
|
|
2749
|
+
ch = data[index];
|
|
2750
|
+
if (ch === "-" || ch === "+") {
|
|
2751
|
+
ch = data[++index];
|
|
2752
|
+
}
|
|
2753
|
+
if (ch === "0") {
|
|
2754
|
+
if (index + 1 === max)
|
|
2755
|
+
return true;
|
|
2756
|
+
ch = data[++index];
|
|
2757
|
+
if (ch === "b") {
|
|
2758
|
+
index++;
|
|
2759
|
+
for (; index < max; index++) {
|
|
2760
|
+
ch = data[index];
|
|
2761
|
+
if (ch === "_")
|
|
2762
|
+
continue;
|
|
2763
|
+
if (ch !== "0" && ch !== "1")
|
|
2764
|
+
return false;
|
|
2765
|
+
hasDigits = true;
|
|
2766
|
+
}
|
|
2767
|
+
return hasDigits && ch !== "_";
|
|
2768
|
+
}
|
|
2769
|
+
if (ch === "x") {
|
|
2770
|
+
index++;
|
|
2771
|
+
for (; index < max; index++) {
|
|
2772
|
+
ch = data[index];
|
|
2773
|
+
if (ch === "_")
|
|
2774
|
+
continue;
|
|
2775
|
+
if (!isHexCode(data.charCodeAt(index)))
|
|
2776
|
+
return false;
|
|
2777
|
+
hasDigits = true;
|
|
2778
|
+
}
|
|
2779
|
+
return hasDigits && ch !== "_";
|
|
2780
|
+
}
|
|
2781
|
+
if (ch === "o") {
|
|
2782
|
+
index++;
|
|
2783
|
+
for (; index < max; index++) {
|
|
2784
|
+
ch = data[index];
|
|
2785
|
+
if (ch === "_")
|
|
2786
|
+
continue;
|
|
2787
|
+
if (!isOctCode(data.charCodeAt(index)))
|
|
2788
|
+
return false;
|
|
2789
|
+
hasDigits = true;
|
|
2790
|
+
}
|
|
2791
|
+
return hasDigits && ch !== "_";
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
if (ch === "_")
|
|
2795
|
+
return false;
|
|
2796
|
+
for (; index < max; index++) {
|
|
2797
|
+
ch = data[index];
|
|
2798
|
+
if (ch === "_")
|
|
2799
|
+
continue;
|
|
2800
|
+
if (!isDecCode(data.charCodeAt(index))) {
|
|
2801
|
+
return false;
|
|
2802
|
+
}
|
|
2803
|
+
hasDigits = true;
|
|
2804
|
+
}
|
|
2805
|
+
if (!hasDigits || ch === "_")
|
|
2806
|
+
return false;
|
|
2807
|
+
return true;
|
|
2808
|
+
}
|
|
2809
|
+
function constructYamlInteger(data) {
|
|
2810
|
+
var value = data, sign = 1, ch;
|
|
2811
|
+
if (value.indexOf("_") !== -1) {
|
|
2812
|
+
value = value.replace(/_/g, "");
|
|
2813
|
+
}
|
|
2814
|
+
ch = value[0];
|
|
2815
|
+
if (ch === "-" || ch === "+") {
|
|
2816
|
+
if (ch === "-")
|
|
2817
|
+
sign = -1;
|
|
2818
|
+
value = value.slice(1);
|
|
2819
|
+
ch = value[0];
|
|
2820
|
+
}
|
|
2821
|
+
if (value === "0")
|
|
2822
|
+
return 0;
|
|
2823
|
+
if (ch === "0") {
|
|
2824
|
+
if (value[1] === "b")
|
|
2825
|
+
return sign * parseInt(value.slice(2), 2);
|
|
2826
|
+
if (value[1] === "x")
|
|
2827
|
+
return sign * parseInt(value.slice(2), 16);
|
|
2828
|
+
if (value[1] === "o")
|
|
2829
|
+
return sign * parseInt(value.slice(2), 8);
|
|
2830
|
+
}
|
|
2831
|
+
return sign * parseInt(value, 10);
|
|
2832
|
+
}
|
|
2833
|
+
function isInteger(object) {
|
|
2834
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
|
2835
|
+
}
|
|
2836
|
+
var int = new type("tag:yaml.org,2002:int", {
|
|
2837
|
+
kind: "scalar",
|
|
2838
|
+
resolve: resolveYamlInteger,
|
|
2839
|
+
construct: constructYamlInteger,
|
|
2840
|
+
predicate: isInteger,
|
|
2841
|
+
represent: {
|
|
2842
|
+
binary: function(obj) {
|
|
2843
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
2844
|
+
},
|
|
2845
|
+
octal: function(obj) {
|
|
2846
|
+
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
2847
|
+
},
|
|
2848
|
+
decimal: function(obj) {
|
|
2849
|
+
return obj.toString(10);
|
|
2850
|
+
},
|
|
2851
|
+
hexadecimal: function(obj) {
|
|
2852
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
defaultStyle: "decimal",
|
|
2856
|
+
styleAliases: {
|
|
2857
|
+
binary: [2, "bin"],
|
|
2858
|
+
octal: [8, "oct"],
|
|
2859
|
+
decimal: [10, "dec"],
|
|
2860
|
+
hexadecimal: [16, "hex"]
|
|
2861
|
+
}
|
|
2862
|
+
});
|
|
2863
|
+
var YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
2864
|
+
function resolveYamlFloat(data) {
|
|
2865
|
+
if (data === null)
|
|
2866
|
+
return false;
|
|
2867
|
+
if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") {
|
|
2868
|
+
return false;
|
|
2869
|
+
}
|
|
2870
|
+
return true;
|
|
2871
|
+
}
|
|
2872
|
+
function constructYamlFloat(data) {
|
|
2873
|
+
var value, sign;
|
|
2874
|
+
value = data.replace(/_/g, "").toLowerCase();
|
|
2875
|
+
sign = value[0] === "-" ? -1 : 1;
|
|
2876
|
+
if ("+-".indexOf(value[0]) >= 0) {
|
|
2877
|
+
value = value.slice(1);
|
|
2878
|
+
}
|
|
2879
|
+
if (value === ".inf") {
|
|
2880
|
+
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
2881
|
+
} else if (value === ".nan") {
|
|
2882
|
+
return NaN;
|
|
2883
|
+
}
|
|
2884
|
+
return sign * parseFloat(value, 10);
|
|
2885
|
+
}
|
|
2886
|
+
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
2887
|
+
function representYamlFloat(object, style) {
|
|
2888
|
+
var res;
|
|
2889
|
+
if (isNaN(object)) {
|
|
2890
|
+
switch (style) {
|
|
2891
|
+
case "lowercase":
|
|
2892
|
+
return ".nan";
|
|
2893
|
+
case "uppercase":
|
|
2894
|
+
return ".NAN";
|
|
2895
|
+
case "camelcase":
|
|
2896
|
+
return ".NaN";
|
|
2897
|
+
}
|
|
2898
|
+
} else if (Number.POSITIVE_INFINITY === object) {
|
|
2899
|
+
switch (style) {
|
|
2900
|
+
case "lowercase":
|
|
2901
|
+
return ".inf";
|
|
2902
|
+
case "uppercase":
|
|
2903
|
+
return ".INF";
|
|
2904
|
+
case "camelcase":
|
|
2905
|
+
return ".Inf";
|
|
2906
|
+
}
|
|
2907
|
+
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
2908
|
+
switch (style) {
|
|
2909
|
+
case "lowercase":
|
|
2910
|
+
return "-.inf";
|
|
2911
|
+
case "uppercase":
|
|
2912
|
+
return "-.INF";
|
|
2913
|
+
case "camelcase":
|
|
2914
|
+
return "-.Inf";
|
|
2915
|
+
}
|
|
2916
|
+
} else if (common.isNegativeZero(object)) {
|
|
2917
|
+
return "-0.0";
|
|
2918
|
+
}
|
|
2919
|
+
res = object.toString(10);
|
|
2920
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
2921
|
+
}
|
|
2922
|
+
function isFloat(object) {
|
|
2923
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
2924
|
+
}
|
|
2925
|
+
var float = new type("tag:yaml.org,2002:float", {
|
|
2926
|
+
kind: "scalar",
|
|
2927
|
+
resolve: resolveYamlFloat,
|
|
2928
|
+
construct: constructYamlFloat,
|
|
2929
|
+
predicate: isFloat,
|
|
2930
|
+
represent: representYamlFloat,
|
|
2931
|
+
defaultStyle: "lowercase"
|
|
2932
|
+
});
|
|
2933
|
+
var json = failsafe.extend({
|
|
2934
|
+
implicit: [
|
|
2935
|
+
_null,
|
|
2936
|
+
bool,
|
|
2937
|
+
int,
|
|
2938
|
+
float
|
|
2939
|
+
]
|
|
2940
|
+
});
|
|
2941
|
+
var core = json;
|
|
2942
|
+
var YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
2943
|
+
var YAML_TIMESTAMP_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
2944
|
+
function resolveYamlTimestamp(data) {
|
|
2945
|
+
if (data === null)
|
|
2946
|
+
return false;
|
|
2947
|
+
if (YAML_DATE_REGEXP.exec(data) !== null)
|
|
2948
|
+
return true;
|
|
2949
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
|
|
2950
|
+
return true;
|
|
2951
|
+
return false;
|
|
2952
|
+
}
|
|
2953
|
+
function constructYamlTimestamp(data) {
|
|
2954
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
2955
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
2956
|
+
if (match === null)
|
|
2957
|
+
match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
2958
|
+
if (match === null)
|
|
2959
|
+
throw new Error("Date resolve error");
|
|
2960
|
+
year = +match[1];
|
|
2961
|
+
month = +match[2] - 1;
|
|
2962
|
+
day = +match[3];
|
|
2963
|
+
if (!match[4]) {
|
|
2964
|
+
return new Date(Date.UTC(year, month, day));
|
|
2965
|
+
}
|
|
2966
|
+
hour = +match[4];
|
|
2967
|
+
minute = +match[5];
|
|
2968
|
+
second = +match[6];
|
|
2969
|
+
if (match[7]) {
|
|
2970
|
+
fraction = match[7].slice(0, 3);
|
|
2971
|
+
while (fraction.length < 3) {
|
|
2972
|
+
fraction += "0";
|
|
2973
|
+
}
|
|
2974
|
+
fraction = +fraction;
|
|
2975
|
+
}
|
|
2976
|
+
if (match[9]) {
|
|
2977
|
+
tz_hour = +match[10];
|
|
2978
|
+
tz_minute = +(match[11] || 0);
|
|
2979
|
+
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
2980
|
+
if (match[9] === "-")
|
|
2981
|
+
delta = -delta;
|
|
2982
|
+
}
|
|
2983
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
2984
|
+
if (delta)
|
|
2985
|
+
date.setTime(date.getTime() - delta);
|
|
2986
|
+
return date;
|
|
2987
|
+
}
|
|
2988
|
+
function representYamlTimestamp(object) {
|
|
2989
|
+
return object.toISOString();
|
|
2990
|
+
}
|
|
2991
|
+
var timestamp = new type("tag:yaml.org,2002:timestamp", {
|
|
2992
|
+
kind: "scalar",
|
|
2993
|
+
resolve: resolveYamlTimestamp,
|
|
2994
|
+
construct: constructYamlTimestamp,
|
|
2995
|
+
instanceOf: Date,
|
|
2996
|
+
represent: representYamlTimestamp
|
|
2997
|
+
});
|
|
2998
|
+
function resolveYamlMerge(data) {
|
|
2999
|
+
return data === "<<" || data === null;
|
|
3000
|
+
}
|
|
3001
|
+
var merge = new type("tag:yaml.org,2002:merge", {
|
|
3002
|
+
kind: "scalar",
|
|
3003
|
+
resolve: resolveYamlMerge
|
|
3004
|
+
});
|
|
3005
|
+
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
3006
|
+
function resolveYamlBinary(data) {
|
|
3007
|
+
if (data === null)
|
|
3008
|
+
return false;
|
|
3009
|
+
var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
|
|
3010
|
+
for (idx = 0; idx < max; idx++) {
|
|
3011
|
+
code = map2.indexOf(data.charAt(idx));
|
|
3012
|
+
if (code > 64)
|
|
3013
|
+
continue;
|
|
3014
|
+
if (code < 0)
|
|
3015
|
+
return false;
|
|
3016
|
+
bitlen += 6;
|
|
3017
|
+
}
|
|
3018
|
+
return bitlen % 8 === 0;
|
|
3019
|
+
}
|
|
3020
|
+
function constructYamlBinary(data) {
|
|
3021
|
+
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
|
|
3022
|
+
for (idx = 0; idx < max; idx++) {
|
|
3023
|
+
if (idx % 4 === 0 && idx) {
|
|
3024
|
+
result.push(bits >> 16 & 255);
|
|
3025
|
+
result.push(bits >> 8 & 255);
|
|
3026
|
+
result.push(bits & 255);
|
|
3027
|
+
}
|
|
3028
|
+
bits = bits << 6 | map2.indexOf(input.charAt(idx));
|
|
3029
|
+
}
|
|
3030
|
+
tailbits = max % 4 * 6;
|
|
3031
|
+
if (tailbits === 0) {
|
|
3032
|
+
result.push(bits >> 16 & 255);
|
|
3033
|
+
result.push(bits >> 8 & 255);
|
|
3034
|
+
result.push(bits & 255);
|
|
3035
|
+
} else if (tailbits === 18) {
|
|
3036
|
+
result.push(bits >> 10 & 255);
|
|
3037
|
+
result.push(bits >> 2 & 255);
|
|
3038
|
+
} else if (tailbits === 12) {
|
|
3039
|
+
result.push(bits >> 4 & 255);
|
|
3040
|
+
}
|
|
3041
|
+
return new Uint8Array(result);
|
|
3042
|
+
}
|
|
3043
|
+
function representYamlBinary(object) {
|
|
3044
|
+
var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
|
|
3045
|
+
for (idx = 0; idx < max; idx++) {
|
|
3046
|
+
if (idx % 3 === 0 && idx) {
|
|
3047
|
+
result += map2[bits >> 18 & 63];
|
|
3048
|
+
result += map2[bits >> 12 & 63];
|
|
3049
|
+
result += map2[bits >> 6 & 63];
|
|
3050
|
+
result += map2[bits & 63];
|
|
3051
|
+
}
|
|
3052
|
+
bits = (bits << 8) + object[idx];
|
|
3053
|
+
}
|
|
3054
|
+
tail = max % 3;
|
|
3055
|
+
if (tail === 0) {
|
|
3056
|
+
result += map2[bits >> 18 & 63];
|
|
3057
|
+
result += map2[bits >> 12 & 63];
|
|
3058
|
+
result += map2[bits >> 6 & 63];
|
|
3059
|
+
result += map2[bits & 63];
|
|
3060
|
+
} else if (tail === 2) {
|
|
3061
|
+
result += map2[bits >> 10 & 63];
|
|
3062
|
+
result += map2[bits >> 4 & 63];
|
|
3063
|
+
result += map2[bits << 2 & 63];
|
|
3064
|
+
result += map2[64];
|
|
3065
|
+
} else if (tail === 1) {
|
|
3066
|
+
result += map2[bits >> 2 & 63];
|
|
3067
|
+
result += map2[bits << 4 & 63];
|
|
3068
|
+
result += map2[64];
|
|
3069
|
+
result += map2[64];
|
|
3070
|
+
}
|
|
3071
|
+
return result;
|
|
3072
|
+
}
|
|
3073
|
+
function isBinary(obj) {
|
|
3074
|
+
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
|
3075
|
+
}
|
|
3076
|
+
var binary = new type("tag:yaml.org,2002:binary", {
|
|
3077
|
+
kind: "scalar",
|
|
3078
|
+
resolve: resolveYamlBinary,
|
|
3079
|
+
construct: constructYamlBinary,
|
|
3080
|
+
predicate: isBinary,
|
|
3081
|
+
represent: representYamlBinary
|
|
3082
|
+
});
|
|
3083
|
+
var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
3084
|
+
var _toString$2 = Object.prototype.toString;
|
|
3085
|
+
function resolveYamlOmap(data) {
|
|
3086
|
+
if (data === null)
|
|
3087
|
+
return true;
|
|
3088
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
3089
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3090
|
+
pair = object[index];
|
|
3091
|
+
pairHasKey = false;
|
|
3092
|
+
if (_toString$2.call(pair) !== "[object Object]")
|
|
3093
|
+
return false;
|
|
3094
|
+
for (pairKey in pair) {
|
|
3095
|
+
if (_hasOwnProperty$3.call(pair, pairKey)) {
|
|
3096
|
+
if (!pairHasKey)
|
|
3097
|
+
pairHasKey = true;
|
|
3098
|
+
else
|
|
3099
|
+
return false;
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
if (!pairHasKey)
|
|
3103
|
+
return false;
|
|
3104
|
+
if (objectKeys.indexOf(pairKey) === -1)
|
|
3105
|
+
objectKeys.push(pairKey);
|
|
3106
|
+
else
|
|
3107
|
+
return false;
|
|
3108
|
+
}
|
|
3109
|
+
return true;
|
|
3110
|
+
}
|
|
3111
|
+
function constructYamlOmap(data) {
|
|
3112
|
+
return data !== null ? data : [];
|
|
3113
|
+
}
|
|
3114
|
+
var omap = new type("tag:yaml.org,2002:omap", {
|
|
3115
|
+
kind: "sequence",
|
|
3116
|
+
resolve: resolveYamlOmap,
|
|
3117
|
+
construct: constructYamlOmap
|
|
3118
|
+
});
|
|
3119
|
+
var _toString$1 = Object.prototype.toString;
|
|
3120
|
+
function resolveYamlPairs(data) {
|
|
3121
|
+
if (data === null)
|
|
3122
|
+
return true;
|
|
3123
|
+
var index, length, pair, keys, result, object = data;
|
|
3124
|
+
result = new Array(object.length);
|
|
3125
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3126
|
+
pair = object[index];
|
|
3127
|
+
if (_toString$1.call(pair) !== "[object Object]")
|
|
3128
|
+
return false;
|
|
3129
|
+
keys = Object.keys(pair);
|
|
3130
|
+
if (keys.length !== 1)
|
|
3131
|
+
return false;
|
|
3132
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
3133
|
+
}
|
|
3134
|
+
return true;
|
|
3135
|
+
}
|
|
3136
|
+
function constructYamlPairs(data) {
|
|
3137
|
+
if (data === null)
|
|
3138
|
+
return [];
|
|
3139
|
+
var index, length, pair, keys, result, object = data;
|
|
3140
|
+
result = new Array(object.length);
|
|
3141
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3142
|
+
pair = object[index];
|
|
3143
|
+
keys = Object.keys(pair);
|
|
3144
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
3145
|
+
}
|
|
3146
|
+
return result;
|
|
3147
|
+
}
|
|
3148
|
+
var pairs = new type("tag:yaml.org,2002:pairs", {
|
|
3149
|
+
kind: "sequence",
|
|
3150
|
+
resolve: resolveYamlPairs,
|
|
3151
|
+
construct: constructYamlPairs
|
|
3152
|
+
});
|
|
3153
|
+
var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
3154
|
+
function resolveYamlSet(data) {
|
|
3155
|
+
if (data === null)
|
|
3156
|
+
return true;
|
|
3157
|
+
var key, object = data;
|
|
3158
|
+
for (key in object) {
|
|
3159
|
+
if (_hasOwnProperty$2.call(object, key)) {
|
|
3160
|
+
if (object[key] !== null)
|
|
3161
|
+
return false;
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
return true;
|
|
3165
|
+
}
|
|
3166
|
+
function constructYamlSet(data) {
|
|
3167
|
+
return data !== null ? data : {};
|
|
3168
|
+
}
|
|
3169
|
+
var set = new type("tag:yaml.org,2002:set", {
|
|
3170
|
+
kind: "mapping",
|
|
3171
|
+
resolve: resolveYamlSet,
|
|
3172
|
+
construct: constructYamlSet
|
|
3173
|
+
});
|
|
3174
|
+
var _default = core.extend({
|
|
3175
|
+
implicit: [
|
|
3176
|
+
timestamp,
|
|
3177
|
+
merge
|
|
3178
|
+
],
|
|
3179
|
+
explicit: [
|
|
3180
|
+
binary,
|
|
3181
|
+
omap,
|
|
3182
|
+
pairs,
|
|
3183
|
+
set
|
|
3184
|
+
]
|
|
3185
|
+
});
|
|
3186
|
+
var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
3187
|
+
var CONTEXT_FLOW_IN = 1;
|
|
3188
|
+
var CONTEXT_FLOW_OUT = 2;
|
|
3189
|
+
var CONTEXT_BLOCK_IN = 3;
|
|
3190
|
+
var CONTEXT_BLOCK_OUT = 4;
|
|
3191
|
+
var CHOMPING_CLIP = 1;
|
|
3192
|
+
var CHOMPING_STRIP = 2;
|
|
3193
|
+
var CHOMPING_KEEP = 3;
|
|
3194
|
+
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
3195
|
+
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
3196
|
+
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
3197
|
+
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
3198
|
+
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
3199
|
+
function _class(obj) {
|
|
3200
|
+
return Object.prototype.toString.call(obj);
|
|
3201
|
+
}
|
|
3202
|
+
function is_EOL(c) {
|
|
3203
|
+
return c === 10 || c === 13;
|
|
3204
|
+
}
|
|
3205
|
+
function is_WHITE_SPACE(c) {
|
|
3206
|
+
return c === 9 || c === 32;
|
|
3207
|
+
}
|
|
3208
|
+
function is_WS_OR_EOL(c) {
|
|
3209
|
+
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
3210
|
+
}
|
|
3211
|
+
function is_FLOW_INDICATOR(c) {
|
|
3212
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
3213
|
+
}
|
|
3214
|
+
function fromHexCode(c) {
|
|
3215
|
+
var lc;
|
|
3216
|
+
if (48 <= c && c <= 57) {
|
|
3217
|
+
return c - 48;
|
|
3218
|
+
}
|
|
3219
|
+
lc = c | 32;
|
|
3220
|
+
if (97 <= lc && lc <= 102) {
|
|
3221
|
+
return lc - 97 + 10;
|
|
3222
|
+
}
|
|
3223
|
+
return -1;
|
|
3224
|
+
}
|
|
3225
|
+
function escapedHexLen(c) {
|
|
3226
|
+
if (c === 120) {
|
|
3227
|
+
return 2;
|
|
3228
|
+
}
|
|
3229
|
+
if (c === 117) {
|
|
3230
|
+
return 4;
|
|
3231
|
+
}
|
|
3232
|
+
if (c === 85) {
|
|
3233
|
+
return 8;
|
|
3234
|
+
}
|
|
3235
|
+
return 0;
|
|
3236
|
+
}
|
|
3237
|
+
function fromDecimalCode(c) {
|
|
3238
|
+
if (48 <= c && c <= 57) {
|
|
3239
|
+
return c - 48;
|
|
3240
|
+
}
|
|
3241
|
+
return -1;
|
|
3242
|
+
}
|
|
3243
|
+
function simpleEscapeSequence(c) {
|
|
3244
|
+
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
|
3245
|
+
}
|
|
3246
|
+
function charFromCodepoint(c) {
|
|
3247
|
+
if (c <= 65535) {
|
|
3248
|
+
return String.fromCharCode(c);
|
|
3249
|
+
}
|
|
3250
|
+
return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
|
|
3251
|
+
}
|
|
3252
|
+
var simpleEscapeCheck = new Array(256);
|
|
3253
|
+
var simpleEscapeMap = new Array(256);
|
|
3254
|
+
for (i = 0; i < 256; i++) {
|
|
3255
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
3256
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
3257
|
+
}
|
|
3258
|
+
var i;
|
|
3259
|
+
function State$1(input, options) {
|
|
3260
|
+
this.input = input;
|
|
3261
|
+
this.filename = options["filename"] || null;
|
|
3262
|
+
this.schema = options["schema"] || _default;
|
|
3263
|
+
this.onWarning = options["onWarning"] || null;
|
|
3264
|
+
this.legacy = options["legacy"] || false;
|
|
3265
|
+
this.json = options["json"] || false;
|
|
3266
|
+
this.listener = options["listener"] || null;
|
|
3267
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
3268
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
3269
|
+
this.length = input.length;
|
|
3270
|
+
this.position = 0;
|
|
3271
|
+
this.line = 0;
|
|
3272
|
+
this.lineStart = 0;
|
|
3273
|
+
this.lineIndent = 0;
|
|
3274
|
+
this.firstTabInLine = -1;
|
|
3275
|
+
this.documents = [];
|
|
3276
|
+
}
|
|
3277
|
+
function generateError(state, message) {
|
|
3278
|
+
var mark = {
|
|
3279
|
+
name: state.filename,
|
|
3280
|
+
buffer: state.input.slice(0, -1),
|
|
3281
|
+
position: state.position,
|
|
3282
|
+
line: state.line,
|
|
3283
|
+
column: state.position - state.lineStart
|
|
3284
|
+
};
|
|
3285
|
+
mark.snippet = snippet(mark);
|
|
3286
|
+
return new exception(message, mark);
|
|
3287
|
+
}
|
|
3288
|
+
function throwError(state, message) {
|
|
3289
|
+
throw generateError(state, message);
|
|
3290
|
+
}
|
|
3291
|
+
function throwWarning(state, message) {
|
|
3292
|
+
if (state.onWarning) {
|
|
3293
|
+
state.onWarning.call(null, generateError(state, message));
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
var directiveHandlers = {
|
|
3297
|
+
YAML: function handleYamlDirective(state, name, args) {
|
|
3298
|
+
var match, major, minor;
|
|
3299
|
+
if (state.version !== null) {
|
|
3300
|
+
throwError(state, "duplication of %YAML directive");
|
|
3301
|
+
}
|
|
3302
|
+
if (args.length !== 1) {
|
|
3303
|
+
throwError(state, "YAML directive accepts exactly one argument");
|
|
3304
|
+
}
|
|
3305
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
3306
|
+
if (match === null) {
|
|
3307
|
+
throwError(state, "ill-formed argument of the YAML directive");
|
|
3308
|
+
}
|
|
3309
|
+
major = parseInt(match[1], 10);
|
|
3310
|
+
minor = parseInt(match[2], 10);
|
|
3311
|
+
if (major !== 1) {
|
|
3312
|
+
throwError(state, "unacceptable YAML version of the document");
|
|
3313
|
+
}
|
|
3314
|
+
state.version = args[0];
|
|
3315
|
+
state.checkLineBreaks = minor < 2;
|
|
3316
|
+
if (minor !== 1 && minor !== 2) {
|
|
3317
|
+
throwWarning(state, "unsupported YAML version of the document");
|
|
3318
|
+
}
|
|
3319
|
+
},
|
|
3320
|
+
TAG: function handleTagDirective(state, name, args) {
|
|
3321
|
+
var handle, prefix;
|
|
3322
|
+
if (args.length !== 2) {
|
|
3323
|
+
throwError(state, "TAG directive accepts exactly two arguments");
|
|
3324
|
+
}
|
|
3325
|
+
handle = args[0];
|
|
3326
|
+
prefix = args[1];
|
|
3327
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
3328
|
+
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
3329
|
+
}
|
|
3330
|
+
if (_hasOwnProperty$1.call(state.tagMap, handle)) {
|
|
3331
|
+
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
3332
|
+
}
|
|
3333
|
+
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
3334
|
+
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
3335
|
+
}
|
|
3336
|
+
try {
|
|
3337
|
+
prefix = decodeURIComponent(prefix);
|
|
3338
|
+
} catch (err) {
|
|
3339
|
+
throwError(state, "tag prefix is malformed: " + prefix);
|
|
3340
|
+
}
|
|
3341
|
+
state.tagMap[handle] = prefix;
|
|
3342
|
+
}
|
|
3343
|
+
};
|
|
3344
|
+
function captureSegment(state, start, end, checkJson) {
|
|
3345
|
+
var _position, _length, _character, _result;
|
|
3346
|
+
if (start < end) {
|
|
3347
|
+
_result = state.input.slice(start, end);
|
|
3348
|
+
if (checkJson) {
|
|
3349
|
+
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
3350
|
+
_character = _result.charCodeAt(_position);
|
|
3351
|
+
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
3352
|
+
throwError(state, "expected valid JSON character");
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
3356
|
+
throwError(state, "the stream contains non-printable characters");
|
|
3357
|
+
}
|
|
3358
|
+
state.result += _result;
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
function mergeMappings(state, destination, source, overridableKeys) {
|
|
3362
|
+
var sourceKeys, key, index, quantity;
|
|
3363
|
+
if (!common.isObject(source)) {
|
|
3364
|
+
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
3365
|
+
}
|
|
3366
|
+
sourceKeys = Object.keys(source);
|
|
3367
|
+
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
3368
|
+
key = sourceKeys[index];
|
|
3369
|
+
if (!_hasOwnProperty$1.call(destination, key)) {
|
|
3370
|
+
destination[key] = source[key];
|
|
3371
|
+
overridableKeys[key] = true;
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3375
|
+
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
3376
|
+
var index, quantity;
|
|
3377
|
+
if (Array.isArray(keyNode)) {
|
|
3378
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
3379
|
+
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
3380
|
+
if (Array.isArray(keyNode[index])) {
|
|
3381
|
+
throwError(state, "nested arrays are not supported inside keys");
|
|
3382
|
+
}
|
|
3383
|
+
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
3384
|
+
keyNode[index] = "[object Object]";
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
}
|
|
3388
|
+
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
3389
|
+
keyNode = "[object Object]";
|
|
3390
|
+
}
|
|
3391
|
+
keyNode = String(keyNode);
|
|
3392
|
+
if (_result === null) {
|
|
3393
|
+
_result = {};
|
|
3394
|
+
}
|
|
3395
|
+
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
3396
|
+
if (Array.isArray(valueNode)) {
|
|
3397
|
+
for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
3398
|
+
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
3399
|
+
}
|
|
3400
|
+
} else {
|
|
3401
|
+
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
3402
|
+
}
|
|
3403
|
+
} else {
|
|
3404
|
+
if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
|
|
3405
|
+
state.line = startLine || state.line;
|
|
3406
|
+
state.lineStart = startLineStart || state.lineStart;
|
|
3407
|
+
state.position = startPos || state.position;
|
|
3408
|
+
throwError(state, "duplicated mapping key");
|
|
3409
|
+
}
|
|
3410
|
+
if (keyNode === "__proto__") {
|
|
3411
|
+
Object.defineProperty(_result, keyNode, {
|
|
3412
|
+
configurable: true,
|
|
3413
|
+
enumerable: true,
|
|
3414
|
+
writable: true,
|
|
3415
|
+
value: valueNode
|
|
3416
|
+
});
|
|
3417
|
+
} else {
|
|
3418
|
+
_result[keyNode] = valueNode;
|
|
3419
|
+
}
|
|
3420
|
+
delete overridableKeys[keyNode];
|
|
3421
|
+
}
|
|
3422
|
+
return _result;
|
|
3423
|
+
}
|
|
3424
|
+
function readLineBreak(state) {
|
|
3425
|
+
var ch;
|
|
3426
|
+
ch = state.input.charCodeAt(state.position);
|
|
3427
|
+
if (ch === 10) {
|
|
3428
|
+
state.position++;
|
|
3429
|
+
} else if (ch === 13) {
|
|
3430
|
+
state.position++;
|
|
3431
|
+
if (state.input.charCodeAt(state.position) === 10) {
|
|
3432
|
+
state.position++;
|
|
3433
|
+
}
|
|
3434
|
+
} else {
|
|
3435
|
+
throwError(state, "a line break is expected");
|
|
3436
|
+
}
|
|
3437
|
+
state.line += 1;
|
|
3438
|
+
state.lineStart = state.position;
|
|
3439
|
+
state.firstTabInLine = -1;
|
|
3440
|
+
}
|
|
3441
|
+
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
3442
|
+
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
3443
|
+
while (ch !== 0) {
|
|
3444
|
+
while (is_WHITE_SPACE(ch)) {
|
|
3445
|
+
if (ch === 9 && state.firstTabInLine === -1) {
|
|
3446
|
+
state.firstTabInLine = state.position;
|
|
3447
|
+
}
|
|
3448
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3449
|
+
}
|
|
3450
|
+
if (allowComments && ch === 35) {
|
|
3451
|
+
do {
|
|
3452
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3453
|
+
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
3454
|
+
}
|
|
3455
|
+
if (is_EOL(ch)) {
|
|
3456
|
+
readLineBreak(state);
|
|
3457
|
+
ch = state.input.charCodeAt(state.position);
|
|
3458
|
+
lineBreaks++;
|
|
3459
|
+
state.lineIndent = 0;
|
|
3460
|
+
while (ch === 32) {
|
|
3461
|
+
state.lineIndent++;
|
|
3462
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3463
|
+
}
|
|
3464
|
+
} else {
|
|
3465
|
+
break;
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
3469
|
+
throwWarning(state, "deficient indentation");
|
|
3470
|
+
}
|
|
3471
|
+
return lineBreaks;
|
|
3472
|
+
}
|
|
3473
|
+
function testDocumentSeparator(state) {
|
|
3474
|
+
var _position = state.position, ch;
|
|
3475
|
+
ch = state.input.charCodeAt(_position);
|
|
3476
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
3477
|
+
_position += 3;
|
|
3478
|
+
ch = state.input.charCodeAt(_position);
|
|
3479
|
+
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
3480
|
+
return true;
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
return false;
|
|
3484
|
+
}
|
|
3485
|
+
function writeFoldedLines(state, count) {
|
|
3486
|
+
if (count === 1) {
|
|
3487
|
+
state.result += " ";
|
|
3488
|
+
} else if (count > 1) {
|
|
3489
|
+
state.result += common.repeat("\n", count - 1);
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
3493
|
+
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
3494
|
+
ch = state.input.charCodeAt(state.position);
|
|
3495
|
+
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
|
3496
|
+
return false;
|
|
3497
|
+
}
|
|
3498
|
+
if (ch === 63 || ch === 45) {
|
|
3499
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3500
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
3501
|
+
return false;
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
state.kind = "scalar";
|
|
3505
|
+
state.result = "";
|
|
3506
|
+
captureStart = captureEnd = state.position;
|
|
3507
|
+
hasPendingContent = false;
|
|
3508
|
+
while (ch !== 0) {
|
|
3509
|
+
if (ch === 58) {
|
|
3510
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3511
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
3512
|
+
break;
|
|
3513
|
+
}
|
|
3514
|
+
} else if (ch === 35) {
|
|
3515
|
+
preceding = state.input.charCodeAt(state.position - 1);
|
|
3516
|
+
if (is_WS_OR_EOL(preceding)) {
|
|
3517
|
+
break;
|
|
3518
|
+
}
|
|
3519
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
3520
|
+
break;
|
|
3521
|
+
} else if (is_EOL(ch)) {
|
|
3522
|
+
_line = state.line;
|
|
3523
|
+
_lineStart = state.lineStart;
|
|
3524
|
+
_lineIndent = state.lineIndent;
|
|
3525
|
+
skipSeparationSpace(state, false, -1);
|
|
3526
|
+
if (state.lineIndent >= nodeIndent) {
|
|
3527
|
+
hasPendingContent = true;
|
|
3528
|
+
ch = state.input.charCodeAt(state.position);
|
|
3529
|
+
continue;
|
|
3530
|
+
} else {
|
|
3531
|
+
state.position = captureEnd;
|
|
3532
|
+
state.line = _line;
|
|
3533
|
+
state.lineStart = _lineStart;
|
|
3534
|
+
state.lineIndent = _lineIndent;
|
|
3535
|
+
break;
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
if (hasPendingContent) {
|
|
3539
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
3540
|
+
writeFoldedLines(state, state.line - _line);
|
|
3541
|
+
captureStart = captureEnd = state.position;
|
|
3542
|
+
hasPendingContent = false;
|
|
3543
|
+
}
|
|
3544
|
+
if (!is_WHITE_SPACE(ch)) {
|
|
3545
|
+
captureEnd = state.position + 1;
|
|
3546
|
+
}
|
|
3547
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3548
|
+
}
|
|
3549
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
3550
|
+
if (state.result) {
|
|
3551
|
+
return true;
|
|
3552
|
+
}
|
|
3553
|
+
state.kind = _kind;
|
|
3554
|
+
state.result = _result;
|
|
3555
|
+
return false;
|
|
3556
|
+
}
|
|
3557
|
+
function readSingleQuotedScalar(state, nodeIndent) {
|
|
3558
|
+
var ch, captureStart, captureEnd;
|
|
3559
|
+
ch = state.input.charCodeAt(state.position);
|
|
3560
|
+
if (ch !== 39) {
|
|
3561
|
+
return false;
|
|
3562
|
+
}
|
|
3563
|
+
state.kind = "scalar";
|
|
3564
|
+
state.result = "";
|
|
3565
|
+
state.position++;
|
|
3566
|
+
captureStart = captureEnd = state.position;
|
|
3567
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
3568
|
+
if (ch === 39) {
|
|
3569
|
+
captureSegment(state, captureStart, state.position, true);
|
|
3570
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3571
|
+
if (ch === 39) {
|
|
3572
|
+
captureStart = state.position;
|
|
3573
|
+
state.position++;
|
|
3574
|
+
captureEnd = state.position;
|
|
3575
|
+
} else {
|
|
3576
|
+
return true;
|
|
3577
|
+
}
|
|
3578
|
+
} else if (is_EOL(ch)) {
|
|
3579
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
3580
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
3581
|
+
captureStart = captureEnd = state.position;
|
|
3582
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
3583
|
+
throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
3584
|
+
} else {
|
|
3585
|
+
state.position++;
|
|
3586
|
+
captureEnd = state.position;
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
3590
|
+
}
|
|
3591
|
+
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
3592
|
+
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
3593
|
+
ch = state.input.charCodeAt(state.position);
|
|
3594
|
+
if (ch !== 34) {
|
|
3595
|
+
return false;
|
|
3596
|
+
}
|
|
3597
|
+
state.kind = "scalar";
|
|
3598
|
+
state.result = "";
|
|
3599
|
+
state.position++;
|
|
3600
|
+
captureStart = captureEnd = state.position;
|
|
3601
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
3602
|
+
if (ch === 34) {
|
|
3603
|
+
captureSegment(state, captureStart, state.position, true);
|
|
3604
|
+
state.position++;
|
|
3605
|
+
return true;
|
|
3606
|
+
} else if (ch === 92) {
|
|
3607
|
+
captureSegment(state, captureStart, state.position, true);
|
|
3608
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3609
|
+
if (is_EOL(ch)) {
|
|
3610
|
+
skipSeparationSpace(state, false, nodeIndent);
|
|
3611
|
+
} else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
3612
|
+
state.result += simpleEscapeMap[ch];
|
|
3613
|
+
state.position++;
|
|
3614
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
3615
|
+
hexLength = tmp;
|
|
3616
|
+
hexResult = 0;
|
|
3617
|
+
for (; hexLength > 0; hexLength--) {
|
|
3618
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3619
|
+
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
3620
|
+
hexResult = (hexResult << 4) + tmp;
|
|
3621
|
+
} else {
|
|
3622
|
+
throwError(state, "expected hexadecimal character");
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
state.result += charFromCodepoint(hexResult);
|
|
3626
|
+
state.position++;
|
|
3627
|
+
} else {
|
|
3628
|
+
throwError(state, "unknown escape sequence");
|
|
3629
|
+
}
|
|
3630
|
+
captureStart = captureEnd = state.position;
|
|
3631
|
+
} else if (is_EOL(ch)) {
|
|
3632
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
3633
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
3634
|
+
captureStart = captureEnd = state.position;
|
|
3635
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
3636
|
+
throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
3637
|
+
} else {
|
|
3638
|
+
state.position++;
|
|
3639
|
+
captureEnd = state.position;
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
3643
|
+
}
|
|
3644
|
+
function readFlowCollection(state, nodeIndent) {
|
|
3645
|
+
var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch;
|
|
3646
|
+
ch = state.input.charCodeAt(state.position);
|
|
3647
|
+
if (ch === 91) {
|
|
3648
|
+
terminator = 93;
|
|
3649
|
+
isMapping = false;
|
|
3650
|
+
_result = [];
|
|
3651
|
+
} else if (ch === 123) {
|
|
3652
|
+
terminator = 125;
|
|
3653
|
+
isMapping = true;
|
|
3654
|
+
_result = {};
|
|
3655
|
+
} else {
|
|
3656
|
+
return false;
|
|
3657
|
+
}
|
|
3658
|
+
if (state.anchor !== null) {
|
|
3659
|
+
state.anchorMap[state.anchor] = _result;
|
|
3660
|
+
}
|
|
3661
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3662
|
+
while (ch !== 0) {
|
|
3663
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3664
|
+
ch = state.input.charCodeAt(state.position);
|
|
3665
|
+
if (ch === terminator) {
|
|
3666
|
+
state.position++;
|
|
3667
|
+
state.tag = _tag;
|
|
3668
|
+
state.anchor = _anchor;
|
|
3669
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
3670
|
+
state.result = _result;
|
|
3671
|
+
return true;
|
|
3672
|
+
} else if (!readNext) {
|
|
3673
|
+
throwError(state, "missed comma between flow collection entries");
|
|
3674
|
+
} else if (ch === 44) {
|
|
3675
|
+
throwError(state, "expected the node content, but found ','");
|
|
3676
|
+
}
|
|
3677
|
+
keyTag = keyNode = valueNode = null;
|
|
3678
|
+
isPair = isExplicitPair = false;
|
|
3679
|
+
if (ch === 63) {
|
|
3680
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3681
|
+
if (is_WS_OR_EOL(following)) {
|
|
3682
|
+
isPair = isExplicitPair = true;
|
|
3683
|
+
state.position++;
|
|
3684
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3685
|
+
}
|
|
3686
|
+
}
|
|
3687
|
+
_line = state.line;
|
|
3688
|
+
_lineStart = state.lineStart;
|
|
3689
|
+
_pos = state.position;
|
|
3690
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
3691
|
+
keyTag = state.tag;
|
|
3692
|
+
keyNode = state.result;
|
|
3693
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3694
|
+
ch = state.input.charCodeAt(state.position);
|
|
3695
|
+
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
3696
|
+
isPair = true;
|
|
3697
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3698
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3699
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
3700
|
+
valueNode = state.result;
|
|
3701
|
+
}
|
|
3702
|
+
if (isMapping) {
|
|
3703
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
3704
|
+
} else if (isPair) {
|
|
3705
|
+
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
3706
|
+
} else {
|
|
3707
|
+
_result.push(keyNode);
|
|
3708
|
+
}
|
|
3709
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3710
|
+
ch = state.input.charCodeAt(state.position);
|
|
3711
|
+
if (ch === 44) {
|
|
3712
|
+
readNext = true;
|
|
3713
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3714
|
+
} else {
|
|
3715
|
+
readNext = false;
|
|
3716
|
+
}
|
|
3717
|
+
}
|
|
3718
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
3719
|
+
}
|
|
3720
|
+
function readBlockScalar(state, nodeIndent) {
|
|
3721
|
+
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
3722
|
+
ch = state.input.charCodeAt(state.position);
|
|
3723
|
+
if (ch === 124) {
|
|
3724
|
+
folding = false;
|
|
3725
|
+
} else if (ch === 62) {
|
|
3726
|
+
folding = true;
|
|
3727
|
+
} else {
|
|
3728
|
+
return false;
|
|
3729
|
+
}
|
|
3730
|
+
state.kind = "scalar";
|
|
3731
|
+
state.result = "";
|
|
3732
|
+
while (ch !== 0) {
|
|
3733
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3734
|
+
if (ch === 43 || ch === 45) {
|
|
3735
|
+
if (CHOMPING_CLIP === chomping) {
|
|
3736
|
+
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
3737
|
+
} else {
|
|
3738
|
+
throwError(state, "repeat of a chomping mode identifier");
|
|
3739
|
+
}
|
|
3740
|
+
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
3741
|
+
if (tmp === 0) {
|
|
3742
|
+
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
3743
|
+
} else if (!detectedIndent) {
|
|
3744
|
+
textIndent = nodeIndent + tmp - 1;
|
|
3745
|
+
detectedIndent = true;
|
|
3746
|
+
} else {
|
|
3747
|
+
throwError(state, "repeat of an indentation width identifier");
|
|
3748
|
+
}
|
|
3749
|
+
} else {
|
|
3750
|
+
break;
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
if (is_WHITE_SPACE(ch)) {
|
|
3754
|
+
do {
|
|
3755
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3756
|
+
} while (is_WHITE_SPACE(ch));
|
|
3757
|
+
if (ch === 35) {
|
|
3758
|
+
do {
|
|
3759
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3760
|
+
} while (!is_EOL(ch) && ch !== 0);
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
while (ch !== 0) {
|
|
3764
|
+
readLineBreak(state);
|
|
3765
|
+
state.lineIndent = 0;
|
|
3766
|
+
ch = state.input.charCodeAt(state.position);
|
|
3767
|
+
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
3768
|
+
state.lineIndent++;
|
|
3769
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3770
|
+
}
|
|
3771
|
+
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
3772
|
+
textIndent = state.lineIndent;
|
|
3773
|
+
}
|
|
3774
|
+
if (is_EOL(ch)) {
|
|
3775
|
+
emptyLines++;
|
|
3776
|
+
continue;
|
|
3777
|
+
}
|
|
3778
|
+
if (state.lineIndent < textIndent) {
|
|
3779
|
+
if (chomping === CHOMPING_KEEP) {
|
|
3780
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
3781
|
+
} else if (chomping === CHOMPING_CLIP) {
|
|
3782
|
+
if (didReadContent) {
|
|
3783
|
+
state.result += "\n";
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
break;
|
|
3787
|
+
}
|
|
3788
|
+
if (folding) {
|
|
3789
|
+
if (is_WHITE_SPACE(ch)) {
|
|
3790
|
+
atMoreIndented = true;
|
|
3791
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
3792
|
+
} else if (atMoreIndented) {
|
|
3793
|
+
atMoreIndented = false;
|
|
3794
|
+
state.result += common.repeat("\n", emptyLines + 1);
|
|
3795
|
+
} else if (emptyLines === 0) {
|
|
3796
|
+
if (didReadContent) {
|
|
3797
|
+
state.result += " ";
|
|
3798
|
+
}
|
|
3799
|
+
} else {
|
|
3800
|
+
state.result += common.repeat("\n", emptyLines);
|
|
3801
|
+
}
|
|
3802
|
+
} else {
|
|
3803
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
3804
|
+
}
|
|
3805
|
+
didReadContent = true;
|
|
3806
|
+
detectedIndent = true;
|
|
3807
|
+
emptyLines = 0;
|
|
3808
|
+
captureStart = state.position;
|
|
3809
|
+
while (!is_EOL(ch) && ch !== 0) {
|
|
3810
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3811
|
+
}
|
|
3812
|
+
captureSegment(state, captureStart, state.position, false);
|
|
3813
|
+
}
|
|
3814
|
+
return true;
|
|
3815
|
+
}
|
|
3816
|
+
function readBlockSequence(state, nodeIndent) {
|
|
3817
|
+
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
3818
|
+
if (state.firstTabInLine !== -1)
|
|
3819
|
+
return false;
|
|
3820
|
+
if (state.anchor !== null) {
|
|
3821
|
+
state.anchorMap[state.anchor] = _result;
|
|
3822
|
+
}
|
|
3823
|
+
ch = state.input.charCodeAt(state.position);
|
|
3824
|
+
while (ch !== 0) {
|
|
3825
|
+
if (state.firstTabInLine !== -1) {
|
|
3826
|
+
state.position = state.firstTabInLine;
|
|
3827
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
3828
|
+
}
|
|
3829
|
+
if (ch !== 45) {
|
|
3830
|
+
break;
|
|
3831
|
+
}
|
|
3832
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3833
|
+
if (!is_WS_OR_EOL(following)) {
|
|
3834
|
+
break;
|
|
3835
|
+
}
|
|
3836
|
+
detected = true;
|
|
3837
|
+
state.position++;
|
|
3838
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
3839
|
+
if (state.lineIndent <= nodeIndent) {
|
|
3840
|
+
_result.push(null);
|
|
3841
|
+
ch = state.input.charCodeAt(state.position);
|
|
3842
|
+
continue;
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
_line = state.line;
|
|
3846
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
3847
|
+
_result.push(state.result);
|
|
3848
|
+
skipSeparationSpace(state, true, -1);
|
|
3849
|
+
ch = state.input.charCodeAt(state.position);
|
|
3850
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
3851
|
+
throwError(state, "bad indentation of a sequence entry");
|
|
3852
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
3853
|
+
break;
|
|
3854
|
+
}
|
|
3855
|
+
}
|
|
3856
|
+
if (detected) {
|
|
3857
|
+
state.tag = _tag;
|
|
3858
|
+
state.anchor = _anchor;
|
|
3859
|
+
state.kind = "sequence";
|
|
3860
|
+
state.result = _result;
|
|
3861
|
+
return true;
|
|
3862
|
+
}
|
|
3863
|
+
return false;
|
|
3864
|
+
}
|
|
3865
|
+
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
3866
|
+
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
3867
|
+
if (state.firstTabInLine !== -1)
|
|
3868
|
+
return false;
|
|
3869
|
+
if (state.anchor !== null) {
|
|
3870
|
+
state.anchorMap[state.anchor] = _result;
|
|
3871
|
+
}
|
|
3872
|
+
ch = state.input.charCodeAt(state.position);
|
|
3873
|
+
while (ch !== 0) {
|
|
3874
|
+
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
3875
|
+
state.position = state.firstTabInLine;
|
|
3876
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
3877
|
+
}
|
|
3878
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3879
|
+
_line = state.line;
|
|
3880
|
+
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
3881
|
+
if (ch === 63) {
|
|
3882
|
+
if (atExplicitKey) {
|
|
3883
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
3884
|
+
keyTag = keyNode = valueNode = null;
|
|
3885
|
+
}
|
|
3886
|
+
detected = true;
|
|
3887
|
+
atExplicitKey = true;
|
|
3888
|
+
allowCompact = true;
|
|
3889
|
+
} else if (atExplicitKey) {
|
|
3890
|
+
atExplicitKey = false;
|
|
3891
|
+
allowCompact = true;
|
|
3892
|
+
} else {
|
|
3893
|
+
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
3894
|
+
}
|
|
3895
|
+
state.position += 1;
|
|
3896
|
+
ch = following;
|
|
3897
|
+
} else {
|
|
3898
|
+
_keyLine = state.line;
|
|
3899
|
+
_keyLineStart = state.lineStart;
|
|
3900
|
+
_keyPos = state.position;
|
|
3901
|
+
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
3902
|
+
break;
|
|
3903
|
+
}
|
|
3904
|
+
if (state.line === _line) {
|
|
3905
|
+
ch = state.input.charCodeAt(state.position);
|
|
3906
|
+
while (is_WHITE_SPACE(ch)) {
|
|
3907
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3908
|
+
}
|
|
3909
|
+
if (ch === 58) {
|
|
3910
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3911
|
+
if (!is_WS_OR_EOL(ch)) {
|
|
3912
|
+
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
3913
|
+
}
|
|
3914
|
+
if (atExplicitKey) {
|
|
3915
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
3916
|
+
keyTag = keyNode = valueNode = null;
|
|
3917
|
+
}
|
|
3918
|
+
detected = true;
|
|
3919
|
+
atExplicitKey = false;
|
|
3920
|
+
allowCompact = false;
|
|
3921
|
+
keyTag = state.tag;
|
|
3922
|
+
keyNode = state.result;
|
|
3923
|
+
} else if (detected) {
|
|
3924
|
+
throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
3925
|
+
} else {
|
|
3926
|
+
state.tag = _tag;
|
|
3927
|
+
state.anchor = _anchor;
|
|
3928
|
+
return true;
|
|
3929
|
+
}
|
|
3930
|
+
} else if (detected) {
|
|
3931
|
+
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
3932
|
+
} else {
|
|
3933
|
+
state.tag = _tag;
|
|
3934
|
+
state.anchor = _anchor;
|
|
3935
|
+
return true;
|
|
3936
|
+
}
|
|
3937
|
+
}
|
|
3938
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
3939
|
+
if (atExplicitKey) {
|
|
3940
|
+
_keyLine = state.line;
|
|
3941
|
+
_keyLineStart = state.lineStart;
|
|
3942
|
+
_keyPos = state.position;
|
|
3943
|
+
}
|
|
3944
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
3945
|
+
if (atExplicitKey) {
|
|
3946
|
+
keyNode = state.result;
|
|
3947
|
+
} else {
|
|
3948
|
+
valueNode = state.result;
|
|
3949
|
+
}
|
|
3950
|
+
}
|
|
3951
|
+
if (!atExplicitKey) {
|
|
3952
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
3953
|
+
keyTag = keyNode = valueNode = null;
|
|
3954
|
+
}
|
|
3955
|
+
skipSeparationSpace(state, true, -1);
|
|
3956
|
+
ch = state.input.charCodeAt(state.position);
|
|
3957
|
+
}
|
|
3958
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
3959
|
+
throwError(state, "bad indentation of a mapping entry");
|
|
3960
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
3961
|
+
break;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
if (atExplicitKey) {
|
|
3965
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
3966
|
+
}
|
|
3967
|
+
if (detected) {
|
|
3968
|
+
state.tag = _tag;
|
|
3969
|
+
state.anchor = _anchor;
|
|
3970
|
+
state.kind = "mapping";
|
|
3971
|
+
state.result = _result;
|
|
3972
|
+
}
|
|
3973
|
+
return detected;
|
|
3974
|
+
}
|
|
3975
|
+
function readTagProperty(state) {
|
|
3976
|
+
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
3977
|
+
ch = state.input.charCodeAt(state.position);
|
|
3978
|
+
if (ch !== 33)
|
|
3979
|
+
return false;
|
|
3980
|
+
if (state.tag !== null) {
|
|
3981
|
+
throwError(state, "duplication of a tag property");
|
|
3982
|
+
}
|
|
3983
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3984
|
+
if (ch === 60) {
|
|
3985
|
+
isVerbatim = true;
|
|
3986
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3987
|
+
} else if (ch === 33) {
|
|
3988
|
+
isNamed = true;
|
|
3989
|
+
tagHandle = "!!";
|
|
3990
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3991
|
+
} else {
|
|
3992
|
+
tagHandle = "!";
|
|
3993
|
+
}
|
|
3994
|
+
_position = state.position;
|
|
3995
|
+
if (isVerbatim) {
|
|
3996
|
+
do {
|
|
3997
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3998
|
+
} while (ch !== 0 && ch !== 62);
|
|
3999
|
+
if (state.position < state.length) {
|
|
4000
|
+
tagName = state.input.slice(_position, state.position);
|
|
4001
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4002
|
+
} else {
|
|
4003
|
+
throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
4004
|
+
}
|
|
4005
|
+
} else {
|
|
4006
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
4007
|
+
if (ch === 33) {
|
|
4008
|
+
if (!isNamed) {
|
|
4009
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
4010
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
4011
|
+
throwError(state, "named tag handle cannot contain such characters");
|
|
4012
|
+
}
|
|
4013
|
+
isNamed = true;
|
|
4014
|
+
_position = state.position + 1;
|
|
4015
|
+
} else {
|
|
4016
|
+
throwError(state, "tag suffix cannot contain exclamation marks");
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4020
|
+
}
|
|
4021
|
+
tagName = state.input.slice(_position, state.position);
|
|
4022
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
4023
|
+
throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
4027
|
+
throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
4028
|
+
}
|
|
4029
|
+
try {
|
|
4030
|
+
tagName = decodeURIComponent(tagName);
|
|
4031
|
+
} catch (err) {
|
|
4032
|
+
throwError(state, "tag name is malformed: " + tagName);
|
|
4033
|
+
}
|
|
4034
|
+
if (isVerbatim) {
|
|
4035
|
+
state.tag = tagName;
|
|
4036
|
+
} else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
|
|
4037
|
+
state.tag = state.tagMap[tagHandle] + tagName;
|
|
4038
|
+
} else if (tagHandle === "!") {
|
|
4039
|
+
state.tag = "!" + tagName;
|
|
4040
|
+
} else if (tagHandle === "!!") {
|
|
4041
|
+
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
4042
|
+
} else {
|
|
4043
|
+
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
4044
|
+
}
|
|
4045
|
+
return true;
|
|
4046
|
+
}
|
|
4047
|
+
function readAnchorProperty(state) {
|
|
4048
|
+
var _position, ch;
|
|
4049
|
+
ch = state.input.charCodeAt(state.position);
|
|
4050
|
+
if (ch !== 38)
|
|
4051
|
+
return false;
|
|
4052
|
+
if (state.anchor !== null) {
|
|
4053
|
+
throwError(state, "duplication of an anchor property");
|
|
4054
|
+
}
|
|
4055
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4056
|
+
_position = state.position;
|
|
4057
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
4058
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4059
|
+
}
|
|
4060
|
+
if (state.position === _position) {
|
|
4061
|
+
throwError(state, "name of an anchor node must contain at least one character");
|
|
4062
|
+
}
|
|
4063
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
4064
|
+
return true;
|
|
4065
|
+
}
|
|
4066
|
+
function readAlias(state) {
|
|
4067
|
+
var _position, alias, ch;
|
|
4068
|
+
ch = state.input.charCodeAt(state.position);
|
|
4069
|
+
if (ch !== 42)
|
|
4070
|
+
return false;
|
|
4071
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4072
|
+
_position = state.position;
|
|
4073
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
4074
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4075
|
+
}
|
|
4076
|
+
if (state.position === _position) {
|
|
4077
|
+
throwError(state, "name of an alias node must contain at least one character");
|
|
4078
|
+
}
|
|
4079
|
+
alias = state.input.slice(_position, state.position);
|
|
4080
|
+
if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
|
|
4081
|
+
throwError(state, 'unidentified alias "' + alias + '"');
|
|
4082
|
+
}
|
|
4083
|
+
state.result = state.anchorMap[alias];
|
|
4084
|
+
skipSeparationSpace(state, true, -1);
|
|
4085
|
+
return true;
|
|
4086
|
+
}
|
|
4087
|
+
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
4088
|
+
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
|
|
4089
|
+
if (state.listener !== null) {
|
|
4090
|
+
state.listener("open", state);
|
|
4091
|
+
}
|
|
4092
|
+
state.tag = null;
|
|
4093
|
+
state.anchor = null;
|
|
4094
|
+
state.kind = null;
|
|
4095
|
+
state.result = null;
|
|
4096
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
4097
|
+
if (allowToSeek) {
|
|
4098
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
4099
|
+
atNewLine = true;
|
|
4100
|
+
if (state.lineIndent > parentIndent) {
|
|
4101
|
+
indentStatus = 1;
|
|
4102
|
+
} else if (state.lineIndent === parentIndent) {
|
|
4103
|
+
indentStatus = 0;
|
|
4104
|
+
} else if (state.lineIndent < parentIndent) {
|
|
4105
|
+
indentStatus = -1;
|
|
4106
|
+
}
|
|
4107
|
+
}
|
|
4108
|
+
}
|
|
4109
|
+
if (indentStatus === 1) {
|
|
4110
|
+
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
4111
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
4112
|
+
atNewLine = true;
|
|
4113
|
+
allowBlockCollections = allowBlockStyles;
|
|
4114
|
+
if (state.lineIndent > parentIndent) {
|
|
4115
|
+
indentStatus = 1;
|
|
4116
|
+
} else if (state.lineIndent === parentIndent) {
|
|
4117
|
+
indentStatus = 0;
|
|
4118
|
+
} else if (state.lineIndent < parentIndent) {
|
|
4119
|
+
indentStatus = -1;
|
|
4120
|
+
}
|
|
4121
|
+
} else {
|
|
4122
|
+
allowBlockCollections = false;
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
if (allowBlockCollections) {
|
|
4127
|
+
allowBlockCollections = atNewLine || allowCompact;
|
|
4128
|
+
}
|
|
4129
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
4130
|
+
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
4131
|
+
flowIndent = parentIndent;
|
|
4132
|
+
} else {
|
|
4133
|
+
flowIndent = parentIndent + 1;
|
|
4134
|
+
}
|
|
4135
|
+
blockIndent = state.position - state.lineStart;
|
|
4136
|
+
if (indentStatus === 1) {
|
|
4137
|
+
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
|
|
4138
|
+
hasContent = true;
|
|
4139
|
+
} else {
|
|
4140
|
+
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
|
|
4141
|
+
hasContent = true;
|
|
4142
|
+
} else if (readAlias(state)) {
|
|
4143
|
+
hasContent = true;
|
|
4144
|
+
if (state.tag !== null || state.anchor !== null) {
|
|
4145
|
+
throwError(state, "alias node should not have any properties");
|
|
4146
|
+
}
|
|
4147
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
4148
|
+
hasContent = true;
|
|
4149
|
+
if (state.tag === null) {
|
|
4150
|
+
state.tag = "?";
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
if (state.anchor !== null) {
|
|
4154
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
} else if (indentStatus === 0) {
|
|
4158
|
+
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
4159
|
+
}
|
|
4160
|
+
}
|
|
4161
|
+
if (state.tag === null) {
|
|
4162
|
+
if (state.anchor !== null) {
|
|
4163
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4164
|
+
}
|
|
4165
|
+
} else if (state.tag === "?") {
|
|
4166
|
+
if (state.result !== null && state.kind !== "scalar") {
|
|
4167
|
+
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
4168
|
+
}
|
|
4169
|
+
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
4170
|
+
type2 = state.implicitTypes[typeIndex];
|
|
4171
|
+
if (type2.resolve(state.result)) {
|
|
4172
|
+
state.result = type2.construct(state.result);
|
|
4173
|
+
state.tag = type2.tag;
|
|
4174
|
+
if (state.anchor !== null) {
|
|
4175
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4176
|
+
}
|
|
4177
|
+
break;
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
} else if (state.tag !== "!") {
|
|
4181
|
+
if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
4182
|
+
type2 = state.typeMap[state.kind || "fallback"][state.tag];
|
|
4183
|
+
} else {
|
|
4184
|
+
type2 = null;
|
|
4185
|
+
typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
4186
|
+
for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
4187
|
+
if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
4188
|
+
type2 = typeList[typeIndex];
|
|
4189
|
+
break;
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
if (!type2) {
|
|
4194
|
+
throwError(state, "unknown tag !<" + state.tag + ">");
|
|
4195
|
+
}
|
|
4196
|
+
if (state.result !== null && type2.kind !== state.kind) {
|
|
4197
|
+
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
|
|
4198
|
+
}
|
|
4199
|
+
if (!type2.resolve(state.result, state.tag)) {
|
|
4200
|
+
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
4201
|
+
} else {
|
|
4202
|
+
state.result = type2.construct(state.result, state.tag);
|
|
4203
|
+
if (state.anchor !== null) {
|
|
4204
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4205
|
+
}
|
|
4206
|
+
}
|
|
4207
|
+
}
|
|
4208
|
+
if (state.listener !== null) {
|
|
4209
|
+
state.listener("close", state);
|
|
4210
|
+
}
|
|
4211
|
+
return state.tag !== null || state.anchor !== null || hasContent;
|
|
4212
|
+
}
|
|
4213
|
+
function readDocument(state) {
|
|
4214
|
+
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
4215
|
+
state.version = null;
|
|
4216
|
+
state.checkLineBreaks = state.legacy;
|
|
4217
|
+
state.tagMap = Object.create(null);
|
|
4218
|
+
state.anchorMap = Object.create(null);
|
|
4219
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
4220
|
+
skipSeparationSpace(state, true, -1);
|
|
4221
|
+
ch = state.input.charCodeAt(state.position);
|
|
4222
|
+
if (state.lineIndent > 0 || ch !== 37) {
|
|
4223
|
+
break;
|
|
4224
|
+
}
|
|
4225
|
+
hasDirectives = true;
|
|
4226
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4227
|
+
_position = state.position;
|
|
4228
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
4229
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4230
|
+
}
|
|
4231
|
+
directiveName = state.input.slice(_position, state.position);
|
|
4232
|
+
directiveArgs = [];
|
|
4233
|
+
if (directiveName.length < 1) {
|
|
4234
|
+
throwError(state, "directive name must not be less than one character in length");
|
|
4235
|
+
}
|
|
4236
|
+
while (ch !== 0) {
|
|
4237
|
+
while (is_WHITE_SPACE(ch)) {
|
|
4238
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4239
|
+
}
|
|
4240
|
+
if (ch === 35) {
|
|
4241
|
+
do {
|
|
4242
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4243
|
+
} while (ch !== 0 && !is_EOL(ch));
|
|
4244
|
+
break;
|
|
4245
|
+
}
|
|
4246
|
+
if (is_EOL(ch))
|
|
4247
|
+
break;
|
|
4248
|
+
_position = state.position;
|
|
4249
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
4250
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4251
|
+
}
|
|
4252
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
4253
|
+
}
|
|
4254
|
+
if (ch !== 0)
|
|
4255
|
+
readLineBreak(state);
|
|
4256
|
+
if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
|
|
4257
|
+
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
4258
|
+
} else {
|
|
4259
|
+
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
skipSeparationSpace(state, true, -1);
|
|
4263
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
4264
|
+
state.position += 3;
|
|
4265
|
+
skipSeparationSpace(state, true, -1);
|
|
4266
|
+
} else if (hasDirectives) {
|
|
4267
|
+
throwError(state, "directives end mark is expected");
|
|
4268
|
+
}
|
|
4269
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
4270
|
+
skipSeparationSpace(state, true, -1);
|
|
4271
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
4272
|
+
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
4273
|
+
}
|
|
4274
|
+
state.documents.push(state.result);
|
|
4275
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
4276
|
+
if (state.input.charCodeAt(state.position) === 46) {
|
|
4277
|
+
state.position += 3;
|
|
4278
|
+
skipSeparationSpace(state, true, -1);
|
|
4279
|
+
}
|
|
4280
|
+
return;
|
|
4281
|
+
}
|
|
4282
|
+
if (state.position < state.length - 1) {
|
|
4283
|
+
throwError(state, "end of the stream or a document separator is expected");
|
|
4284
|
+
} else {
|
|
4285
|
+
return;
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
function loadDocuments(input, options) {
|
|
4289
|
+
input = String(input);
|
|
4290
|
+
options = options || {};
|
|
4291
|
+
if (input.length !== 0) {
|
|
4292
|
+
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
4293
|
+
input += "\n";
|
|
4294
|
+
}
|
|
4295
|
+
if (input.charCodeAt(0) === 65279) {
|
|
4296
|
+
input = input.slice(1);
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
var state = new State$1(input, options);
|
|
4300
|
+
var nullpos = input.indexOf("\0");
|
|
4301
|
+
if (nullpos !== -1) {
|
|
4302
|
+
state.position = nullpos;
|
|
4303
|
+
throwError(state, "null byte is not allowed in input");
|
|
4304
|
+
}
|
|
4305
|
+
state.input += "\0";
|
|
4306
|
+
while (state.input.charCodeAt(state.position) === 32) {
|
|
4307
|
+
state.lineIndent += 1;
|
|
4308
|
+
state.position += 1;
|
|
4309
|
+
}
|
|
4310
|
+
while (state.position < state.length - 1) {
|
|
4311
|
+
readDocument(state);
|
|
4312
|
+
}
|
|
4313
|
+
return state.documents;
|
|
4314
|
+
}
|
|
4315
|
+
function loadAll$1(input, iterator, options) {
|
|
4316
|
+
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
4317
|
+
options = iterator;
|
|
4318
|
+
iterator = null;
|
|
4319
|
+
}
|
|
4320
|
+
var documents = loadDocuments(input, options);
|
|
4321
|
+
if (typeof iterator !== "function") {
|
|
4322
|
+
return documents;
|
|
4323
|
+
}
|
|
4324
|
+
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
4325
|
+
iterator(documents[index]);
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
function load$1(input, options) {
|
|
4329
|
+
var documents = loadDocuments(input, options);
|
|
4330
|
+
if (documents.length === 0) {
|
|
4331
|
+
return void 0;
|
|
4332
|
+
} else if (documents.length === 1) {
|
|
4333
|
+
return documents[0];
|
|
4334
|
+
}
|
|
4335
|
+
throw new exception("expected a single document in the stream, but found more");
|
|
4336
|
+
}
|
|
4337
|
+
var loadAll_1 = loadAll$1;
|
|
4338
|
+
var load_1 = load$1;
|
|
4339
|
+
var loader = {
|
|
4340
|
+
loadAll: loadAll_1,
|
|
4341
|
+
load: load_1
|
|
4342
|
+
};
|
|
4343
|
+
var _toString = Object.prototype.toString;
|
|
4344
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4345
|
+
var CHAR_BOM = 65279;
|
|
4346
|
+
var CHAR_TAB = 9;
|
|
4347
|
+
var CHAR_LINE_FEED = 10;
|
|
4348
|
+
var CHAR_CARRIAGE_RETURN = 13;
|
|
4349
|
+
var CHAR_SPACE = 32;
|
|
4350
|
+
var CHAR_EXCLAMATION = 33;
|
|
4351
|
+
var CHAR_DOUBLE_QUOTE = 34;
|
|
4352
|
+
var CHAR_SHARP = 35;
|
|
4353
|
+
var CHAR_PERCENT = 37;
|
|
4354
|
+
var CHAR_AMPERSAND = 38;
|
|
4355
|
+
var CHAR_SINGLE_QUOTE = 39;
|
|
4356
|
+
var CHAR_ASTERISK = 42;
|
|
4357
|
+
var CHAR_COMMA = 44;
|
|
4358
|
+
var CHAR_MINUS = 45;
|
|
4359
|
+
var CHAR_COLON = 58;
|
|
4360
|
+
var CHAR_EQUALS = 61;
|
|
4361
|
+
var CHAR_GREATER_THAN = 62;
|
|
4362
|
+
var CHAR_QUESTION = 63;
|
|
4363
|
+
var CHAR_COMMERCIAL_AT = 64;
|
|
4364
|
+
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
4365
|
+
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
4366
|
+
var CHAR_GRAVE_ACCENT = 96;
|
|
4367
|
+
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
4368
|
+
var CHAR_VERTICAL_LINE = 124;
|
|
4369
|
+
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
4370
|
+
var ESCAPE_SEQUENCES = {};
|
|
4371
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
4372
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
4373
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
4374
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
4375
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
4376
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
4377
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
4378
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
4379
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
4380
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
4381
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
4382
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
4383
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
4384
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
4385
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
4386
|
+
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
4387
|
+
"y",
|
|
4388
|
+
"Y",
|
|
4389
|
+
"yes",
|
|
4390
|
+
"Yes",
|
|
4391
|
+
"YES",
|
|
4392
|
+
"on",
|
|
4393
|
+
"On",
|
|
4394
|
+
"ON",
|
|
4395
|
+
"n",
|
|
4396
|
+
"N",
|
|
4397
|
+
"no",
|
|
4398
|
+
"No",
|
|
4399
|
+
"NO",
|
|
4400
|
+
"off",
|
|
4401
|
+
"Off",
|
|
4402
|
+
"OFF"
|
|
4403
|
+
];
|
|
4404
|
+
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
4405
|
+
function compileStyleMap(schema2, map2) {
|
|
4406
|
+
var result, keys, index, length, tag, style, type2;
|
|
4407
|
+
if (map2 === null)
|
|
4408
|
+
return {};
|
|
4409
|
+
result = {};
|
|
4410
|
+
keys = Object.keys(map2);
|
|
4411
|
+
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
4412
|
+
tag = keys[index];
|
|
4413
|
+
style = String(map2[tag]);
|
|
4414
|
+
if (tag.slice(0, 2) === "!!") {
|
|
4415
|
+
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
4416
|
+
}
|
|
4417
|
+
type2 = schema2.compiledTypeMap["fallback"][tag];
|
|
4418
|
+
if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
|
|
4419
|
+
style = type2.styleAliases[style];
|
|
4420
|
+
}
|
|
4421
|
+
result[tag] = style;
|
|
4422
|
+
}
|
|
4423
|
+
return result;
|
|
4424
|
+
}
|
|
4425
|
+
function encodeHex(character) {
|
|
4426
|
+
var string, handle, length;
|
|
4427
|
+
string = character.toString(16).toUpperCase();
|
|
4428
|
+
if (character <= 255) {
|
|
4429
|
+
handle = "x";
|
|
4430
|
+
length = 2;
|
|
4431
|
+
} else if (character <= 65535) {
|
|
4432
|
+
handle = "u";
|
|
4433
|
+
length = 4;
|
|
4434
|
+
} else if (character <= 4294967295) {
|
|
4435
|
+
handle = "U";
|
|
4436
|
+
length = 8;
|
|
4437
|
+
} else {
|
|
4438
|
+
throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
|
|
4439
|
+
}
|
|
4440
|
+
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
4441
|
+
}
|
|
4442
|
+
var QUOTING_TYPE_SINGLE = 1;
|
|
4443
|
+
var QUOTING_TYPE_DOUBLE = 2;
|
|
4444
|
+
function State(options) {
|
|
4445
|
+
this.schema = options["schema"] || _default;
|
|
4446
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
4447
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
4448
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
4449
|
+
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
4450
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
4451
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
4452
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
4453
|
+
this.noRefs = options["noRefs"] || false;
|
|
4454
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
4455
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
4456
|
+
this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
4457
|
+
this.forceQuotes = options["forceQuotes"] || false;
|
|
4458
|
+
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
|
|
4459
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
4460
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
4461
|
+
this.tag = null;
|
|
4462
|
+
this.result = "";
|
|
4463
|
+
this.duplicates = [];
|
|
4464
|
+
this.usedDuplicates = null;
|
|
4465
|
+
}
|
|
4466
|
+
function indentString(string, spaces) {
|
|
4467
|
+
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
4468
|
+
while (position < length) {
|
|
4469
|
+
next = string.indexOf("\n", position);
|
|
4470
|
+
if (next === -1) {
|
|
4471
|
+
line = string.slice(position);
|
|
4472
|
+
position = length;
|
|
4473
|
+
} else {
|
|
4474
|
+
line = string.slice(position, next + 1);
|
|
4475
|
+
position = next + 1;
|
|
4476
|
+
}
|
|
4477
|
+
if (line.length && line !== "\n")
|
|
4478
|
+
result += ind;
|
|
4479
|
+
result += line;
|
|
4480
|
+
}
|
|
4481
|
+
return result;
|
|
4482
|
+
}
|
|
4483
|
+
function generateNextLine(state, level) {
|
|
4484
|
+
return "\n" + common.repeat(" ", state.indent * level);
|
|
4485
|
+
}
|
|
4486
|
+
function testImplicitResolving(state, str2) {
|
|
4487
|
+
var index, length, type2;
|
|
4488
|
+
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
4489
|
+
type2 = state.implicitTypes[index];
|
|
4490
|
+
if (type2.resolve(str2)) {
|
|
4491
|
+
return true;
|
|
4492
|
+
}
|
|
4493
|
+
}
|
|
4494
|
+
return false;
|
|
4495
|
+
}
|
|
4496
|
+
function isWhitespace(c) {
|
|
4497
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
4498
|
+
}
|
|
4499
|
+
function isPrintable(c) {
|
|
4500
|
+
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
|
|
4501
|
+
}
|
|
4502
|
+
function isNsCharOrWhitespace(c) {
|
|
4503
|
+
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
4504
|
+
}
|
|
4505
|
+
function isPlainSafe(c, prev, inblock) {
|
|
4506
|
+
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
4507
|
+
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
4508
|
+
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
|
|
4509
|
+
}
|
|
4510
|
+
function isPlainSafeFirst(c) {
|
|
4511
|
+
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
4512
|
+
}
|
|
4513
|
+
function isPlainSafeLast(c) {
|
|
4514
|
+
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
4515
|
+
}
|
|
4516
|
+
function codePointAt(string, pos) {
|
|
4517
|
+
var first = string.charCodeAt(pos), second;
|
|
4518
|
+
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
|
|
4519
|
+
second = string.charCodeAt(pos + 1);
|
|
4520
|
+
if (second >= 56320 && second <= 57343) {
|
|
4521
|
+
return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4524
|
+
return first;
|
|
4525
|
+
}
|
|
4526
|
+
function needIndentIndicator(string) {
|
|
4527
|
+
var leadingSpaceRe = /^\n* /;
|
|
4528
|
+
return leadingSpaceRe.test(string);
|
|
4529
|
+
}
|
|
4530
|
+
var STYLE_PLAIN = 1;
|
|
4531
|
+
var STYLE_SINGLE = 2;
|
|
4532
|
+
var STYLE_LITERAL = 3;
|
|
4533
|
+
var STYLE_FOLDED = 4;
|
|
4534
|
+
var STYLE_DOUBLE = 5;
|
|
4535
|
+
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
4536
|
+
var i;
|
|
4537
|
+
var char = 0;
|
|
4538
|
+
var prevChar = null;
|
|
4539
|
+
var hasLineBreak = false;
|
|
4540
|
+
var hasFoldableLine = false;
|
|
4541
|
+
var shouldTrackWidth = lineWidth !== -1;
|
|
4542
|
+
var previousLineBreak = -1;
|
|
4543
|
+
var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
4544
|
+
if (singleLineOnly || forceQuotes) {
|
|
4545
|
+
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
4546
|
+
char = codePointAt(string, i);
|
|
4547
|
+
if (!isPrintable(char)) {
|
|
4548
|
+
return STYLE_DOUBLE;
|
|
4549
|
+
}
|
|
4550
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
4551
|
+
prevChar = char;
|
|
4552
|
+
}
|
|
4553
|
+
} else {
|
|
4554
|
+
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
4555
|
+
char = codePointAt(string, i);
|
|
4556
|
+
if (char === CHAR_LINE_FEED) {
|
|
4557
|
+
hasLineBreak = true;
|
|
4558
|
+
if (shouldTrackWidth) {
|
|
4559
|
+
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
4560
|
+
previousLineBreak = i;
|
|
4561
|
+
}
|
|
4562
|
+
} else if (!isPrintable(char)) {
|
|
4563
|
+
return STYLE_DOUBLE;
|
|
4564
|
+
}
|
|
4565
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
4566
|
+
prevChar = char;
|
|
4567
|
+
}
|
|
4568
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
|
|
4569
|
+
}
|
|
4570
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
4571
|
+
if (plain && !forceQuotes && !testAmbiguousType(string)) {
|
|
4572
|
+
return STYLE_PLAIN;
|
|
4573
|
+
}
|
|
4574
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
4575
|
+
}
|
|
4576
|
+
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
|
4577
|
+
return STYLE_DOUBLE;
|
|
4578
|
+
}
|
|
4579
|
+
if (!forceQuotes) {
|
|
4580
|
+
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
4581
|
+
}
|
|
4582
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
4583
|
+
}
|
|
4584
|
+
function writeScalar(state, string, level, iskey, inblock) {
|
|
4585
|
+
state.dump = function() {
|
|
4586
|
+
if (string.length === 0) {
|
|
4587
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
|
4588
|
+
}
|
|
4589
|
+
if (!state.noCompatMode) {
|
|
4590
|
+
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
|
|
4591
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
var indent = state.indent * Math.max(1, level);
|
|
4595
|
+
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
4596
|
+
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
4597
|
+
function testAmbiguity(string2) {
|
|
4598
|
+
return testImplicitResolving(state, string2);
|
|
4599
|
+
}
|
|
4600
|
+
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
|
|
4601
|
+
case STYLE_PLAIN:
|
|
4602
|
+
return string;
|
|
4603
|
+
case STYLE_SINGLE:
|
|
4604
|
+
return "'" + string.replace(/'/g, "''") + "'";
|
|
4605
|
+
case STYLE_LITERAL:
|
|
4606
|
+
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
4607
|
+
case STYLE_FOLDED:
|
|
4608
|
+
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
4609
|
+
case STYLE_DOUBLE:
|
|
4610
|
+
return '"' + escapeString(string) + '"';
|
|
4611
|
+
default:
|
|
4612
|
+
throw new exception("impossible error: invalid scalar style");
|
|
4613
|
+
}
|
|
4614
|
+
}();
|
|
4615
|
+
}
|
|
4616
|
+
function blockHeader(string, indentPerLevel) {
|
|
4617
|
+
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
4618
|
+
var clip = string[string.length - 1] === "\n";
|
|
4619
|
+
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
|
|
4620
|
+
var chomp = keep ? "+" : clip ? "" : "-";
|
|
4621
|
+
return indentIndicator + chomp + "\n";
|
|
4622
|
+
}
|
|
4623
|
+
function dropEndingNewline(string) {
|
|
4624
|
+
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
4625
|
+
}
|
|
4626
|
+
function foldString(string, width) {
|
|
4627
|
+
var lineRe = /(\n+)([^\n]*)/g;
|
|
4628
|
+
var result = function() {
|
|
4629
|
+
var nextLF = string.indexOf("\n");
|
|
4630
|
+
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
4631
|
+
lineRe.lastIndex = nextLF;
|
|
4632
|
+
return foldLine(string.slice(0, nextLF), width);
|
|
4633
|
+
}();
|
|
4634
|
+
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
4635
|
+
var moreIndented;
|
|
4636
|
+
var match;
|
|
4637
|
+
while (match = lineRe.exec(string)) {
|
|
4638
|
+
var prefix = match[1], line = match[2];
|
|
4639
|
+
moreIndented = line[0] === " ";
|
|
4640
|
+
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
4641
|
+
prevMoreIndented = moreIndented;
|
|
4642
|
+
}
|
|
4643
|
+
return result;
|
|
4644
|
+
}
|
|
4645
|
+
function foldLine(line, width) {
|
|
4646
|
+
if (line === "" || line[0] === " ")
|
|
4647
|
+
return line;
|
|
4648
|
+
var breakRe = / [^ ]/g;
|
|
4649
|
+
var match;
|
|
4650
|
+
var start = 0, end, curr = 0, next = 0;
|
|
4651
|
+
var result = "";
|
|
4652
|
+
while (match = breakRe.exec(line)) {
|
|
4653
|
+
next = match.index;
|
|
4654
|
+
if (next - start > width) {
|
|
4655
|
+
end = curr > start ? curr : next;
|
|
4656
|
+
result += "\n" + line.slice(start, end);
|
|
4657
|
+
start = end + 1;
|
|
4658
|
+
}
|
|
4659
|
+
curr = next;
|
|
4660
|
+
}
|
|
4661
|
+
result += "\n";
|
|
4662
|
+
if (line.length - start > width && curr > start) {
|
|
4663
|
+
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
4664
|
+
} else {
|
|
4665
|
+
result += line.slice(start);
|
|
4666
|
+
}
|
|
4667
|
+
return result.slice(1);
|
|
4668
|
+
}
|
|
4669
|
+
function escapeString(string) {
|
|
4670
|
+
var result = "";
|
|
4671
|
+
var char = 0;
|
|
4672
|
+
var escapeSeq;
|
|
4673
|
+
for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
4674
|
+
char = codePointAt(string, i);
|
|
4675
|
+
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
4676
|
+
if (!escapeSeq && isPrintable(char)) {
|
|
4677
|
+
result += string[i];
|
|
4678
|
+
if (char >= 65536)
|
|
4679
|
+
result += string[i + 1];
|
|
4680
|
+
} else {
|
|
4681
|
+
result += escapeSeq || encodeHex(char);
|
|
4682
|
+
}
|
|
4683
|
+
}
|
|
4684
|
+
return result;
|
|
4685
|
+
}
|
|
4686
|
+
function writeFlowSequence(state, level, object) {
|
|
4687
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
4688
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
4689
|
+
value = object[index];
|
|
4690
|
+
if (state.replacer) {
|
|
4691
|
+
value = state.replacer.call(object, String(index), value);
|
|
4692
|
+
}
|
|
4693
|
+
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
|
|
4694
|
+
if (_result !== "")
|
|
4695
|
+
_result += "," + (!state.condenseFlow ? " " : "");
|
|
4696
|
+
_result += state.dump;
|
|
4697
|
+
}
|
|
4698
|
+
}
|
|
4699
|
+
state.tag = _tag;
|
|
4700
|
+
state.dump = "[" + _result + "]";
|
|
4701
|
+
}
|
|
4702
|
+
function writeBlockSequence(state, level, object, compact) {
|
|
4703
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
4704
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
4705
|
+
value = object[index];
|
|
4706
|
+
if (state.replacer) {
|
|
4707
|
+
value = state.replacer.call(object, String(index), value);
|
|
4708
|
+
}
|
|
4709
|
+
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
4710
|
+
if (!compact || _result !== "") {
|
|
4711
|
+
_result += generateNextLine(state, level);
|
|
4712
|
+
}
|
|
4713
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
4714
|
+
_result += "-";
|
|
4715
|
+
} else {
|
|
4716
|
+
_result += "- ";
|
|
4717
|
+
}
|
|
4718
|
+
_result += state.dump;
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
state.tag = _tag;
|
|
4722
|
+
state.dump = _result || "[]";
|
|
4723
|
+
}
|
|
4724
|
+
function writeFlowMapping(state, level, object) {
|
|
4725
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
4726
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
4727
|
+
pairBuffer = "";
|
|
4728
|
+
if (_result !== "")
|
|
4729
|
+
pairBuffer += ", ";
|
|
4730
|
+
if (state.condenseFlow)
|
|
4731
|
+
pairBuffer += '"';
|
|
4732
|
+
objectKey = objectKeyList[index];
|
|
4733
|
+
objectValue = object[objectKey];
|
|
4734
|
+
if (state.replacer) {
|
|
4735
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
4736
|
+
}
|
|
4737
|
+
if (!writeNode(state, level, objectKey, false, false)) {
|
|
4738
|
+
continue;
|
|
4739
|
+
}
|
|
4740
|
+
if (state.dump.length > 1024)
|
|
4741
|
+
pairBuffer += "? ";
|
|
4742
|
+
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
4743
|
+
if (!writeNode(state, level, objectValue, false, false)) {
|
|
4744
|
+
continue;
|
|
4745
|
+
}
|
|
4746
|
+
pairBuffer += state.dump;
|
|
4747
|
+
_result += pairBuffer;
|
|
4748
|
+
}
|
|
4749
|
+
state.tag = _tag;
|
|
4750
|
+
state.dump = "{" + _result + "}";
|
|
4751
|
+
}
|
|
4752
|
+
function writeBlockMapping(state, level, object, compact) {
|
|
4753
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
4754
|
+
if (state.sortKeys === true) {
|
|
4755
|
+
objectKeyList.sort();
|
|
4756
|
+
} else if (typeof state.sortKeys === "function") {
|
|
4757
|
+
objectKeyList.sort(state.sortKeys);
|
|
4758
|
+
} else if (state.sortKeys) {
|
|
4759
|
+
throw new exception("sortKeys must be a boolean or a function");
|
|
4760
|
+
}
|
|
4761
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
4762
|
+
pairBuffer = "";
|
|
4763
|
+
if (!compact || _result !== "") {
|
|
4764
|
+
pairBuffer += generateNextLine(state, level);
|
|
4765
|
+
}
|
|
4766
|
+
objectKey = objectKeyList[index];
|
|
4767
|
+
objectValue = object[objectKey];
|
|
4768
|
+
if (state.replacer) {
|
|
4769
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
4770
|
+
}
|
|
4771
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
4772
|
+
continue;
|
|
4773
|
+
}
|
|
4774
|
+
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
4775
|
+
if (explicitPair) {
|
|
4776
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
4777
|
+
pairBuffer += "?";
|
|
4778
|
+
} else {
|
|
4779
|
+
pairBuffer += "? ";
|
|
4780
|
+
}
|
|
4781
|
+
}
|
|
4782
|
+
pairBuffer += state.dump;
|
|
4783
|
+
if (explicitPair) {
|
|
4784
|
+
pairBuffer += generateNextLine(state, level);
|
|
4785
|
+
}
|
|
4786
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
4787
|
+
continue;
|
|
4788
|
+
}
|
|
4789
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
4790
|
+
pairBuffer += ":";
|
|
4791
|
+
} else {
|
|
4792
|
+
pairBuffer += ": ";
|
|
4793
|
+
}
|
|
4794
|
+
pairBuffer += state.dump;
|
|
4795
|
+
_result += pairBuffer;
|
|
4796
|
+
}
|
|
4797
|
+
state.tag = _tag;
|
|
4798
|
+
state.dump = _result || "{}";
|
|
4799
|
+
}
|
|
4800
|
+
function detectType(state, object, explicit) {
|
|
4801
|
+
var _result, typeList, index, length, type2, style;
|
|
4802
|
+
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
4803
|
+
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
4804
|
+
type2 = typeList[index];
|
|
4805
|
+
if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
|
|
4806
|
+
if (explicit) {
|
|
4807
|
+
if (type2.multi && type2.representName) {
|
|
4808
|
+
state.tag = type2.representName(object);
|
|
4809
|
+
} else {
|
|
4810
|
+
state.tag = type2.tag;
|
|
4811
|
+
}
|
|
4812
|
+
} else {
|
|
4813
|
+
state.tag = "?";
|
|
4814
|
+
}
|
|
4815
|
+
if (type2.represent) {
|
|
4816
|
+
style = state.styleMap[type2.tag] || type2.defaultStyle;
|
|
4817
|
+
if (_toString.call(type2.represent) === "[object Function]") {
|
|
4818
|
+
_result = type2.represent(object, style);
|
|
4819
|
+
} else if (_hasOwnProperty.call(type2.represent, style)) {
|
|
4820
|
+
_result = type2.represent[style](object, style);
|
|
4821
|
+
} else {
|
|
4822
|
+
throw new exception("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
|
|
4823
|
+
}
|
|
4824
|
+
state.dump = _result;
|
|
4825
|
+
}
|
|
4826
|
+
return true;
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
return false;
|
|
4830
|
+
}
|
|
4831
|
+
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
|
|
4832
|
+
state.tag = null;
|
|
4833
|
+
state.dump = object;
|
|
4834
|
+
if (!detectType(state, object, false)) {
|
|
4835
|
+
detectType(state, object, true);
|
|
4836
|
+
}
|
|
4837
|
+
var type2 = _toString.call(state.dump);
|
|
4838
|
+
var inblock = block;
|
|
4839
|
+
var tagStr;
|
|
4840
|
+
if (block) {
|
|
4841
|
+
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
4842
|
+
}
|
|
4843
|
+
var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]", duplicateIndex, duplicate;
|
|
4844
|
+
if (objectOrArray) {
|
|
4845
|
+
duplicateIndex = state.duplicates.indexOf(object);
|
|
4846
|
+
duplicate = duplicateIndex !== -1;
|
|
4847
|
+
}
|
|
4848
|
+
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
4849
|
+
compact = false;
|
|
4850
|
+
}
|
|
4851
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
4852
|
+
state.dump = "*ref_" + duplicateIndex;
|
|
4853
|
+
} else {
|
|
4854
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
4855
|
+
state.usedDuplicates[duplicateIndex] = true;
|
|
4856
|
+
}
|
|
4857
|
+
if (type2 === "[object Object]") {
|
|
4858
|
+
if (block && Object.keys(state.dump).length !== 0) {
|
|
4859
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
4860
|
+
if (duplicate) {
|
|
4861
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
4862
|
+
}
|
|
4863
|
+
} else {
|
|
4864
|
+
writeFlowMapping(state, level, state.dump);
|
|
4865
|
+
if (duplicate) {
|
|
4866
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
4867
|
+
}
|
|
2177
4868
|
}
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
4869
|
+
} else if (type2 === "[object Array]") {
|
|
4870
|
+
if (block && state.dump.length !== 0) {
|
|
4871
|
+
if (state.noArrayIndent && !isblockseq && level > 0) {
|
|
4872
|
+
writeBlockSequence(state, level - 1, state.dump, compact);
|
|
4873
|
+
} else {
|
|
4874
|
+
writeBlockSequence(state, level, state.dump, compact);
|
|
4875
|
+
}
|
|
4876
|
+
if (duplicate) {
|
|
4877
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
4878
|
+
}
|
|
4879
|
+
} else {
|
|
4880
|
+
writeFlowSequence(state, level, state.dump);
|
|
4881
|
+
if (duplicate) {
|
|
4882
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
4883
|
+
}
|
|
2187
4884
|
}
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
if (gt && lt) {
|
|
2192
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
2193
|
-
if (gtltComp > 0)
|
|
2194
|
-
return null;
|
|
2195
|
-
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<="))
|
|
2196
|
-
return null;
|
|
4885
|
+
} else if (type2 === "[object String]") {
|
|
4886
|
+
if (state.tag !== "?") {
|
|
4887
|
+
writeScalar(state, state.dump, level, iskey, inblock);
|
|
2197
4888
|
}
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
4889
|
+
} else if (type2 === "[object Undefined]") {
|
|
4890
|
+
return false;
|
|
4891
|
+
} else {
|
|
4892
|
+
if (state.skipInvalid)
|
|
4893
|
+
return false;
|
|
4894
|
+
throw new exception("unacceptable kind of an object to dump " + type2);
|
|
4895
|
+
}
|
|
4896
|
+
if (state.tag !== null && state.tag !== "?") {
|
|
4897
|
+
tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
|
|
4898
|
+
if (state.tag[0] === "!") {
|
|
4899
|
+
tagStr = "!" + tagStr;
|
|
4900
|
+
} else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
|
|
4901
|
+
tagStr = "!!" + tagStr.slice(18);
|
|
4902
|
+
} else {
|
|
4903
|
+
tagStr = "!<" + tagStr + ">";
|
|
2208
4904
|
}
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
4905
|
+
state.dump = tagStr + " " + state.dump;
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
return true;
|
|
4909
|
+
}
|
|
4910
|
+
function getDuplicateReferences(object, state) {
|
|
4911
|
+
var objects = [], duplicatesIndexes = [], index, length;
|
|
4912
|
+
inspectNode(object, objects, duplicatesIndexes);
|
|
4913
|
+
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
|
4914
|
+
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
4915
|
+
}
|
|
4916
|
+
state.usedDuplicates = new Array(length);
|
|
4917
|
+
}
|
|
4918
|
+
function inspectNode(object, objects, duplicatesIndexes) {
|
|
4919
|
+
var objectKeyList, index, length;
|
|
4920
|
+
if (object !== null && typeof object === "object") {
|
|
4921
|
+
index = objects.indexOf(object);
|
|
4922
|
+
if (index !== -1) {
|
|
4923
|
+
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
4924
|
+
duplicatesIndexes.push(index);
|
|
2215
4925
|
}
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
2222
|
-
needDomGTPre = false;
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
2226
|
-
higher = higherGT(gt, c, options);
|
|
2227
|
-
if (higher === c && higher !== gt)
|
|
2228
|
-
return false;
|
|
2229
|
-
} else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options))
|
|
2230
|
-
return false;
|
|
4926
|
+
} else {
|
|
4927
|
+
objects.push(object);
|
|
4928
|
+
if (Array.isArray(object)) {
|
|
4929
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
4930
|
+
inspectNode(object[index], objects, duplicatesIndexes);
|
|
2231
4931
|
}
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
}
|
|
2237
|
-
}
|
|
2238
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
2239
|
-
lower = lowerLT(lt, c, options);
|
|
2240
|
-
if (lower === c && lower !== lt)
|
|
2241
|
-
return false;
|
|
2242
|
-
} else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options))
|
|
2243
|
-
return false;
|
|
4932
|
+
} else {
|
|
4933
|
+
objectKeyList = Object.keys(object);
|
|
4934
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
4935
|
+
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
2244
4936
|
}
|
|
2245
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0)
|
|
2246
|
-
return false;
|
|
2247
4937
|
}
|
|
2248
|
-
|
|
2249
|
-
return false;
|
|
2250
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0)
|
|
2251
|
-
return false;
|
|
2252
|
-
if (needDomGTPre || needDomLTPre)
|
|
2253
|
-
return false;
|
|
2254
|
-
return true;
|
|
2255
|
-
};
|
|
2256
|
-
var higherGT = (a, b, options) => {
|
|
2257
|
-
if (!a)
|
|
2258
|
-
return b;
|
|
2259
|
-
const comp = compare(a.semver, b.semver, options);
|
|
2260
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
2261
|
-
};
|
|
2262
|
-
var lowerLT = (a, b, options) => {
|
|
2263
|
-
if (!a)
|
|
2264
|
-
return b;
|
|
2265
|
-
const comp = compare(a.semver, b.semver, options);
|
|
2266
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
2267
|
-
};
|
|
2268
|
-
module.exports = subset;
|
|
4938
|
+
}
|
|
2269
4939
|
}
|
|
2270
|
-
}
|
|
4940
|
+
}
|
|
4941
|
+
function dump$1(input, options) {
|
|
4942
|
+
options = options || {};
|
|
4943
|
+
var state = new State(options);
|
|
4944
|
+
if (!state.noRefs)
|
|
4945
|
+
getDuplicateReferences(input, state);
|
|
4946
|
+
var value = input;
|
|
4947
|
+
if (state.replacer) {
|
|
4948
|
+
value = state.replacer.call({ "": value }, "", value);
|
|
4949
|
+
}
|
|
4950
|
+
if (writeNode(state, 0, value, true, true))
|
|
4951
|
+
return state.dump + "\n";
|
|
4952
|
+
return "";
|
|
4953
|
+
}
|
|
4954
|
+
var dump_1 = dump$1;
|
|
4955
|
+
var dumper = {
|
|
4956
|
+
dump: dump_1
|
|
4957
|
+
};
|
|
4958
|
+
function renamed(from, to) {
|
|
4959
|
+
return function() {
|
|
4960
|
+
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
4961
|
+
};
|
|
4962
|
+
}
|
|
4963
|
+
var Type = type;
|
|
4964
|
+
var Schema = schema;
|
|
4965
|
+
var FAILSAFE_SCHEMA = failsafe;
|
|
4966
|
+
var JSON_SCHEMA = json;
|
|
4967
|
+
var CORE_SCHEMA = core;
|
|
4968
|
+
var DEFAULT_SCHEMA = _default;
|
|
4969
|
+
var load = loader.load;
|
|
4970
|
+
var loadAll = loader.loadAll;
|
|
4971
|
+
var dump = dumper.dump;
|
|
4972
|
+
var YAMLException = exception;
|
|
4973
|
+
var types = {
|
|
4974
|
+
binary,
|
|
4975
|
+
float,
|
|
4976
|
+
map,
|
|
4977
|
+
null: _null,
|
|
4978
|
+
pairs,
|
|
4979
|
+
set,
|
|
4980
|
+
timestamp,
|
|
4981
|
+
bool,
|
|
4982
|
+
int,
|
|
4983
|
+
merge,
|
|
4984
|
+
omap,
|
|
4985
|
+
seq,
|
|
4986
|
+
str
|
|
4987
|
+
};
|
|
4988
|
+
var safeLoad = renamed("safeLoad", "load");
|
|
4989
|
+
var safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
4990
|
+
var safeDump = renamed("safeDump", "dump");
|
|
4991
|
+
var jsYaml = {
|
|
4992
|
+
Type,
|
|
4993
|
+
Schema,
|
|
4994
|
+
FAILSAFE_SCHEMA,
|
|
4995
|
+
JSON_SCHEMA,
|
|
4996
|
+
CORE_SCHEMA,
|
|
4997
|
+
DEFAULT_SCHEMA,
|
|
4998
|
+
load,
|
|
4999
|
+
loadAll,
|
|
5000
|
+
dump,
|
|
5001
|
+
YAMLException,
|
|
5002
|
+
types,
|
|
5003
|
+
safeLoad,
|
|
5004
|
+
safeLoadAll,
|
|
5005
|
+
safeDump
|
|
5006
|
+
};
|
|
5007
|
+
var js_yaml_default = jsYaml;
|
|
2271
5008
|
|
|
2272
|
-
//
|
|
2273
|
-
var
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
prerelease: require_prerelease(),
|
|
2294
|
-
compare: require_compare(),
|
|
2295
|
-
rcompare: require_rcompare(),
|
|
2296
|
-
compareLoose: require_compare_loose(),
|
|
2297
|
-
compareBuild: require_compare_build(),
|
|
2298
|
-
sort: require_sort(),
|
|
2299
|
-
rsort: require_rsort(),
|
|
2300
|
-
gt: require_gt(),
|
|
2301
|
-
lt: require_lt(),
|
|
2302
|
-
eq: require_eq(),
|
|
2303
|
-
neq: require_neq(),
|
|
2304
|
-
gte: require_gte(),
|
|
2305
|
-
lte: require_lte(),
|
|
2306
|
-
cmp: require_cmp(),
|
|
2307
|
-
coerce: require_coerce(),
|
|
2308
|
-
Comparator: require_comparator(),
|
|
2309
|
-
Range: require_range(),
|
|
2310
|
-
satisfies: require_satisfies(),
|
|
2311
|
-
toComparators: require_to_comparators(),
|
|
2312
|
-
maxSatisfying: require_max_satisfying(),
|
|
2313
|
-
minSatisfying: require_min_satisfying(),
|
|
2314
|
-
minVersion: require_min_version(),
|
|
2315
|
-
validRange: require_valid2(),
|
|
2316
|
-
outside: require_outside(),
|
|
2317
|
-
gtr: require_gtr(),
|
|
2318
|
-
ltr: require_ltr(),
|
|
2319
|
-
intersects: require_intersects(),
|
|
2320
|
-
simplifyRange: require_simplify(),
|
|
2321
|
-
subset: require_subset()
|
|
2322
|
-
};
|
|
5009
|
+
// ../parser/src/core.ts
|
|
5010
|
+
var _utils = require('@antfu/utils');
|
|
5011
|
+
|
|
5012
|
+
// ../parser/src/config.ts
|
|
5013
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
5014
|
+
|
|
5015
|
+
|
|
5016
|
+
// ../parser/src/utils.ts
|
|
5017
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
5018
|
+
|
|
5019
|
+
function parseRangeString(total, rangeStr) {
|
|
5020
|
+
if (!rangeStr || rangeStr === "all" || rangeStr === "*")
|
|
5021
|
+
return _utils.range.call(void 0, 1, total + 1);
|
|
5022
|
+
const pages = [];
|
|
5023
|
+
for (const part of rangeStr.split(/[,;]/g)) {
|
|
5024
|
+
if (!part.includes("-")) {
|
|
5025
|
+
pages.push(+part);
|
|
5026
|
+
} else {
|
|
5027
|
+
const [start, end] = part.split("-", 2);
|
|
5028
|
+
pages.push(..._utils.range.call(void 0, +start, !end ? total + 1 : +end + 1));
|
|
5029
|
+
}
|
|
2323
5030
|
}
|
|
2324
|
-
|
|
5031
|
+
return _utils.uniq.call(void 0, pages).filter((i) => i <= total).sort((a, b) => a - b);
|
|
5032
|
+
}
|
|
5033
|
+
function parseAspectRatio(str2) {
|
|
5034
|
+
if (_utils.isNumber.call(void 0, str2))
|
|
5035
|
+
return str2;
|
|
5036
|
+
if (!isNaN(+str2))
|
|
5037
|
+
return +str2;
|
|
5038
|
+
const [wStr = "", hStr = ""] = str2.split(/[:\/x\|]/);
|
|
5039
|
+
const w = parseFloat(wStr.trim());
|
|
5040
|
+
const h = parseFloat(hStr.trim());
|
|
5041
|
+
if (isNaN(w) || isNaN(h) || h === 0)
|
|
5042
|
+
throw new Error(`Invalid aspect ratio "${str2}"`);
|
|
5043
|
+
return w / h;
|
|
5044
|
+
}
|
|
5045
|
+
|
|
5046
|
+
// ../parser/src/config.ts
|
|
5047
|
+
function resolveConfig(headmatter, themeMeta = {}) {
|
|
5048
|
+
var _a, _b;
|
|
5049
|
+
const themeHightlighter = ["prism", "shiki"].includes(themeMeta.highlighter || "") ? themeMeta.highlighter : void 0;
|
|
5050
|
+
const themeColorSchema = ["light", "dark"].includes(themeMeta.colorSchema || "") ? themeMeta.colorSchema : void 0;
|
|
5051
|
+
const defaultConfig2 = {
|
|
5052
|
+
theme: "default",
|
|
5053
|
+
title: "Slidev",
|
|
5054
|
+
titleTemplate: "%s - Slidev",
|
|
5055
|
+
remoteAssets: false,
|
|
5056
|
+
monaco: "dev",
|
|
5057
|
+
download: false,
|
|
5058
|
+
info: false,
|
|
5059
|
+
highlighter: themeHightlighter || "prism",
|
|
5060
|
+
lineNumbers: false,
|
|
5061
|
+
colorSchema: themeColorSchema || "auto",
|
|
5062
|
+
routerMode: "history",
|
|
5063
|
+
aspectRatio: 16 / 9,
|
|
5064
|
+
canvasWidth: 980,
|
|
5065
|
+
selectable: false,
|
|
5066
|
+
themeConfig: {},
|
|
5067
|
+
fonts: {},
|
|
5068
|
+
favicon: "https://cdn.jsdelivr.net/gh/slidevjs/slidev/assets/favicon.png",
|
|
5069
|
+
drawings: {},
|
|
5070
|
+
plantUmlServer: "https://www.plantuml.com/plantuml"
|
|
5071
|
+
};
|
|
5072
|
+
const config2 = _chunkBYTWGCY3js.__spreadProps.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, defaultConfig2), themeMeta.defaults), headmatter.config), headmatter), {
|
|
5073
|
+
fonts: resolveFonts(_chunkBYTWGCY3js.__spreadValues.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, (_a = themeMeta.defaults) == null ? void 0 : _a.fonts), (_b = headmatter.config) == null ? void 0 : _b.fonts), headmatter == null ? void 0 : headmatter.fonts)),
|
|
5074
|
+
drawings: resolveDarwings(headmatter.drawings)
|
|
5075
|
+
});
|
|
5076
|
+
if (config2.colorSchema !== "dark" && config2.colorSchema !== "light")
|
|
5077
|
+
config2.colorSchema = "auto";
|
|
5078
|
+
if (themeColorSchema && config2.colorSchema === "auto")
|
|
5079
|
+
config2.colorSchema = themeColorSchema;
|
|
5080
|
+
config2.aspectRatio = parseAspectRatio(config2.aspectRatio);
|
|
5081
|
+
if (themeColorSchema && config2.colorSchema !== themeColorSchema)
|
|
5082
|
+
console.warn(`[slidev] Color schema "${config2.colorSchema}" does not supported by the theme`);
|
|
5083
|
+
if (themeHightlighter && config2.highlighter !== themeHightlighter)
|
|
5084
|
+
console.warn(`[slidev] Syntax highlighter "${config2.highlighter}" does not supported by the theme`);
|
|
5085
|
+
return config2;
|
|
5086
|
+
}
|
|
5087
|
+
function resolveFonts(fonts = {}) {
|
|
5088
|
+
const {
|
|
5089
|
+
fallbacks = true,
|
|
5090
|
+
italic = false,
|
|
5091
|
+
provider = "google"
|
|
5092
|
+
} = fonts;
|
|
5093
|
+
let sans = _utils.toArray.call(void 0, fonts.sans).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5094
|
+
let serif = _utils.toArray.call(void 0, fonts.serif).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5095
|
+
let mono = _utils.toArray.call(void 0, fonts.mono).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5096
|
+
const weights = _utils.toArray.call(void 0, fonts.weights || "200,400,600").flatMap((i) => i.toString().split(/,\s*/g)).map((i) => i.trim());
|
|
5097
|
+
const custom = _utils.toArray.call(void 0, fonts.custom).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5098
|
+
const local = _utils.toArray.call(void 0, fonts.local).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5099
|
+
const webfonts = fonts.webfonts ? fonts.webfonts : fallbacks ? _utils.uniq.call(void 0, [...sans, ...serif, ...mono, ...custom]) : [];
|
|
5100
|
+
webfonts.filter((i) => local.includes(i));
|
|
5101
|
+
function toQuoted(font) {
|
|
5102
|
+
if (/^(['"]).*\1$/.test(font))
|
|
5103
|
+
return font;
|
|
5104
|
+
return `"${font}"`;
|
|
5105
|
+
}
|
|
5106
|
+
if (fallbacks) {
|
|
5107
|
+
sans = _utils.uniq.call(void 0, [
|
|
5108
|
+
...sans.map(toQuoted),
|
|
5109
|
+
"ui-sans-serif",
|
|
5110
|
+
"system-ui",
|
|
5111
|
+
"-apple-system",
|
|
5112
|
+
"BlinkMacSystemFont",
|
|
5113
|
+
'"Segoe UI"',
|
|
5114
|
+
"Roboto",
|
|
5115
|
+
'"Helvetica Neue"',
|
|
5116
|
+
"Arial",
|
|
5117
|
+
'"Noto Sans"',
|
|
5118
|
+
"sans-serif",
|
|
5119
|
+
'"Apple Color Emoji"',
|
|
5120
|
+
'"Segoe UI Emoji"',
|
|
5121
|
+
'"Segoe UI Symbol"',
|
|
5122
|
+
'"Noto Color Emoji"'
|
|
5123
|
+
]);
|
|
5124
|
+
serif = _utils.uniq.call(void 0, [
|
|
5125
|
+
...serif.map(toQuoted),
|
|
5126
|
+
"ui-serif",
|
|
5127
|
+
"Georgia",
|
|
5128
|
+
"Cambria",
|
|
5129
|
+
'"Times New Roman"',
|
|
5130
|
+
"Times",
|
|
5131
|
+
"serif"
|
|
5132
|
+
]);
|
|
5133
|
+
mono = _utils.uniq.call(void 0, [
|
|
5134
|
+
...mono.map(toQuoted),
|
|
5135
|
+
"ui-monospace",
|
|
5136
|
+
"SFMono-Regular",
|
|
5137
|
+
"Menlo",
|
|
5138
|
+
"Monaco",
|
|
5139
|
+
"Consolas",
|
|
5140
|
+
'"Liberation Mono"',
|
|
5141
|
+
'"Courier New"',
|
|
5142
|
+
"monospace"
|
|
5143
|
+
]);
|
|
5144
|
+
}
|
|
5145
|
+
return {
|
|
5146
|
+
sans,
|
|
5147
|
+
serif,
|
|
5148
|
+
mono,
|
|
5149
|
+
webfonts,
|
|
5150
|
+
provider,
|
|
5151
|
+
local,
|
|
5152
|
+
italic,
|
|
5153
|
+
weights
|
|
5154
|
+
};
|
|
5155
|
+
}
|
|
5156
|
+
function resolveDarwings(options = {}) {
|
|
5157
|
+
const {
|
|
5158
|
+
enabled = true,
|
|
5159
|
+
persist = false,
|
|
5160
|
+
presenterOnly = false,
|
|
5161
|
+
syncAll = true
|
|
5162
|
+
} = options;
|
|
5163
|
+
const persistPath = typeof persist === "string" ? persist : persist ? ".slidev/drawings" : false;
|
|
5164
|
+
return {
|
|
5165
|
+
enabled,
|
|
5166
|
+
persist: persistPath,
|
|
5167
|
+
presenterOnly,
|
|
5168
|
+
syncAll
|
|
5169
|
+
};
|
|
5170
|
+
}
|
|
5171
|
+
|
|
5172
|
+
// ../parser/src/core.ts
|
|
5173
|
+
function stringify(data) {
|
|
5174
|
+
return `${data.slides.map((slide, idx) => stringifySlide(slide.inline || slide, idx)).join("\n").trim()}
|
|
5175
|
+
`;
|
|
5176
|
+
}
|
|
5177
|
+
function filterDisabled(data) {
|
|
5178
|
+
data.slides = data.slides.filter((i) => {
|
|
5179
|
+
var _a;
|
|
5180
|
+
return !((_a = i.frontmatter) == null ? void 0 : _a.disabled);
|
|
5181
|
+
});
|
|
5182
|
+
return data;
|
|
5183
|
+
}
|
|
5184
|
+
function stringifySlide(data, idx = 0) {
|
|
5185
|
+
if (data.raw == null)
|
|
5186
|
+
prettifySlide(data);
|
|
5187
|
+
return data.raw.startsWith("---") || idx === 0 ? data.raw : `---
|
|
5188
|
+
${data.raw.startsWith("\n") ? data.raw : `
|
|
5189
|
+
${data.raw}`}`;
|
|
5190
|
+
}
|
|
5191
|
+
function prettifySlide(data) {
|
|
5192
|
+
data.content = `
|
|
5193
|
+
${data.content.trim()}
|
|
5194
|
+
`;
|
|
5195
|
+
data.raw = Object.keys(data.frontmatter || {}).length ? `---
|
|
5196
|
+
${js_yaml_default.dump(data.frontmatter).trim()}
|
|
5197
|
+
---
|
|
5198
|
+
${data.content}` : data.content;
|
|
5199
|
+
if (data.note)
|
|
5200
|
+
data.raw += `
|
|
5201
|
+
<!--
|
|
5202
|
+
${data.note.trim()}
|
|
5203
|
+
-->
|
|
5204
|
+
`;
|
|
5205
|
+
else
|
|
5206
|
+
data.raw += "\n";
|
|
5207
|
+
return data;
|
|
5208
|
+
}
|
|
5209
|
+
function prettify(data) {
|
|
5210
|
+
data.slides.forEach(prettifySlide);
|
|
5211
|
+
return data;
|
|
5212
|
+
}
|
|
5213
|
+
function matter(code) {
|
|
5214
|
+
let data = {};
|
|
5215
|
+
const content = code.replace(/^---.*\r?\n([\s\S]*?)---/, (_, d) => {
|
|
5216
|
+
data = js_yaml_default.load(d);
|
|
5217
|
+
if (!_utils.isObject.call(void 0, data))
|
|
5218
|
+
data = {};
|
|
5219
|
+
return "";
|
|
5220
|
+
});
|
|
5221
|
+
return { data, content };
|
|
5222
|
+
}
|
|
5223
|
+
function detectFeatures(code) {
|
|
5224
|
+
return {
|
|
5225
|
+
katex: !!code.match(/\$.*?\$/) || !!code.match(/$\$\$/),
|
|
5226
|
+
monaco: !!code.match(/{monaco.*}/),
|
|
5227
|
+
tweet: !!code.match(/<Tweet\b/),
|
|
5228
|
+
mermaid: !!code.match(/^```mermaid/m)
|
|
5229
|
+
};
|
|
5230
|
+
}
|
|
5231
|
+
function parseSlide(raw) {
|
|
5232
|
+
var _a, _b;
|
|
5233
|
+
const result = matter(raw);
|
|
5234
|
+
let note;
|
|
5235
|
+
const frontmatter = result.data || {};
|
|
5236
|
+
let content = result.content.trim();
|
|
5237
|
+
const comments = Array.from(content.matchAll(/<!--([\s\S]*?)-->/g));
|
|
5238
|
+
if (comments.length) {
|
|
5239
|
+
const last = comments[comments.length - 1];
|
|
5240
|
+
if (last.index && last.index + last[0].length >= content.length) {
|
|
5241
|
+
note = last[1].trim();
|
|
5242
|
+
content = content.slice(0, last.index).trim();
|
|
5243
|
+
}
|
|
5244
|
+
}
|
|
5245
|
+
let title;
|
|
5246
|
+
let level;
|
|
5247
|
+
if (frontmatter.title || frontmatter.name) {
|
|
5248
|
+
title = frontmatter.title || frontmatter.name;
|
|
5249
|
+
level = frontmatter.level || 1;
|
|
5250
|
+
} else {
|
|
5251
|
+
const match = content.match(/^(#+) (.*)$/m);
|
|
5252
|
+
title = (_a = match == null ? void 0 : match[2]) == null ? void 0 : _a.trim();
|
|
5253
|
+
level = (_b = match == null ? void 0 : match[1]) == null ? void 0 : _b.length;
|
|
5254
|
+
}
|
|
5255
|
+
return {
|
|
5256
|
+
raw,
|
|
5257
|
+
title,
|
|
5258
|
+
level,
|
|
5259
|
+
content,
|
|
5260
|
+
frontmatter,
|
|
5261
|
+
note
|
|
5262
|
+
};
|
|
5263
|
+
}
|
|
5264
|
+
function parse(markdown, filepath, themeMeta) {
|
|
5265
|
+
var _a, _b;
|
|
5266
|
+
const lines = markdown.split(/\r?\n/g);
|
|
5267
|
+
const slides = [];
|
|
5268
|
+
let start = 0;
|
|
5269
|
+
function slice(end) {
|
|
5270
|
+
if (start === end)
|
|
5271
|
+
return;
|
|
5272
|
+
const raw = lines.slice(start, end).join("\n");
|
|
5273
|
+
slides.push(_chunkBYTWGCY3js.__spreadProps.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, parseSlide(raw)), {
|
|
5274
|
+
index: slides.length,
|
|
5275
|
+
start,
|
|
5276
|
+
end
|
|
5277
|
+
}));
|
|
5278
|
+
start = end + 1;
|
|
5279
|
+
}
|
|
5280
|
+
for (let i = 0; i < lines.length; i++) {
|
|
5281
|
+
const line = lines[i].trimEnd();
|
|
5282
|
+
if (line.match(/^---+/)) {
|
|
5283
|
+
slice(i);
|
|
5284
|
+
const next = lines[i + 1];
|
|
5285
|
+
if (line.match(/^---([^-].*)?$/) && !(next == null ? void 0 : next.match(/^\s*$/))) {
|
|
5286
|
+
start = i;
|
|
5287
|
+
for (i += 1; i < lines.length; i++) {
|
|
5288
|
+
if (lines[i].trimEnd().match(/^---$/))
|
|
5289
|
+
break;
|
|
5290
|
+
}
|
|
5291
|
+
}
|
|
5292
|
+
} else if (line.startsWith("```")) {
|
|
5293
|
+
for (i += 1; i < lines.length; i++) {
|
|
5294
|
+
if (lines[i].startsWith("```"))
|
|
5295
|
+
break;
|
|
5296
|
+
}
|
|
5297
|
+
}
|
|
5298
|
+
}
|
|
5299
|
+
if (start <= lines.length - 1)
|
|
5300
|
+
slice(lines.length);
|
|
5301
|
+
const headmatter = ((_a = slides[0]) == null ? void 0 : _a.frontmatter) || {};
|
|
5302
|
+
headmatter.title = headmatter.title || ((_b = slides[0]) == null ? void 0 : _b.title);
|
|
5303
|
+
const config2 = resolveConfig(headmatter, themeMeta);
|
|
5304
|
+
const features = detectFeatures(markdown);
|
|
5305
|
+
return {
|
|
5306
|
+
raw: markdown,
|
|
5307
|
+
filepath,
|
|
5308
|
+
slides,
|
|
5309
|
+
config: config2,
|
|
5310
|
+
features,
|
|
5311
|
+
headmatter,
|
|
5312
|
+
themeMeta
|
|
5313
|
+
};
|
|
5314
|
+
}
|
|
5315
|
+
function mergeFeatureFlags(a, b) {
|
|
5316
|
+
return _utils.objectMap.call(void 0, a, (k, v) => [k, v || b[k]]);
|
|
5317
|
+
}
|
|
5318
|
+
function scanMonacoModules(md) {
|
|
5319
|
+
const typeModules = /* @__PURE__ */ new Set();
|
|
5320
|
+
md.replace(/^```(\w+?)\s*{monaco([\w:,-]*)}[\s\n]*([\s\S]+?)^```/mg, (full, lang = "ts", options, code) => {
|
|
5321
|
+
options = options || "";
|
|
5322
|
+
lang = lang.trim();
|
|
5323
|
+
if (lang === "ts" || lang === "typescript") {
|
|
5324
|
+
Array.from(code.matchAll(/\s+from\s+(["'])([\/\w@-]+)\1/g)).map((i) => i[2]).filter(_utils.isTruthy).map((i) => typeModules.add(i));
|
|
5325
|
+
}
|
|
5326
|
+
return "";
|
|
5327
|
+
});
|
|
5328
|
+
return Array.from(typeModules);
|
|
5329
|
+
}
|
|
5330
|
+
|
|
5331
|
+
// ../parser/src/fs.ts
|
|
5332
|
+
async function load2(filepath, themeMeta, content) {
|
|
5333
|
+
const dir = _path.dirname.call(void 0, filepath);
|
|
5334
|
+
const markdown = content != null ? content : await _fs.promises.readFile(filepath, "utf-8");
|
|
5335
|
+
const data = parse(markdown, filepath, themeMeta);
|
|
5336
|
+
const entries = /* @__PURE__ */ new Set([
|
|
5337
|
+
filepath
|
|
5338
|
+
]);
|
|
5339
|
+
for (const slide of data.slides) {
|
|
5340
|
+
if (!slide.frontmatter.src)
|
|
5341
|
+
continue;
|
|
5342
|
+
const path3 = _path.resolve.call(void 0, dir, slide.frontmatter.src);
|
|
5343
|
+
const raw = await _fs.promises.readFile(path3, "utf-8");
|
|
5344
|
+
const source = parseSlide(raw);
|
|
5345
|
+
const inline = _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, slide);
|
|
5346
|
+
slide.source = _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
5347
|
+
filepath: path3
|
|
5348
|
+
}, source);
|
|
5349
|
+
slide.inline = inline;
|
|
5350
|
+
Object.assign(slide, slide.source);
|
|
5351
|
+
slide.frontmatter = _chunkBYTWGCY3js.__spreadValues.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, slide.source.frontmatter), inline.frontmatter);
|
|
5352
|
+
data.features = mergeFeatureFlags(data.features, detectFeatures(raw));
|
|
5353
|
+
entries.add(path3);
|
|
5354
|
+
}
|
|
5355
|
+
data.entries = Array.from(entries);
|
|
5356
|
+
return data;
|
|
5357
|
+
}
|
|
5358
|
+
async function save(data, filepath) {
|
|
5359
|
+
filepath = filepath || data.filepath;
|
|
5360
|
+
await _fs.promises.writeFile(filepath, stringify(data), "utf-8");
|
|
5361
|
+
}
|
|
5362
|
+
async function saveExternalSlide(slide) {
|
|
5363
|
+
await _fs.promises.writeFile(slide.filepath, stringifySlide(slide), "utf-8");
|
|
5364
|
+
}
|
|
5365
|
+
|
|
5366
|
+
// node/parser.ts
|
|
5367
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2325
5368
|
|
|
2326
5369
|
// package.json
|
|
2327
|
-
var version = "0.
|
|
5370
|
+
var version = "0.28.0";
|
|
2328
5371
|
|
|
2329
5372
|
// node/themes.ts
|
|
2330
|
-
|
|
5373
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2331
5374
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
2332
5375
|
|
|
2333
5376
|
// ../../node_modules/.pnpm/@antfu+ni@0.12.0/node_modules/@antfu/ni/dist/index.mjs
|
|
2334
|
-
|
|
5377
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2335
5378
|
|
|
2336
5379
|
// ../../node_modules/.pnpm/@antfu+ni@0.12.0/node_modules/@antfu/ni/dist/chunk-7FS5ZXAO.mjs
|
|
2337
|
-
|
|
5380
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
2338
5381
|
var _os2 = require('os'); var _os3 = _interopRequireDefault(_os2);
|
|
2339
5382
|
var _child_process = require('child_process');
|
|
2340
|
-
|
|
2341
|
-
|
|
5383
|
+
|
|
5384
|
+
|
|
2342
5385
|
|
|
2343
5386
|
|
|
2344
5387
|
var __create = Object.create;
|
|
@@ -2352,7 +5395,7 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
2352
5395
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2353
5396
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
2354
5397
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2355
|
-
var
|
|
5398
|
+
var __spreadValues2 = (a, b) => {
|
|
2356
5399
|
for (var prop in b || (b = {}))
|
|
2357
5400
|
if (__hasOwnProp.call(b, prop))
|
|
2358
5401
|
__defNormalProp(a, prop, b[prop]);
|
|
@@ -2363,11 +5406,11 @@ var __spreadValues = (a, b) => {
|
|
|
2363
5406
|
}
|
|
2364
5407
|
return a;
|
|
2365
5408
|
};
|
|
2366
|
-
var
|
|
5409
|
+
var __spreadProps2 = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2367
5410
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
2368
5411
|
var __require2 = (x) => {
|
|
2369
|
-
if (typeof
|
|
2370
|
-
return
|
|
5412
|
+
if (typeof _chunkBYTWGCY3js.__require !== "undefined")
|
|
5413
|
+
return _chunkBYTWGCY3js.__require.call(void 0, x);
|
|
2371
5414
|
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
2372
5415
|
};
|
|
2373
5416
|
var __objRest = (source, exclude2) => {
|
|
@@ -2468,11 +5511,11 @@ var require_mode = __commonJS2({
|
|
|
2468
5511
|
var require_isexe = __commonJS2({
|
|
2469
5512
|
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
2470
5513
|
var fs22 = __require2("fs");
|
|
2471
|
-
var
|
|
5514
|
+
var core2;
|
|
2472
5515
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
2473
|
-
|
|
5516
|
+
core2 = require_windows();
|
|
2474
5517
|
} else {
|
|
2475
|
-
|
|
5518
|
+
core2 = require_mode();
|
|
2476
5519
|
}
|
|
2477
5520
|
module.exports = isexe;
|
|
2478
5521
|
isexe.sync = sync;
|
|
@@ -2495,7 +5538,7 @@ var require_isexe = __commonJS2({
|
|
|
2495
5538
|
});
|
|
2496
5539
|
});
|
|
2497
5540
|
}
|
|
2498
|
-
|
|
5541
|
+
core2(path3, options || {}, function(er, is) {
|
|
2499
5542
|
if (er) {
|
|
2500
5543
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
2501
5544
|
er = null;
|
|
@@ -2507,7 +5550,7 @@ var require_isexe = __commonJS2({
|
|
|
2507
5550
|
}
|
|
2508
5551
|
function sync(path3, options) {
|
|
2509
5552
|
try {
|
|
2510
|
-
return
|
|
5553
|
+
return core2.sync(path3, options || {});
|
|
2511
5554
|
} catch (er) {
|
|
2512
5555
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
2513
5556
|
return false;
|
|
@@ -2643,17 +5686,17 @@ var require_kleur = __commonJS2({
|
|
|
2643
5686
|
bgCyan: init(46, 49),
|
|
2644
5687
|
bgWhite: init(47, 49)
|
|
2645
5688
|
};
|
|
2646
|
-
function run2(arr,
|
|
5689
|
+
function run2(arr, str2) {
|
|
2647
5690
|
let i = 0, tmp, beg = "", end = "";
|
|
2648
5691
|
for (; i < arr.length; i++) {
|
|
2649
5692
|
tmp = arr[i];
|
|
2650
5693
|
beg += tmp.open;
|
|
2651
5694
|
end += tmp.close;
|
|
2652
|
-
if (
|
|
2653
|
-
|
|
5695
|
+
if (str2.includes(tmp.close)) {
|
|
5696
|
+
str2 = str2.replace(tmp.rgx, tmp.close + tmp.open);
|
|
2654
5697
|
}
|
|
2655
5698
|
}
|
|
2656
|
-
return beg +
|
|
5699
|
+
return beg + str2 + end;
|
|
2657
5700
|
}
|
|
2658
5701
|
function chain(has, keys) {
|
|
2659
5702
|
let ctx = { has, keys };
|
|
@@ -2763,10 +5806,10 @@ var require_action = __commonJS2({
|
|
|
2763
5806
|
var require_strip = __commonJS2({
|
|
2764
5807
|
"node_modules/.pnpm/prompts@2.4.1/node_modules/prompts/dist/util/strip.js"(exports, module) {
|
|
2765
5808
|
"use strict";
|
|
2766
|
-
module.exports = (
|
|
5809
|
+
module.exports = (str2) => {
|
|
2767
5810
|
const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");
|
|
2768
5811
|
const RGX = new RegExp(pattern, "g");
|
|
2769
|
-
return typeof
|
|
5812
|
+
return typeof str2 === "string" ? str2.replace(RGX, "") : str2;
|
|
2770
5813
|
};
|
|
2771
5814
|
}
|
|
2772
5815
|
});
|
|
@@ -2895,7 +5938,7 @@ var require_clear = __commonJS2({
|
|
|
2895
5938
|
var _require = require_src();
|
|
2896
5939
|
var erase = _require.erase;
|
|
2897
5940
|
var cursor = _require.cursor;
|
|
2898
|
-
var width = (
|
|
5941
|
+
var width = (str2) => [...strip(str2)].length;
|
|
2899
5942
|
module.exports = function(prompt, perLine) {
|
|
2900
5943
|
if (!perLine)
|
|
2901
5944
|
return erase.line + cursor.to(0);
|
|
@@ -2974,7 +6017,7 @@ var require_style = __commonJS2({
|
|
|
2974
6017
|
render: (input) => `${input}`
|
|
2975
6018
|
}
|
|
2976
6019
|
});
|
|
2977
|
-
var render = (
|
|
6020
|
+
var render = (type2) => styles[type2] || styles.default;
|
|
2978
6021
|
var symbols = Object.freeze({
|
|
2979
6022
|
aborted: c.red(figures.cross),
|
|
2980
6023
|
done: c.green(figures.tick),
|
|
@@ -3079,10 +6122,10 @@ var require_prompt = __commonJS2({
|
|
|
3079
6122
|
if (this.in.isTTY)
|
|
3080
6123
|
this.in.setRawMode(true);
|
|
3081
6124
|
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
3082
|
-
const keypress = (
|
|
6125
|
+
const keypress = (str2, key) => {
|
|
3083
6126
|
let a = action(key, isSelect);
|
|
3084
6127
|
if (a === false) {
|
|
3085
|
-
this._ && this._(
|
|
6128
|
+
this._ && this._(str2, key);
|
|
3086
6129
|
} else if (typeof this[a] === "function") {
|
|
3087
6130
|
this[a](key);
|
|
3088
6131
|
} else {
|
|
@@ -4119,7 +7162,7 @@ var require_number = __commonJS2({
|
|
|
4119
7162
|
var figures = _require2.figures;
|
|
4120
7163
|
var clear = _require2.clear;
|
|
4121
7164
|
var lines = _require2.lines;
|
|
4122
|
-
var
|
|
7165
|
+
var isNumber2 = /[0-9]/;
|
|
4123
7166
|
var isDef = (any) => any !== void 0;
|
|
4124
7167
|
var round = (number, precision) => {
|
|
4125
7168
|
let factor = Math.pow(10, precision);
|
|
@@ -4163,7 +7206,7 @@ var require_number = __commonJS2({
|
|
|
4163
7206
|
return this.float ? parseFloat(x) : parseInt(x);
|
|
4164
7207
|
}
|
|
4165
7208
|
valid(c) {
|
|
4166
|
-
return c === `-` || c === `.` && this.float ||
|
|
7209
|
+
return c === `-` || c === `.` && this.float || isNumber2.test(c);
|
|
4167
7210
|
}
|
|
4168
7211
|
reset() {
|
|
4169
7212
|
this.typed = ``;
|
|
@@ -5054,9 +8097,9 @@ var require_prompts = __commonJS2({
|
|
|
5054
8097
|
var $ = exports;
|
|
5055
8098
|
var el = require_elements();
|
|
5056
8099
|
var noop = (v) => v;
|
|
5057
|
-
function toPrompt(
|
|
8100
|
+
function toPrompt(type2, args, opts = {}) {
|
|
5058
8101
|
return new Promise((res, rej) => {
|
|
5059
|
-
const p = new el[
|
|
8102
|
+
const p = new el[type2](args);
|
|
5060
8103
|
const onAbort = opts.onAbort || noop;
|
|
5061
8104
|
const onSubmit = opts.onSubmit || noop;
|
|
5062
8105
|
const onExit = opts.onExit || noop;
|
|
@@ -5081,7 +8124,7 @@ var require_prompts = __commonJS2({
|
|
|
5081
8124
|
$.list = (args) => {
|
|
5082
8125
|
const sep = args.separator || ",";
|
|
5083
8126
|
return toPrompt("TextPrompt", args, {
|
|
5084
|
-
onSubmit: (
|
|
8127
|
+
onSubmit: (str2) => str2.split(sep).map((s) => s.trim())
|
|
5085
8128
|
});
|
|
5086
8129
|
};
|
|
5087
8130
|
$.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -5253,7 +8296,7 @@ var require_dist = __commonJS2({
|
|
|
5253
8296
|
const answers = {};
|
|
5254
8297
|
const override2 = prompt._override || {};
|
|
5255
8298
|
questions = [].concat(questions);
|
|
5256
|
-
let answer, question, quit, name,
|
|
8299
|
+
let answer, question, quit, name, type2, lastPrompt;
|
|
5257
8300
|
const getFormattedAnswer = /* @__PURE__ */ function() {
|
|
5258
8301
|
var _ref = _asyncToGenerator(function* (question2, answer2, skipValidation = false) {
|
|
5259
8302
|
if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
|
|
@@ -5271,12 +8314,12 @@ var require_dist = __commonJS2({
|
|
|
5271
8314
|
question = _step.value;
|
|
5272
8315
|
var _question = question;
|
|
5273
8316
|
name = _question.name;
|
|
5274
|
-
|
|
5275
|
-
if (typeof
|
|
5276
|
-
|
|
5277
|
-
question["type"] =
|
|
8317
|
+
type2 = _question.type;
|
|
8318
|
+
if (typeof type2 === "function") {
|
|
8319
|
+
type2 = yield type2(answer, _objectSpread({}, answers), question);
|
|
8320
|
+
question["type"] = type2;
|
|
5278
8321
|
}
|
|
5279
|
-
if (!
|
|
8322
|
+
if (!type2)
|
|
5280
8323
|
continue;
|
|
5281
8324
|
for (let key in question) {
|
|
5282
8325
|
if (passOn.includes(key))
|
|
@@ -5290,9 +8333,9 @@ var require_dist = __commonJS2({
|
|
|
5290
8333
|
}
|
|
5291
8334
|
var _question2 = question;
|
|
5292
8335
|
name = _question2.name;
|
|
5293
|
-
|
|
5294
|
-
if (prompts3[
|
|
5295
|
-
throw new Error(`prompt type (${
|
|
8336
|
+
type2 = _question2.type;
|
|
8337
|
+
if (prompts3[type2] === void 0) {
|
|
8338
|
+
throw new Error(`prompt type (${type2}) is not defined`);
|
|
5296
8339
|
}
|
|
5297
8340
|
if (override2[question.name] !== void 0) {
|
|
5298
8341
|
answer = yield getFormattedAnswer(question, override2[question.name]);
|
|
@@ -5302,7 +8345,7 @@ var require_dist = __commonJS2({
|
|
|
5302
8345
|
}
|
|
5303
8346
|
}
|
|
5304
8347
|
try {
|
|
5305
|
-
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts3[
|
|
8348
|
+
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts3[type2](question);
|
|
5306
8349
|
answers[name] = answer = yield getFormattedAnswer(question, answer, true);
|
|
5307
8350
|
quit = yield onSubmit(question, answer, answers);
|
|
5308
8351
|
} catch (err) {
|
|
@@ -5402,13 +8445,13 @@ var require_action2 = __commonJS2({
|
|
|
5402
8445
|
var require_strip2 = __commonJS2({
|
|
5403
8446
|
"node_modules/.pnpm/prompts@2.4.1/node_modules/prompts/lib/util/strip.js"(exports, module) {
|
|
5404
8447
|
"use strict";
|
|
5405
|
-
module.exports = (
|
|
8448
|
+
module.exports = (str2) => {
|
|
5406
8449
|
const pattern = [
|
|
5407
8450
|
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)",
|
|
5408
8451
|
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"
|
|
5409
8452
|
].join("|");
|
|
5410
8453
|
const RGX = new RegExp(pattern, "g");
|
|
5411
|
-
return typeof
|
|
8454
|
+
return typeof str2 === "string" ? str2.replace(RGX, "") : str2;
|
|
5412
8455
|
};
|
|
5413
8456
|
}
|
|
5414
8457
|
});
|
|
@@ -5417,7 +8460,7 @@ var require_clear2 = __commonJS2({
|
|
|
5417
8460
|
"use strict";
|
|
5418
8461
|
var strip = require_strip2();
|
|
5419
8462
|
var { erase, cursor } = require_src();
|
|
5420
|
-
var width = (
|
|
8463
|
+
var width = (str2) => [...strip(str2)].length;
|
|
5421
8464
|
module.exports = function(prompt, perLine) {
|
|
5422
8465
|
if (!perLine)
|
|
5423
8466
|
return erase.line + cursor.to(0);
|
|
@@ -5476,7 +8519,7 @@ var require_style2 = __commonJS2({
|
|
|
5476
8519
|
invisible: { scale: 0, render: (input) => "" },
|
|
5477
8520
|
default: { scale: 1, render: (input) => `${input}` }
|
|
5478
8521
|
});
|
|
5479
|
-
var render = (
|
|
8522
|
+
var render = (type2) => styles[type2] || styles.default;
|
|
5480
8523
|
var symbols = Object.freeze({
|
|
5481
8524
|
aborted: c.red(figures.cross),
|
|
5482
8525
|
done: c.green(figures.tick),
|
|
@@ -5572,10 +8615,10 @@ var require_prompt2 = __commonJS2({
|
|
|
5572
8615
|
if (this.in.isTTY)
|
|
5573
8616
|
this.in.setRawMode(true);
|
|
5574
8617
|
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
5575
|
-
const keypress = (
|
|
8618
|
+
const keypress = (str2, key) => {
|
|
5576
8619
|
let a = action(key, isSelect);
|
|
5577
8620
|
if (a === false) {
|
|
5578
|
-
this._ && this._(
|
|
8621
|
+
this._ && this._(str2, key);
|
|
5579
8622
|
} else if (typeof this[a] === "function") {
|
|
5580
8623
|
this[a](key);
|
|
5581
8624
|
} else {
|
|
@@ -6478,7 +9521,7 @@ var require_number2 = __commonJS2({
|
|
|
6478
9521
|
var Prompt = require_prompt2();
|
|
6479
9522
|
var { cursor, erase } = require_src();
|
|
6480
9523
|
var { style, figures, clear, lines } = require_util2();
|
|
6481
|
-
var
|
|
9524
|
+
var isNumber2 = /[0-9]/;
|
|
6482
9525
|
var isDef = (any) => any !== void 0;
|
|
6483
9526
|
var round = (number, precision) => {
|
|
6484
9527
|
let factor = Math.pow(10, precision);
|
|
@@ -6522,7 +9565,7 @@ var require_number2 = __commonJS2({
|
|
|
6522
9565
|
return this.float ? parseFloat(x) : parseInt(x);
|
|
6523
9566
|
}
|
|
6524
9567
|
valid(c) {
|
|
6525
|
-
return c === `-` || c === `.` && this.float ||
|
|
9568
|
+
return c === `-` || c === `.` && this.float || isNumber2.test(c);
|
|
6526
9569
|
}
|
|
6527
9570
|
reset() {
|
|
6528
9571
|
this.typed = ``;
|
|
@@ -7359,9 +10402,9 @@ var require_prompts2 = __commonJS2({
|
|
|
7359
10402
|
var $ = exports;
|
|
7360
10403
|
var el = require_elements2();
|
|
7361
10404
|
var noop = (v) => v;
|
|
7362
|
-
function toPrompt(
|
|
10405
|
+
function toPrompt(type2, args, opts = {}) {
|
|
7363
10406
|
return new Promise((res, rej) => {
|
|
7364
|
-
const p = new el[
|
|
10407
|
+
const p = new el[type2](args);
|
|
7365
10408
|
const onAbort = opts.onAbort || noop;
|
|
7366
10409
|
const onSubmit = opts.onSubmit || noop;
|
|
7367
10410
|
const onExit = opts.onExit || noop;
|
|
@@ -7386,7 +10429,7 @@ var require_prompts2 = __commonJS2({
|
|
|
7386
10429
|
$.list = (args) => {
|
|
7387
10430
|
const sep = args.separator || ",";
|
|
7388
10431
|
return toPrompt("TextPrompt", args, {
|
|
7389
|
-
onSubmit: (
|
|
10432
|
+
onSubmit: (str2) => str2.split(sep).map((s) => s.trim())
|
|
7390
10433
|
});
|
|
7391
10434
|
};
|
|
7392
10435
|
$.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -7426,7 +10469,7 @@ var require_lib = __commonJS2({
|
|
|
7426
10469
|
const answers = {};
|
|
7427
10470
|
const override2 = prompt._override || {};
|
|
7428
10471
|
questions = [].concat(questions);
|
|
7429
|
-
let answer, question, quit, name,
|
|
10472
|
+
let answer, question, quit, name, type2, lastPrompt;
|
|
7430
10473
|
const getFormattedAnswer = async (question2, answer2, skipValidation = false) => {
|
|
7431
10474
|
if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
|
|
7432
10475
|
return;
|
|
@@ -7434,26 +10477,26 @@ var require_lib = __commonJS2({
|
|
|
7434
10477
|
return question2.format ? await question2.format(answer2, answers) : answer2;
|
|
7435
10478
|
};
|
|
7436
10479
|
for (question of questions) {
|
|
7437
|
-
({ name, type } = question);
|
|
7438
|
-
if (typeof
|
|
7439
|
-
|
|
7440
|
-
question["type"] =
|
|
10480
|
+
({ name, type: type2 } = question);
|
|
10481
|
+
if (typeof type2 === "function") {
|
|
10482
|
+
type2 = await type2(answer, __spreadValues2({}, answers), question);
|
|
10483
|
+
question["type"] = type2;
|
|
7441
10484
|
}
|
|
7442
|
-
if (!
|
|
10485
|
+
if (!type2)
|
|
7443
10486
|
continue;
|
|
7444
10487
|
for (let key in question) {
|
|
7445
10488
|
if (passOn.includes(key))
|
|
7446
10489
|
continue;
|
|
7447
10490
|
let value = question[key];
|
|
7448
|
-
question[key] = typeof value === "function" ? await value(answer,
|
|
10491
|
+
question[key] = typeof value === "function" ? await value(answer, __spreadValues2({}, answers), lastPrompt) : value;
|
|
7449
10492
|
}
|
|
7450
10493
|
lastPrompt = question;
|
|
7451
10494
|
if (typeof question.message !== "string") {
|
|
7452
10495
|
throw new Error("prompt message is required");
|
|
7453
10496
|
}
|
|
7454
|
-
({ name, type } = question);
|
|
7455
|
-
if (prompts3[
|
|
7456
|
-
throw new Error(`prompt type (${
|
|
10497
|
+
({ name, type: type2 } = question);
|
|
10498
|
+
if (prompts3[type2] === void 0) {
|
|
10499
|
+
throw new Error(`prompt type (${type2}) is not defined`);
|
|
7457
10500
|
}
|
|
7458
10501
|
if (override2[question.name] !== void 0) {
|
|
7459
10502
|
answer = await getFormattedAnswer(question, override2[question.name]);
|
|
@@ -7463,7 +10506,7 @@ var require_lib = __commonJS2({
|
|
|
7463
10506
|
}
|
|
7464
10507
|
}
|
|
7465
10508
|
try {
|
|
7466
|
-
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts3[
|
|
10509
|
+
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts3[type2](question);
|
|
7467
10510
|
answers[name] = answer = await getFormattedAnswer(question, answer, true);
|
|
7468
10511
|
quit = await onSubmit(question, answer, answers);
|
|
7469
10512
|
} catch (err) {
|
|
@@ -7549,13 +10592,13 @@ var require_ini = __commonJS2({
|
|
|
7549
10592
|
}
|
|
7550
10593
|
return out;
|
|
7551
10594
|
};
|
|
7552
|
-
var dotSplit = (
|
|
7553
|
-
var decode = (
|
|
10595
|
+
var dotSplit = (str2) => str2.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map((part) => part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, ""));
|
|
10596
|
+
var decode = (str2) => {
|
|
7554
10597
|
const out = Object.create(null);
|
|
7555
10598
|
let p = out;
|
|
7556
10599
|
let section = null;
|
|
7557
10600
|
const re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
|
|
7558
|
-
const lines =
|
|
10601
|
+
const lines = str2.split(/[\r\n]+/g);
|
|
7559
10602
|
for (const line of lines) {
|
|
7560
10603
|
if (!line || line.match(/^\s*[;#]/))
|
|
7561
10604
|
continue;
|
|
@@ -7784,7 +10827,7 @@ var require_p_locate = __commonJS2({
|
|
|
7784
10827
|
return false;
|
|
7785
10828
|
};
|
|
7786
10829
|
var pLocate = async (iterable, tester, options) => {
|
|
7787
|
-
options =
|
|
10830
|
+
options = __spreadValues2({
|
|
7788
10831
|
concurrency: Infinity,
|
|
7789
10832
|
preserveOrder: true
|
|
7790
10833
|
}, options);
|
|
@@ -7816,15 +10859,15 @@ var require_locate_path = __commonJS2({
|
|
|
7816
10859
|
directory: "isDirectory",
|
|
7817
10860
|
file: "isFile"
|
|
7818
10861
|
};
|
|
7819
|
-
function checkType({ type }) {
|
|
7820
|
-
if (
|
|
10862
|
+
function checkType({ type: type2 }) {
|
|
10863
|
+
if (type2 in typeMappings) {
|
|
7821
10864
|
return;
|
|
7822
10865
|
}
|
|
7823
|
-
throw new Error(`Invalid type specified: ${
|
|
10866
|
+
throw new Error(`Invalid type specified: ${type2}`);
|
|
7824
10867
|
}
|
|
7825
|
-
var matchType = (
|
|
10868
|
+
var matchType = (type2, stat) => type2 === void 0 || stat[typeMappings[type2]]();
|
|
7826
10869
|
module.exports = async (paths, options) => {
|
|
7827
|
-
options =
|
|
10870
|
+
options = __spreadValues2({
|
|
7828
10871
|
cwd: process.cwd(),
|
|
7829
10872
|
type: "file",
|
|
7830
10873
|
allowSymlinks: true
|
|
@@ -7841,7 +10884,7 @@ var require_locate_path = __commonJS2({
|
|
|
7841
10884
|
}, options);
|
|
7842
10885
|
};
|
|
7843
10886
|
module.exports.sync = (paths, options) => {
|
|
7844
|
-
options =
|
|
10887
|
+
options = __spreadValues2({
|
|
7845
10888
|
cwd: process.cwd(),
|
|
7846
10889
|
allowSymlinks: true,
|
|
7847
10890
|
type: "file"
|
|
@@ -7906,7 +10949,7 @@ var require_find_up = __commonJS2({
|
|
|
7906
10949
|
return foundPath;
|
|
7907
10950
|
};
|
|
7908
10951
|
while (true) {
|
|
7909
|
-
const foundPath = await runMatcher(
|
|
10952
|
+
const foundPath = await runMatcher(__spreadProps2(__spreadValues2({}, options), { cwd: directory }));
|
|
7910
10953
|
if (foundPath === stop) {
|
|
7911
10954
|
return;
|
|
7912
10955
|
}
|
|
@@ -7934,7 +10977,7 @@ var require_find_up = __commonJS2({
|
|
|
7934
10977
|
return foundPath;
|
|
7935
10978
|
};
|
|
7936
10979
|
while (true) {
|
|
7937
|
-
const foundPath = runMatcher(
|
|
10980
|
+
const foundPath = runMatcher(__spreadProps2(__spreadValues2({}, options), { cwd: directory }));
|
|
7938
10981
|
if (foundPath === stop) {
|
|
7939
10982
|
return;
|
|
7940
10983
|
}
|
|
@@ -8046,11 +11089,11 @@ var require_shebang_command = __commonJS2({
|
|
|
8046
11089
|
return null;
|
|
8047
11090
|
}
|
|
8048
11091
|
const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
8049
|
-
const
|
|
8050
|
-
if (
|
|
11092
|
+
const binary2 = path3.split("/").pop();
|
|
11093
|
+
if (binary2 === "env") {
|
|
8051
11094
|
return argument;
|
|
8052
11095
|
}
|
|
8053
|
-
return argument ? `${
|
|
11096
|
+
return argument ? `${binary2} ${argument}` : binary2;
|
|
8054
11097
|
};
|
|
8055
11098
|
}
|
|
8056
11099
|
});
|
|
@@ -8112,7 +11155,7 @@ var require_parse = __commonJS2({
|
|
|
8112
11155
|
}
|
|
8113
11156
|
return parsed;
|
|
8114
11157
|
}
|
|
8115
|
-
function
|
|
11158
|
+
function parse2(command, args, options) {
|
|
8116
11159
|
if (args && !Array.isArray(args)) {
|
|
8117
11160
|
options = args;
|
|
8118
11161
|
args = null;
|
|
@@ -8131,7 +11174,7 @@ var require_parse = __commonJS2({
|
|
|
8131
11174
|
};
|
|
8132
11175
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
8133
11176
|
}
|
|
8134
|
-
module.exports =
|
|
11177
|
+
module.exports = parse2;
|
|
8135
11178
|
}
|
|
8136
11179
|
});
|
|
8137
11180
|
var require_enoent = __commonJS2({
|
|
@@ -8186,16 +11229,16 @@ var require_cross_spawn = __commonJS2({
|
|
|
8186
11229
|
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports, module) {
|
|
8187
11230
|
"use strict";
|
|
8188
11231
|
var cp = __require2("child_process");
|
|
8189
|
-
var
|
|
11232
|
+
var parse2 = require_parse();
|
|
8190
11233
|
var enoent = require_enoent();
|
|
8191
11234
|
function spawn(command, args, options) {
|
|
8192
|
-
const parsed =
|
|
11235
|
+
const parsed = parse2(command, args, options);
|
|
8193
11236
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
8194
11237
|
enoent.hookChildProcess(spawned, parsed);
|
|
8195
11238
|
return spawned;
|
|
8196
11239
|
}
|
|
8197
11240
|
function spawnSync(command, args, options) {
|
|
8198
|
-
const parsed =
|
|
11241
|
+
const parsed = parse2(command, args, options);
|
|
8199
11242
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
8200
11243
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
8201
11244
|
return result;
|
|
@@ -8203,7 +11246,7 @@ var require_cross_spawn = __commonJS2({
|
|
|
8203
11246
|
module.exports = spawn;
|
|
8204
11247
|
module.exports.spawn = spawn;
|
|
8205
11248
|
module.exports.sync = spawnSync;
|
|
8206
|
-
module.exports._parse =
|
|
11249
|
+
module.exports._parse = parse2;
|
|
8207
11250
|
module.exports._enoent = enoent;
|
|
8208
11251
|
}
|
|
8209
11252
|
});
|
|
@@ -8229,7 +11272,7 @@ var require_npm_run_path = __commonJS2({
|
|
|
8229
11272
|
var path3 = __require2("path");
|
|
8230
11273
|
var pathKey = require_path_key();
|
|
8231
11274
|
var npmRunPath = (options) => {
|
|
8232
|
-
options =
|
|
11275
|
+
options = __spreadValues2({
|
|
8233
11276
|
cwd: process.cwd(),
|
|
8234
11277
|
path: process.env[pathKey()],
|
|
8235
11278
|
execPath: process.execPath
|
|
@@ -8249,10 +11292,10 @@ var require_npm_run_path = __commonJS2({
|
|
|
8249
11292
|
module.exports = npmRunPath;
|
|
8250
11293
|
module.exports.default = npmRunPath;
|
|
8251
11294
|
module.exports.env = (options) => {
|
|
8252
|
-
options =
|
|
11295
|
+
options = __spreadValues2({
|
|
8253
11296
|
env: process.env
|
|
8254
11297
|
}, options);
|
|
8255
|
-
const env =
|
|
11298
|
+
const env = __spreadValues2({}, options.env);
|
|
8256
11299
|
const path4 = pathKey({ env });
|
|
8257
11300
|
options.path = env[path4];
|
|
8258
11301
|
env[path4] = module.exports(options);
|
|
@@ -8656,7 +11699,7 @@ var require_main = __commonJS2({
|
|
|
8656
11699
|
return signals.reduce(getSignalByName, {});
|
|
8657
11700
|
};
|
|
8658
11701
|
var getSignalByName = function(signalByNameMemo, { name, number, description, supported, action, forced, standard }) {
|
|
8659
|
-
return
|
|
11702
|
+
return __spreadProps2(__spreadValues2({}, signalByNameMemo), {
|
|
8660
11703
|
[name]: { name, number, description, supported, action, forced, standard }
|
|
8661
11704
|
});
|
|
8662
11705
|
};
|
|
@@ -8854,7 +11897,7 @@ var require_signal_exit = __commonJS2({
|
|
|
8854
11897
|
module.exports = function(cb, opts) {
|
|
8855
11898
|
assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
|
|
8856
11899
|
if (loaded === false) {
|
|
8857
|
-
|
|
11900
|
+
load3();
|
|
8858
11901
|
}
|
|
8859
11902
|
var ev = "exit";
|
|
8860
11903
|
if (opts && opts.alwaysLast) {
|
|
@@ -8910,9 +11953,9 @@ var require_signal_exit = __commonJS2({
|
|
|
8910
11953
|
module.exports.signals = function() {
|
|
8911
11954
|
return signals;
|
|
8912
11955
|
};
|
|
8913
|
-
module.exports.load =
|
|
11956
|
+
module.exports.load = load3;
|
|
8914
11957
|
var loaded = false;
|
|
8915
|
-
function
|
|
11958
|
+
function load3() {
|
|
8916
11959
|
if (loaded) {
|
|
8917
11960
|
return;
|
|
8918
11961
|
}
|
|
@@ -9056,7 +12099,7 @@ var require_buffer_stream = __commonJS2({
|
|
|
9056
12099
|
"use strict";
|
|
9057
12100
|
var { PassThrough: PassThroughStream } = __require2("stream");
|
|
9058
12101
|
module.exports = (options) => {
|
|
9059
|
-
options =
|
|
12102
|
+
options = __spreadValues2({}, options);
|
|
9060
12103
|
const { array } = options;
|
|
9061
12104
|
let { encoding } = options;
|
|
9062
12105
|
const isBuffer = encoding === "buffer";
|
|
@@ -9112,7 +12155,7 @@ var require_get_stream = __commonJS2({
|
|
|
9112
12155
|
if (!inputStream) {
|
|
9113
12156
|
throw new Error("Expected a stream");
|
|
9114
12157
|
}
|
|
9115
|
-
options =
|
|
12158
|
+
options = __spreadValues2({
|
|
9116
12159
|
maxBuffer: Infinity
|
|
9117
12160
|
}, options);
|
|
9118
12161
|
const { maxBuffer } = options;
|
|
@@ -9141,8 +12184,8 @@ var require_get_stream = __commonJS2({
|
|
|
9141
12184
|
return stream2.getBufferedValue();
|
|
9142
12185
|
}
|
|
9143
12186
|
module.exports = getStream;
|
|
9144
|
-
module.exports.buffer = (stream2, options) => getStream(stream2,
|
|
9145
|
-
module.exports.array = (stream2, options) => getStream(stream2,
|
|
12187
|
+
module.exports.buffer = (stream2, options) => getStream(stream2, __spreadProps2(__spreadValues2({}, options), { encoding: "buffer" }));
|
|
12188
|
+
module.exports.array = (stream2, options) => getStream(stream2, __spreadProps2(__spreadValues2({}, options), { array: true }));
|
|
9146
12189
|
module.exports.MaxBufferError = MaxBufferError;
|
|
9147
12190
|
}
|
|
9148
12191
|
});
|
|
@@ -9273,7 +12316,7 @@ var require_promise = __commonJS2({
|
|
|
9273
12316
|
var mergePromise = (spawned, promise) => {
|
|
9274
12317
|
for (const [property, descriptor] of descriptors) {
|
|
9275
12318
|
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
9276
|
-
Reflect.defineProperty(spawned, property,
|
|
12319
|
+
Reflect.defineProperty(spawned, property, __spreadProps2(__spreadValues2({}, descriptor), { value }));
|
|
9277
12320
|
}
|
|
9278
12321
|
return spawned;
|
|
9279
12322
|
};
|
|
@@ -9358,7 +12401,7 @@ var require_execa = __commonJS2({
|
|
|
9358
12401
|
var { joinCommand, parseCommand, getEscapedCommand } = require_command();
|
|
9359
12402
|
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
9360
12403
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
9361
|
-
const env = extendEnv ?
|
|
12404
|
+
const env = extendEnv ? __spreadValues2(__spreadValues2({}, process.env), envOption) : envOption;
|
|
9362
12405
|
if (preferLocal) {
|
|
9363
12406
|
return npmRunPath.env({ env, cwd: localDir, execPath });
|
|
9364
12407
|
}
|
|
@@ -9369,7 +12412,7 @@ var require_execa = __commonJS2({
|
|
|
9369
12412
|
file = parsed.command;
|
|
9370
12413
|
args = parsed.args;
|
|
9371
12414
|
options = parsed.options;
|
|
9372
|
-
options =
|
|
12415
|
+
options = __spreadValues2({
|
|
9373
12416
|
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
9374
12417
|
buffer: true,
|
|
9375
12418
|
stripFinalNewline: true,
|
|
@@ -9551,7 +12594,7 @@ var require_execa = __commonJS2({
|
|
|
9551
12594
|
...nodeOptions,
|
|
9552
12595
|
scriptPath,
|
|
9553
12596
|
...Array.isArray(args) ? args : []
|
|
9554
|
-
],
|
|
12597
|
+
], __spreadProps2(__spreadValues2({}, options), {
|
|
9555
12598
|
stdin: void 0,
|
|
9556
12599
|
stdout: void 0,
|
|
9557
12600
|
stderr: void 0,
|
|
@@ -10022,7 +13065,7 @@ function terminalLink(text, url, _a = {}) {
|
|
|
10022
13065
|
return ansi_escapes_default.link(text, url);
|
|
10023
13066
|
}
|
|
10024
13067
|
terminalLink.isSupported = import_supports_hyperlinks.default.stdout;
|
|
10025
|
-
terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url,
|
|
13068
|
+
terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, __spreadValues2({ target: "stderr" }, options));
|
|
10026
13069
|
terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
|
|
10027
13070
|
var import_prompts = __toModule2(require_prompts3());
|
|
10028
13071
|
async function detect({ autoInstall, cwd }) {
|
|
@@ -10064,7 +13107,7 @@ async function run(fn, args, options = {}) {
|
|
|
10064
13107
|
if (isGlobal) {
|
|
10065
13108
|
command = await fn(await getGlobalAgent(), args);
|
|
10066
13109
|
} else {
|
|
10067
|
-
let agent = await detect(
|
|
13110
|
+
let agent = await detect(__spreadProps2(__spreadValues2({}, options), { cwd })) || await getDefaultAgent();
|
|
10068
13111
|
if (agent === "prompt") {
|
|
10069
13112
|
agent = (await (0, import_prompts2.default)({
|
|
10070
13113
|
name: "agent",
|
|
@@ -10093,20 +13136,19 @@ async function run(fn, args, options = {}) {
|
|
|
10093
13136
|
}
|
|
10094
13137
|
|
|
10095
13138
|
// node/themes.ts
|
|
10096
|
-
var import_semver =
|
|
13139
|
+
var import_semver = _chunkBYTWGCY3js.__toModule.call(void 0, require_semver2());
|
|
10097
13140
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
10098
13141
|
var _kolorist = require('kolorist');
|
|
10099
13142
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
10100
13143
|
|
|
10101
13144
|
// node/options.ts
|
|
10102
|
-
|
|
13145
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
13146
|
+
|
|
10103
13147
|
|
|
10104
|
-
var _utils = require('@antfu/utils');
|
|
10105
|
-
var _fs3 = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs3);
|
|
10106
13148
|
var _debug2 = require('debug'); var _debug3 = _interopRequireDefault(_debug2);
|
|
10107
13149
|
var debug = _debug3.default.call(void 0, "slidev:options");
|
|
10108
13150
|
function getClientRoot() {
|
|
10109
|
-
return _path.dirname.call(void 0,
|
|
13151
|
+
return _path.dirname.call(void 0, _chunkBYTWGCY3js.resolveImportPath.call(void 0, "@slidev/client/package.json", true));
|
|
10110
13152
|
}
|
|
10111
13153
|
function getCLIRoot() {
|
|
10112
13154
|
return _path.resolve.call(void 0, __dirname, "..");
|
|
@@ -10123,7 +13165,7 @@ function getThemeRoots(name, entry) {
|
|
|
10123
13165
|
];
|
|
10124
13166
|
} else {
|
|
10125
13167
|
return [
|
|
10126
|
-
_path.dirname.call(void 0,
|
|
13168
|
+
_path.dirname.call(void 0, _chunkBYTWGCY3js.resolveImportPath.call(void 0, `${name}/package.json`, true))
|
|
10127
13169
|
];
|
|
10128
13170
|
}
|
|
10129
13171
|
}
|
|
@@ -10137,7 +13179,7 @@ async function resolveOptions(options, mode, promptForInstallation = true) {
|
|
|
10137
13179
|
entry,
|
|
10138
13180
|
userRoot
|
|
10139
13181
|
} = getUserRoot(options);
|
|
10140
|
-
const data = await
|
|
13182
|
+
const data = await fs_exports.load(entry);
|
|
10141
13183
|
const theme = resolveThemeName(options.theme || data.config.theme);
|
|
10142
13184
|
if (promptForInstallation) {
|
|
10143
13185
|
if (await promptForThemeInstallation(theme) === false)
|
|
@@ -10156,7 +13198,7 @@ async function resolveOptions(options, mode, promptForInstallation = true) {
|
|
|
10156
13198
|
const themeMeta = await getThemeMeta(theme, _path.join.call(void 0, themeRoots[0], "package.json"));
|
|
10157
13199
|
data.themeMeta = themeMeta;
|
|
10158
13200
|
if (themeMeta)
|
|
10159
|
-
data.config =
|
|
13201
|
+
data.config = fs_exports.resolveConfig(data.headmatter, themeMeta);
|
|
10160
13202
|
}
|
|
10161
13203
|
debug({
|
|
10162
13204
|
config: data.config,
|
|
@@ -10192,7 +13234,7 @@ var officialThemes = {
|
|
|
10192
13234
|
"bricks": "@slidev/theme-bricks"
|
|
10193
13235
|
};
|
|
10194
13236
|
function packageExists(name) {
|
|
10195
|
-
if (
|
|
13237
|
+
if (_chunkBYTWGCY3js.resolveImportPath.call(void 0, `${name}/package.json`))
|
|
10196
13238
|
return true;
|
|
10197
13239
|
return false;
|
|
10198
13240
|
}
|
|
@@ -10253,4 +13295,6 @@ async function promptForThemeInstallation(name) {
|
|
|
10253
13295
|
|
|
10254
13296
|
|
|
10255
13297
|
|
|
10256
|
-
|
|
13298
|
+
|
|
13299
|
+
exports.fs_exports = fs_exports; exports.version = version; exports.packageExists = packageExists; exports.resolveThemeName = resolveThemeName; exports.getClientRoot = getClientRoot; exports.getCLIRoot = getCLIRoot; exports.isPath = isPath; exports.getThemeRoots = getThemeRoots; exports.getUserRoot = getUserRoot; exports.resolveOptions = resolveOptions;
|
|
13300
|
+
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|