@slidev/cli 0.27.20 → 0.28.3
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-QOWIXXQM.js} +28 -36
- package/dist/{build-OT76Q4KA.mjs → build-RXLELNJK.mjs} +32 -40
- package/dist/{chunk-3LH2GTGU.mjs → chunk-4OPORETI.mjs} +8 -2
- package/dist/{chunk-FN2B33RM.mjs → chunk-GWFBEY26.mjs} +23 -21
- package/dist/{chunk-VN5XPBZO.js → chunk-HF2PX43I.js} +4 -4
- package/dist/{chunk-3ND6GSCF.js → chunk-MFCJMLB5.js} +73 -71
- package/dist/{chunk-2TTM3NLX.mjs → chunk-MSSOXTVZ.mjs} +2 -2
- package/dist/{chunk-RUL3XRPS.js → chunk-QT3EQ43A.js} +9 -3
- package/dist/{chunk-JGWGLMRC.mjs → chunk-S4SUAR5N.mjs} +3241 -193
- package/dist/{chunk-XEDZVJCH.js → chunk-TJBBZIND.js} +3472 -424
- package/dist/cli.js +26 -26
- package/dist/cli.mjs +13 -13
- package/dist/{export-FUMCNU5W.js → export-KTPRCIUI.js} +5 -5
- package/dist/{export-IU4RLVW7.mjs → export-MHGYZJHW.mjs} +2 -2
- package/dist/index.d.ts +68 -4
- package/dist/index.js +9 -11
- package/dist/index.mjs +6 -8
- package/package.json +33 -32
|
@@ -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 _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
11
14
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/constants.js"(exports, module) {
|
|
12
|
-
|
|
15
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
28
31
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/debug.js"(exports, module) {
|
|
29
|
-
|
|
32
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
38
41
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/re.js"(exports, module) {
|
|
39
|
-
|
|
42
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
102
105
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
103
|
-
|
|
106
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
115
118
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
116
|
-
|
|
119
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
137
140
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/semver.js"(exports, module) {
|
|
138
|
-
|
|
141
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
362
365
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/parse.js"(exports, module) {
|
|
363
|
-
|
|
366
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
421
424
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/inc.js"(exports, module) {
|
|
422
|
-
|
|
425
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
441
444
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare.js"(exports, module) {
|
|
442
|
-
|
|
445
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
451
454
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/eq.js"(exports, module) {
|
|
452
|
-
|
|
455
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
490
493
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/major.js"(exports, module) {
|
|
491
|
-
|
|
494
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
500
503
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/minor.js"(exports, module) {
|
|
501
|
-
|
|
504
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
510
513
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/patch.js"(exports, module) {
|
|
511
|
-
|
|
514
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
533
536
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
534
|
-
|
|
537
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
543
546
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
544
|
-
|
|
547
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
553
556
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
554
|
-
|
|
557
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
567
570
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/sort.js"(exports, module) {
|
|
568
|
-
|
|
571
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
577
580
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/rsort.js"(exports, module) {
|
|
578
|
-
|
|
581
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
587
590
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/gt.js"(exports, module) {
|
|
588
|
-
|
|
591
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
597
600
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/lt.js"(exports, module) {
|
|
598
|
-
|
|
601
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
607
610
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/neq.js"(exports, module) {
|
|
608
|
-
|
|
611
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
617
620
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/gte.js"(exports, module) {
|
|
618
|
-
|
|
621
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
627
630
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/lte.js"(exports, module) {
|
|
628
|
-
|
|
631
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
637
640
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
638
|
-
|
|
641
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
683
686
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
684
|
-
|
|
687
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1376
1379
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/range.js"(exports, module) {
|
|
1377
|
-
|
|
1380
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1726
1729
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1727
|
-
|
|
1730
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1828
1831
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1829
|
-
|
|
1832
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1845
1848
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1846
|
-
|
|
1849
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1855
1858
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1856
|
-
|
|
1859
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1884
1887
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1885
|
-
|
|
1888
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1913
1916
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1914
|
-
|
|
1917
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1969
1972
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1970
|
-
|
|
1973
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
1985
1988
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1986
|
-
|
|
1989
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
2054
2057
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
2055
|
-
|
|
2058
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
2064
2067
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
2065
|
-
|
|
2068
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
2074
2077
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
2075
|
-
|
|
2078
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
2088
2091
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
2089
|
-
|
|
2092
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
2135
2138
|
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/ranges/subset.js"(exports, module) {
|
|
2136
|
-
|
|
2139
|
+
_chunkQT3EQ43Ajs.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,3220 @@ 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 = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
|
|
2277
|
+
"../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/index.js"(exports, module) {
|
|
2278
|
+
_chunkQT3EQ43Ajs.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
|
+
_chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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
|
+
var _markdownit = require('markdown-it'); var _markdownit2 = _interopRequireDefault(_markdownit);
|
|
2354
|
+
|
|
2355
|
+
// ../parser/src/core.ts
|
|
2356
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
2357
|
+
|
|
2358
|
+
// ../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs
|
|
2359
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
2360
|
+
function isNothing(subject) {
|
|
2361
|
+
return typeof subject === "undefined" || subject === null;
|
|
2362
|
+
}
|
|
2363
|
+
function isObject(subject) {
|
|
2364
|
+
return typeof subject === "object" && subject !== null;
|
|
2365
|
+
}
|
|
2366
|
+
function toArray(sequence) {
|
|
2367
|
+
if (Array.isArray(sequence))
|
|
2368
|
+
return sequence;
|
|
2369
|
+
else if (isNothing(sequence))
|
|
2370
|
+
return [];
|
|
2371
|
+
return [sequence];
|
|
2372
|
+
}
|
|
2373
|
+
function extend(target, source) {
|
|
2374
|
+
var index, length, key, sourceKeys;
|
|
2375
|
+
if (source) {
|
|
2376
|
+
sourceKeys = Object.keys(source);
|
|
2377
|
+
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
2378
|
+
key = sourceKeys[index];
|
|
2379
|
+
target[key] = source[key];
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
return target;
|
|
2383
|
+
}
|
|
2384
|
+
function repeat(string, count) {
|
|
2385
|
+
var result = "", cycle;
|
|
2386
|
+
for (cycle = 0; cycle < count; cycle += 1) {
|
|
2387
|
+
result += string;
|
|
2388
|
+
}
|
|
2389
|
+
return result;
|
|
2390
|
+
}
|
|
2391
|
+
function isNegativeZero(number) {
|
|
2392
|
+
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
2393
|
+
}
|
|
2394
|
+
var isNothing_1 = isNothing;
|
|
2395
|
+
var isObject_1 = isObject;
|
|
2396
|
+
var toArray_1 = toArray;
|
|
2397
|
+
var repeat_1 = repeat;
|
|
2398
|
+
var isNegativeZero_1 = isNegativeZero;
|
|
2399
|
+
var extend_1 = extend;
|
|
2400
|
+
var common = {
|
|
2401
|
+
isNothing: isNothing_1,
|
|
2402
|
+
isObject: isObject_1,
|
|
2403
|
+
toArray: toArray_1,
|
|
2404
|
+
repeat: repeat_1,
|
|
2405
|
+
isNegativeZero: isNegativeZero_1,
|
|
2406
|
+
extend: extend_1
|
|
2407
|
+
};
|
|
2408
|
+
function formatError(exception2, compact) {
|
|
2409
|
+
var where = "", message = exception2.reason || "(unknown reason)";
|
|
2410
|
+
if (!exception2.mark)
|
|
2411
|
+
return message;
|
|
2412
|
+
if (exception2.mark.name) {
|
|
2413
|
+
where += 'in "' + exception2.mark.name + '" ';
|
|
2414
|
+
}
|
|
2415
|
+
where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
|
|
2416
|
+
if (!compact && exception2.mark.snippet) {
|
|
2417
|
+
where += "\n\n" + exception2.mark.snippet;
|
|
2418
|
+
}
|
|
2419
|
+
return message + " " + where;
|
|
2420
|
+
}
|
|
2421
|
+
function YAMLException$1(reason, mark) {
|
|
2422
|
+
Error.call(this);
|
|
2423
|
+
this.name = "YAMLException";
|
|
2424
|
+
this.reason = reason;
|
|
2425
|
+
this.mark = mark;
|
|
2426
|
+
this.message = formatError(this, false);
|
|
2427
|
+
if (Error.captureStackTrace) {
|
|
2428
|
+
Error.captureStackTrace(this, this.constructor);
|
|
2429
|
+
} else {
|
|
2430
|
+
this.stack = new Error().stack || "";
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
YAMLException$1.prototype = Object.create(Error.prototype);
|
|
2434
|
+
YAMLException$1.prototype.constructor = YAMLException$1;
|
|
2435
|
+
YAMLException$1.prototype.toString = function toString(compact) {
|
|
2436
|
+
return this.name + ": " + formatError(this, compact);
|
|
2437
|
+
};
|
|
2438
|
+
var exception = YAMLException$1;
|
|
2439
|
+
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
2440
|
+
var head = "";
|
|
2441
|
+
var tail = "";
|
|
2442
|
+
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
2443
|
+
if (position - lineStart > maxHalfLength) {
|
|
2444
|
+
head = " ... ";
|
|
2445
|
+
lineStart = position - maxHalfLength + head.length;
|
|
2446
|
+
}
|
|
2447
|
+
if (lineEnd - position > maxHalfLength) {
|
|
2448
|
+
tail = " ...";
|
|
2449
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
2450
|
+
}
|
|
2451
|
+
return {
|
|
2452
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
|
|
2453
|
+
pos: position - lineStart + head.length
|
|
2454
|
+
};
|
|
2455
|
+
}
|
|
2456
|
+
function padStart(string, max) {
|
|
2457
|
+
return common.repeat(" ", max - string.length) + string;
|
|
2458
|
+
}
|
|
2459
|
+
function makeSnippet(mark, options) {
|
|
2460
|
+
options = Object.create(options || null);
|
|
2461
|
+
if (!mark.buffer)
|
|
2462
|
+
return null;
|
|
2463
|
+
if (!options.maxLength)
|
|
2464
|
+
options.maxLength = 79;
|
|
2465
|
+
if (typeof options.indent !== "number")
|
|
2466
|
+
options.indent = 1;
|
|
2467
|
+
if (typeof options.linesBefore !== "number")
|
|
2468
|
+
options.linesBefore = 3;
|
|
2469
|
+
if (typeof options.linesAfter !== "number")
|
|
2470
|
+
options.linesAfter = 2;
|
|
2471
|
+
var re = /\r?\n|\r|\0/g;
|
|
2472
|
+
var lineStarts = [0];
|
|
2473
|
+
var lineEnds = [];
|
|
2474
|
+
var match;
|
|
2475
|
+
var foundLineNo = -1;
|
|
2476
|
+
while (match = re.exec(mark.buffer)) {
|
|
2477
|
+
lineEnds.push(match.index);
|
|
2478
|
+
lineStarts.push(match.index + match[0].length);
|
|
2479
|
+
if (mark.position <= match.index && foundLineNo < 0) {
|
|
2480
|
+
foundLineNo = lineStarts.length - 2;
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
if (foundLineNo < 0)
|
|
2484
|
+
foundLineNo = lineStarts.length - 1;
|
|
2485
|
+
var result = "", i, line;
|
|
2486
|
+
var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
2487
|
+
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
2488
|
+
for (i = 1; i <= options.linesBefore; i++) {
|
|
2489
|
+
if (foundLineNo - i < 0)
|
|
2490
|
+
break;
|
|
2491
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
2492
|
+
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
|
2493
|
+
}
|
|
2494
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
2495
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
2496
|
+
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
2497
|
+
for (i = 1; i <= options.linesAfter; i++) {
|
|
2498
|
+
if (foundLineNo + i >= lineEnds.length)
|
|
2499
|
+
break;
|
|
2500
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
2501
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
2502
|
+
}
|
|
2503
|
+
return result.replace(/\n$/, "");
|
|
2504
|
+
}
|
|
2505
|
+
var snippet = makeSnippet;
|
|
2506
|
+
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
2507
|
+
"kind",
|
|
2508
|
+
"multi",
|
|
2509
|
+
"resolve",
|
|
2510
|
+
"construct",
|
|
2511
|
+
"instanceOf",
|
|
2512
|
+
"predicate",
|
|
2513
|
+
"represent",
|
|
2514
|
+
"representName",
|
|
2515
|
+
"defaultStyle",
|
|
2516
|
+
"styleAliases"
|
|
2517
|
+
];
|
|
2518
|
+
var YAML_NODE_KINDS = [
|
|
2519
|
+
"scalar",
|
|
2520
|
+
"sequence",
|
|
2521
|
+
"mapping"
|
|
2522
|
+
];
|
|
2523
|
+
function compileStyleAliases(map2) {
|
|
2524
|
+
var result = {};
|
|
2525
|
+
if (map2 !== null) {
|
|
2526
|
+
Object.keys(map2).forEach(function(style) {
|
|
2527
|
+
map2[style].forEach(function(alias) {
|
|
2528
|
+
result[String(alias)] = style;
|
|
2529
|
+
});
|
|
2530
|
+
});
|
|
2531
|
+
}
|
|
2532
|
+
return result;
|
|
2533
|
+
}
|
|
2534
|
+
function Type$1(tag, options) {
|
|
2535
|
+
options = options || {};
|
|
2536
|
+
Object.keys(options).forEach(function(name) {
|
|
2537
|
+
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
2538
|
+
throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
2539
|
+
}
|
|
2540
|
+
});
|
|
2541
|
+
this.options = options;
|
|
2542
|
+
this.tag = tag;
|
|
2543
|
+
this.kind = options["kind"] || null;
|
|
2544
|
+
this.resolve = options["resolve"] || function() {
|
|
2545
|
+
return true;
|
|
2546
|
+
};
|
|
2547
|
+
this.construct = options["construct"] || function(data) {
|
|
2548
|
+
return data;
|
|
2549
|
+
};
|
|
2550
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
2551
|
+
this.predicate = options["predicate"] || null;
|
|
2552
|
+
this.represent = options["represent"] || null;
|
|
2553
|
+
this.representName = options["representName"] || null;
|
|
2554
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
2555
|
+
this.multi = options["multi"] || false;
|
|
2556
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
2557
|
+
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
2558
|
+
throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
var type = Type$1;
|
|
2562
|
+
function compileList(schema2, name) {
|
|
2563
|
+
var result = [];
|
|
2564
|
+
schema2[name].forEach(function(currentType) {
|
|
2565
|
+
var newIndex = result.length;
|
|
2566
|
+
result.forEach(function(previousType, previousIndex) {
|
|
2567
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
2568
|
+
newIndex = previousIndex;
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
result[newIndex] = currentType;
|
|
2572
|
+
});
|
|
2573
|
+
return result;
|
|
2574
|
+
}
|
|
2575
|
+
function compileMap() {
|
|
2576
|
+
var result = {
|
|
2577
|
+
scalar: {},
|
|
2578
|
+
sequence: {},
|
|
2579
|
+
mapping: {},
|
|
2580
|
+
fallback: {},
|
|
2581
|
+
multi: {
|
|
2582
|
+
scalar: [],
|
|
2583
|
+
sequence: [],
|
|
2584
|
+
mapping: [],
|
|
2585
|
+
fallback: []
|
|
2586
|
+
}
|
|
2587
|
+
}, index, length;
|
|
2588
|
+
function collectType(type2) {
|
|
2589
|
+
if (type2.multi) {
|
|
2590
|
+
result.multi[type2.kind].push(type2);
|
|
2591
|
+
result.multi["fallback"].push(type2);
|
|
2592
|
+
} else {
|
|
2593
|
+
result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
2597
|
+
arguments[index].forEach(collectType);
|
|
2598
|
+
}
|
|
2599
|
+
return result;
|
|
2600
|
+
}
|
|
2601
|
+
function Schema$1(definition) {
|
|
2602
|
+
return this.extend(definition);
|
|
2603
|
+
}
|
|
2604
|
+
Schema$1.prototype.extend = function extend2(definition) {
|
|
2605
|
+
var implicit = [];
|
|
2606
|
+
var explicit = [];
|
|
2607
|
+
if (definition instanceof type) {
|
|
2608
|
+
explicit.push(definition);
|
|
2609
|
+
} else if (Array.isArray(definition)) {
|
|
2610
|
+
explicit = explicit.concat(definition);
|
|
2611
|
+
} else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
2612
|
+
if (definition.implicit)
|
|
2613
|
+
implicit = implicit.concat(definition.implicit);
|
|
2614
|
+
if (definition.explicit)
|
|
2615
|
+
explicit = explicit.concat(definition.explicit);
|
|
2616
|
+
} else {
|
|
2617
|
+
throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
2618
|
+
}
|
|
2619
|
+
implicit.forEach(function(type$1) {
|
|
2620
|
+
if (!(type$1 instanceof type)) {
|
|
2621
|
+
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
2622
|
+
}
|
|
2623
|
+
if (type$1.loadKind && type$1.loadKind !== "scalar") {
|
|
2624
|
+
throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
2625
|
+
}
|
|
2626
|
+
if (type$1.multi) {
|
|
2627
|
+
throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
2628
|
+
}
|
|
2629
|
+
});
|
|
2630
|
+
explicit.forEach(function(type$1) {
|
|
2631
|
+
if (!(type$1 instanceof type)) {
|
|
2632
|
+
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
2633
|
+
}
|
|
2634
|
+
});
|
|
2635
|
+
var result = Object.create(Schema$1.prototype);
|
|
2636
|
+
result.implicit = (this.implicit || []).concat(implicit);
|
|
2637
|
+
result.explicit = (this.explicit || []).concat(explicit);
|
|
2638
|
+
result.compiledImplicit = compileList(result, "implicit");
|
|
2639
|
+
result.compiledExplicit = compileList(result, "explicit");
|
|
2640
|
+
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
2641
|
+
return result;
|
|
2642
|
+
};
|
|
2643
|
+
var schema = Schema$1;
|
|
2644
|
+
var str = new type("tag:yaml.org,2002:str", {
|
|
2645
|
+
kind: "scalar",
|
|
2646
|
+
construct: function(data) {
|
|
2647
|
+
return data !== null ? data : "";
|
|
2648
|
+
}
|
|
2649
|
+
});
|
|
2650
|
+
var seq = new type("tag:yaml.org,2002:seq", {
|
|
2651
|
+
kind: "sequence",
|
|
2652
|
+
construct: function(data) {
|
|
2653
|
+
return data !== null ? data : [];
|
|
2654
|
+
}
|
|
2655
|
+
});
|
|
2656
|
+
var map = new type("tag:yaml.org,2002:map", {
|
|
2657
|
+
kind: "mapping",
|
|
2658
|
+
construct: function(data) {
|
|
2659
|
+
return data !== null ? data : {};
|
|
2660
|
+
}
|
|
2661
|
+
});
|
|
2662
|
+
var failsafe = new schema({
|
|
2663
|
+
explicit: [
|
|
2664
|
+
str,
|
|
2665
|
+
seq,
|
|
2666
|
+
map
|
|
2667
|
+
]
|
|
2668
|
+
});
|
|
2669
|
+
function resolveYamlNull(data) {
|
|
2670
|
+
if (data === null)
|
|
2671
|
+
return true;
|
|
2672
|
+
var max = data.length;
|
|
2673
|
+
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
2674
|
+
}
|
|
2675
|
+
function constructYamlNull() {
|
|
2676
|
+
return null;
|
|
2677
|
+
}
|
|
2678
|
+
function isNull(object) {
|
|
2679
|
+
return object === null;
|
|
2680
|
+
}
|
|
2681
|
+
var _null = new type("tag:yaml.org,2002:null", {
|
|
2682
|
+
kind: "scalar",
|
|
2683
|
+
resolve: resolveYamlNull,
|
|
2684
|
+
construct: constructYamlNull,
|
|
2685
|
+
predicate: isNull,
|
|
2686
|
+
represent: {
|
|
2687
|
+
canonical: function() {
|
|
2688
|
+
return "~";
|
|
2689
|
+
},
|
|
2690
|
+
lowercase: function() {
|
|
2691
|
+
return "null";
|
|
2692
|
+
},
|
|
2693
|
+
uppercase: function() {
|
|
2694
|
+
return "NULL";
|
|
2695
|
+
},
|
|
2696
|
+
camelcase: function() {
|
|
2697
|
+
return "Null";
|
|
2698
|
+
},
|
|
2699
|
+
empty: function() {
|
|
2700
|
+
return "";
|
|
2701
|
+
}
|
|
2702
|
+
},
|
|
2703
|
+
defaultStyle: "lowercase"
|
|
2704
|
+
});
|
|
2705
|
+
function resolveYamlBoolean(data) {
|
|
2706
|
+
if (data === null)
|
|
2707
|
+
return false;
|
|
2708
|
+
var max = data.length;
|
|
2709
|
+
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
2710
|
+
}
|
|
2711
|
+
function constructYamlBoolean(data) {
|
|
2712
|
+
return data === "true" || data === "True" || data === "TRUE";
|
|
2713
|
+
}
|
|
2714
|
+
function isBoolean(object) {
|
|
2715
|
+
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
2716
|
+
}
|
|
2717
|
+
var bool = new type("tag:yaml.org,2002:bool", {
|
|
2718
|
+
kind: "scalar",
|
|
2719
|
+
resolve: resolveYamlBoolean,
|
|
2720
|
+
construct: constructYamlBoolean,
|
|
2721
|
+
predicate: isBoolean,
|
|
2722
|
+
represent: {
|
|
2723
|
+
lowercase: function(object) {
|
|
2724
|
+
return object ? "true" : "false";
|
|
2725
|
+
},
|
|
2726
|
+
uppercase: function(object) {
|
|
2727
|
+
return object ? "TRUE" : "FALSE";
|
|
2728
|
+
},
|
|
2729
|
+
camelcase: function(object) {
|
|
2730
|
+
return object ? "True" : "False";
|
|
2731
|
+
}
|
|
2732
|
+
},
|
|
2733
|
+
defaultStyle: "lowercase"
|
|
2734
|
+
});
|
|
2735
|
+
function isHexCode(c) {
|
|
2736
|
+
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
2737
|
+
}
|
|
2738
|
+
function isOctCode(c) {
|
|
2739
|
+
return 48 <= c && c <= 55;
|
|
2740
|
+
}
|
|
2741
|
+
function isDecCode(c) {
|
|
2742
|
+
return 48 <= c && c <= 57;
|
|
2743
|
+
}
|
|
2744
|
+
function resolveYamlInteger(data) {
|
|
2745
|
+
if (data === null)
|
|
2746
|
+
return false;
|
|
2747
|
+
var max = data.length, index = 0, hasDigits = false, ch;
|
|
2748
|
+
if (!max)
|
|
2749
|
+
return false;
|
|
2750
|
+
ch = data[index];
|
|
2751
|
+
if (ch === "-" || ch === "+") {
|
|
2752
|
+
ch = data[++index];
|
|
2753
|
+
}
|
|
2754
|
+
if (ch === "0") {
|
|
2755
|
+
if (index + 1 === max)
|
|
2756
|
+
return true;
|
|
2757
|
+
ch = data[++index];
|
|
2758
|
+
if (ch === "b") {
|
|
2759
|
+
index++;
|
|
2760
|
+
for (; index < max; index++) {
|
|
2761
|
+
ch = data[index];
|
|
2762
|
+
if (ch === "_")
|
|
2763
|
+
continue;
|
|
2764
|
+
if (ch !== "0" && ch !== "1")
|
|
2765
|
+
return false;
|
|
2766
|
+
hasDigits = true;
|
|
2767
|
+
}
|
|
2768
|
+
return hasDigits && ch !== "_";
|
|
2769
|
+
}
|
|
2770
|
+
if (ch === "x") {
|
|
2771
|
+
index++;
|
|
2772
|
+
for (; index < max; index++) {
|
|
2773
|
+
ch = data[index];
|
|
2774
|
+
if (ch === "_")
|
|
2775
|
+
continue;
|
|
2776
|
+
if (!isHexCode(data.charCodeAt(index)))
|
|
2777
|
+
return false;
|
|
2778
|
+
hasDigits = true;
|
|
2779
|
+
}
|
|
2780
|
+
return hasDigits && ch !== "_";
|
|
2781
|
+
}
|
|
2782
|
+
if (ch === "o") {
|
|
2783
|
+
index++;
|
|
2784
|
+
for (; index < max; index++) {
|
|
2785
|
+
ch = data[index];
|
|
2786
|
+
if (ch === "_")
|
|
2787
|
+
continue;
|
|
2788
|
+
if (!isOctCode(data.charCodeAt(index)))
|
|
2789
|
+
return false;
|
|
2790
|
+
hasDigits = true;
|
|
2791
|
+
}
|
|
2792
|
+
return hasDigits && ch !== "_";
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
if (ch === "_")
|
|
2796
|
+
return false;
|
|
2797
|
+
for (; index < max; index++) {
|
|
2798
|
+
ch = data[index];
|
|
2799
|
+
if (ch === "_")
|
|
2800
|
+
continue;
|
|
2801
|
+
if (!isDecCode(data.charCodeAt(index))) {
|
|
2802
|
+
return false;
|
|
2803
|
+
}
|
|
2804
|
+
hasDigits = true;
|
|
2805
|
+
}
|
|
2806
|
+
if (!hasDigits || ch === "_")
|
|
2807
|
+
return false;
|
|
2808
|
+
return true;
|
|
2809
|
+
}
|
|
2810
|
+
function constructYamlInteger(data) {
|
|
2811
|
+
var value = data, sign = 1, ch;
|
|
2812
|
+
if (value.indexOf("_") !== -1) {
|
|
2813
|
+
value = value.replace(/_/g, "");
|
|
2814
|
+
}
|
|
2815
|
+
ch = value[0];
|
|
2816
|
+
if (ch === "-" || ch === "+") {
|
|
2817
|
+
if (ch === "-")
|
|
2818
|
+
sign = -1;
|
|
2819
|
+
value = value.slice(1);
|
|
2820
|
+
ch = value[0];
|
|
2821
|
+
}
|
|
2822
|
+
if (value === "0")
|
|
2823
|
+
return 0;
|
|
2824
|
+
if (ch === "0") {
|
|
2825
|
+
if (value[1] === "b")
|
|
2826
|
+
return sign * parseInt(value.slice(2), 2);
|
|
2827
|
+
if (value[1] === "x")
|
|
2828
|
+
return sign * parseInt(value.slice(2), 16);
|
|
2829
|
+
if (value[1] === "o")
|
|
2830
|
+
return sign * parseInt(value.slice(2), 8);
|
|
2831
|
+
}
|
|
2832
|
+
return sign * parseInt(value, 10);
|
|
2833
|
+
}
|
|
2834
|
+
function isInteger(object) {
|
|
2835
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
|
2836
|
+
}
|
|
2837
|
+
var int = new type("tag:yaml.org,2002:int", {
|
|
2838
|
+
kind: "scalar",
|
|
2839
|
+
resolve: resolveYamlInteger,
|
|
2840
|
+
construct: constructYamlInteger,
|
|
2841
|
+
predicate: isInteger,
|
|
2842
|
+
represent: {
|
|
2843
|
+
binary: function(obj) {
|
|
2844
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
2845
|
+
},
|
|
2846
|
+
octal: function(obj) {
|
|
2847
|
+
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
2848
|
+
},
|
|
2849
|
+
decimal: function(obj) {
|
|
2850
|
+
return obj.toString(10);
|
|
2851
|
+
},
|
|
2852
|
+
hexadecimal: function(obj) {
|
|
2853
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
2854
|
+
}
|
|
2855
|
+
},
|
|
2856
|
+
defaultStyle: "decimal",
|
|
2857
|
+
styleAliases: {
|
|
2858
|
+
binary: [2, "bin"],
|
|
2859
|
+
octal: [8, "oct"],
|
|
2860
|
+
decimal: [10, "dec"],
|
|
2861
|
+
hexadecimal: [16, "hex"]
|
|
2862
|
+
}
|
|
2863
|
+
});
|
|
2864
|
+
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))$");
|
|
2865
|
+
function resolveYamlFloat(data) {
|
|
2866
|
+
if (data === null)
|
|
2867
|
+
return false;
|
|
2868
|
+
if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") {
|
|
2869
|
+
return false;
|
|
2870
|
+
}
|
|
2871
|
+
return true;
|
|
2872
|
+
}
|
|
2873
|
+
function constructYamlFloat(data) {
|
|
2874
|
+
var value, sign;
|
|
2875
|
+
value = data.replace(/_/g, "").toLowerCase();
|
|
2876
|
+
sign = value[0] === "-" ? -1 : 1;
|
|
2877
|
+
if ("+-".indexOf(value[0]) >= 0) {
|
|
2878
|
+
value = value.slice(1);
|
|
2879
|
+
}
|
|
2880
|
+
if (value === ".inf") {
|
|
2881
|
+
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
2882
|
+
} else if (value === ".nan") {
|
|
2883
|
+
return NaN;
|
|
2884
|
+
}
|
|
2885
|
+
return sign * parseFloat(value, 10);
|
|
2886
|
+
}
|
|
2887
|
+
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
2888
|
+
function representYamlFloat(object, style) {
|
|
2889
|
+
var res;
|
|
2890
|
+
if (isNaN(object)) {
|
|
2891
|
+
switch (style) {
|
|
2892
|
+
case "lowercase":
|
|
2893
|
+
return ".nan";
|
|
2894
|
+
case "uppercase":
|
|
2895
|
+
return ".NAN";
|
|
2896
|
+
case "camelcase":
|
|
2897
|
+
return ".NaN";
|
|
2898
|
+
}
|
|
2899
|
+
} else if (Number.POSITIVE_INFINITY === object) {
|
|
2900
|
+
switch (style) {
|
|
2901
|
+
case "lowercase":
|
|
2902
|
+
return ".inf";
|
|
2903
|
+
case "uppercase":
|
|
2904
|
+
return ".INF";
|
|
2905
|
+
case "camelcase":
|
|
2906
|
+
return ".Inf";
|
|
2907
|
+
}
|
|
2908
|
+
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
2909
|
+
switch (style) {
|
|
2910
|
+
case "lowercase":
|
|
2911
|
+
return "-.inf";
|
|
2912
|
+
case "uppercase":
|
|
2913
|
+
return "-.INF";
|
|
2914
|
+
case "camelcase":
|
|
2915
|
+
return "-.Inf";
|
|
2916
|
+
}
|
|
2917
|
+
} else if (common.isNegativeZero(object)) {
|
|
2918
|
+
return "-0.0";
|
|
2919
|
+
}
|
|
2920
|
+
res = object.toString(10);
|
|
2921
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
2922
|
+
}
|
|
2923
|
+
function isFloat(object) {
|
|
2924
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
2925
|
+
}
|
|
2926
|
+
var float = new type("tag:yaml.org,2002:float", {
|
|
2927
|
+
kind: "scalar",
|
|
2928
|
+
resolve: resolveYamlFloat,
|
|
2929
|
+
construct: constructYamlFloat,
|
|
2930
|
+
predicate: isFloat,
|
|
2931
|
+
represent: representYamlFloat,
|
|
2932
|
+
defaultStyle: "lowercase"
|
|
2933
|
+
});
|
|
2934
|
+
var json = failsafe.extend({
|
|
2935
|
+
implicit: [
|
|
2936
|
+
_null,
|
|
2937
|
+
bool,
|
|
2938
|
+
int,
|
|
2939
|
+
float
|
|
2940
|
+
]
|
|
2941
|
+
});
|
|
2942
|
+
var core = json;
|
|
2943
|
+
var YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
2944
|
+
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]))?))?$");
|
|
2945
|
+
function resolveYamlTimestamp(data) {
|
|
2946
|
+
if (data === null)
|
|
2947
|
+
return false;
|
|
2948
|
+
if (YAML_DATE_REGEXP.exec(data) !== null)
|
|
2949
|
+
return true;
|
|
2950
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
|
|
2951
|
+
return true;
|
|
2952
|
+
return false;
|
|
2953
|
+
}
|
|
2954
|
+
function constructYamlTimestamp(data) {
|
|
2955
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
2956
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
2957
|
+
if (match === null)
|
|
2958
|
+
match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
2959
|
+
if (match === null)
|
|
2960
|
+
throw new Error("Date resolve error");
|
|
2961
|
+
year = +match[1];
|
|
2962
|
+
month = +match[2] - 1;
|
|
2963
|
+
day = +match[3];
|
|
2964
|
+
if (!match[4]) {
|
|
2965
|
+
return new Date(Date.UTC(year, month, day));
|
|
2966
|
+
}
|
|
2967
|
+
hour = +match[4];
|
|
2968
|
+
minute = +match[5];
|
|
2969
|
+
second = +match[6];
|
|
2970
|
+
if (match[7]) {
|
|
2971
|
+
fraction = match[7].slice(0, 3);
|
|
2972
|
+
while (fraction.length < 3) {
|
|
2973
|
+
fraction += "0";
|
|
2974
|
+
}
|
|
2975
|
+
fraction = +fraction;
|
|
2976
|
+
}
|
|
2977
|
+
if (match[9]) {
|
|
2978
|
+
tz_hour = +match[10];
|
|
2979
|
+
tz_minute = +(match[11] || 0);
|
|
2980
|
+
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
2981
|
+
if (match[9] === "-")
|
|
2982
|
+
delta = -delta;
|
|
2983
|
+
}
|
|
2984
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
2985
|
+
if (delta)
|
|
2986
|
+
date.setTime(date.getTime() - delta);
|
|
2987
|
+
return date;
|
|
2988
|
+
}
|
|
2989
|
+
function representYamlTimestamp(object) {
|
|
2990
|
+
return object.toISOString();
|
|
2991
|
+
}
|
|
2992
|
+
var timestamp = new type("tag:yaml.org,2002:timestamp", {
|
|
2993
|
+
kind: "scalar",
|
|
2994
|
+
resolve: resolveYamlTimestamp,
|
|
2995
|
+
construct: constructYamlTimestamp,
|
|
2996
|
+
instanceOf: Date,
|
|
2997
|
+
represent: representYamlTimestamp
|
|
2998
|
+
});
|
|
2999
|
+
function resolveYamlMerge(data) {
|
|
3000
|
+
return data === "<<" || data === null;
|
|
3001
|
+
}
|
|
3002
|
+
var merge = new type("tag:yaml.org,2002:merge", {
|
|
3003
|
+
kind: "scalar",
|
|
3004
|
+
resolve: resolveYamlMerge
|
|
3005
|
+
});
|
|
3006
|
+
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
3007
|
+
function resolveYamlBinary(data) {
|
|
3008
|
+
if (data === null)
|
|
3009
|
+
return false;
|
|
3010
|
+
var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
|
|
3011
|
+
for (idx = 0; idx < max; idx++) {
|
|
3012
|
+
code = map2.indexOf(data.charAt(idx));
|
|
3013
|
+
if (code > 64)
|
|
3014
|
+
continue;
|
|
3015
|
+
if (code < 0)
|
|
3016
|
+
return false;
|
|
3017
|
+
bitlen += 6;
|
|
3018
|
+
}
|
|
3019
|
+
return bitlen % 8 === 0;
|
|
3020
|
+
}
|
|
3021
|
+
function constructYamlBinary(data) {
|
|
3022
|
+
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
|
|
3023
|
+
for (idx = 0; idx < max; idx++) {
|
|
3024
|
+
if (idx % 4 === 0 && idx) {
|
|
3025
|
+
result.push(bits >> 16 & 255);
|
|
3026
|
+
result.push(bits >> 8 & 255);
|
|
3027
|
+
result.push(bits & 255);
|
|
3028
|
+
}
|
|
3029
|
+
bits = bits << 6 | map2.indexOf(input.charAt(idx));
|
|
3030
|
+
}
|
|
3031
|
+
tailbits = max % 4 * 6;
|
|
3032
|
+
if (tailbits === 0) {
|
|
3033
|
+
result.push(bits >> 16 & 255);
|
|
3034
|
+
result.push(bits >> 8 & 255);
|
|
3035
|
+
result.push(bits & 255);
|
|
3036
|
+
} else if (tailbits === 18) {
|
|
3037
|
+
result.push(bits >> 10 & 255);
|
|
3038
|
+
result.push(bits >> 2 & 255);
|
|
3039
|
+
} else if (tailbits === 12) {
|
|
3040
|
+
result.push(bits >> 4 & 255);
|
|
3041
|
+
}
|
|
3042
|
+
return new Uint8Array(result);
|
|
3043
|
+
}
|
|
3044
|
+
function representYamlBinary(object) {
|
|
3045
|
+
var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
|
|
3046
|
+
for (idx = 0; idx < max; idx++) {
|
|
3047
|
+
if (idx % 3 === 0 && idx) {
|
|
3048
|
+
result += map2[bits >> 18 & 63];
|
|
3049
|
+
result += map2[bits >> 12 & 63];
|
|
3050
|
+
result += map2[bits >> 6 & 63];
|
|
3051
|
+
result += map2[bits & 63];
|
|
3052
|
+
}
|
|
3053
|
+
bits = (bits << 8) + object[idx];
|
|
3054
|
+
}
|
|
3055
|
+
tail = max % 3;
|
|
3056
|
+
if (tail === 0) {
|
|
3057
|
+
result += map2[bits >> 18 & 63];
|
|
3058
|
+
result += map2[bits >> 12 & 63];
|
|
3059
|
+
result += map2[bits >> 6 & 63];
|
|
3060
|
+
result += map2[bits & 63];
|
|
3061
|
+
} else if (tail === 2) {
|
|
3062
|
+
result += map2[bits >> 10 & 63];
|
|
3063
|
+
result += map2[bits >> 4 & 63];
|
|
3064
|
+
result += map2[bits << 2 & 63];
|
|
3065
|
+
result += map2[64];
|
|
3066
|
+
} else if (tail === 1) {
|
|
3067
|
+
result += map2[bits >> 2 & 63];
|
|
3068
|
+
result += map2[bits << 4 & 63];
|
|
3069
|
+
result += map2[64];
|
|
3070
|
+
result += map2[64];
|
|
3071
|
+
}
|
|
3072
|
+
return result;
|
|
3073
|
+
}
|
|
3074
|
+
function isBinary(obj) {
|
|
3075
|
+
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
|
3076
|
+
}
|
|
3077
|
+
var binary = new type("tag:yaml.org,2002:binary", {
|
|
3078
|
+
kind: "scalar",
|
|
3079
|
+
resolve: resolveYamlBinary,
|
|
3080
|
+
construct: constructYamlBinary,
|
|
3081
|
+
predicate: isBinary,
|
|
3082
|
+
represent: representYamlBinary
|
|
3083
|
+
});
|
|
3084
|
+
var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
3085
|
+
var _toString$2 = Object.prototype.toString;
|
|
3086
|
+
function resolveYamlOmap(data) {
|
|
3087
|
+
if (data === null)
|
|
3088
|
+
return true;
|
|
3089
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
3090
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3091
|
+
pair = object[index];
|
|
3092
|
+
pairHasKey = false;
|
|
3093
|
+
if (_toString$2.call(pair) !== "[object Object]")
|
|
3094
|
+
return false;
|
|
3095
|
+
for (pairKey in pair) {
|
|
3096
|
+
if (_hasOwnProperty$3.call(pair, pairKey)) {
|
|
3097
|
+
if (!pairHasKey)
|
|
3098
|
+
pairHasKey = true;
|
|
3099
|
+
else
|
|
3100
|
+
return false;
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
if (!pairHasKey)
|
|
3104
|
+
return false;
|
|
3105
|
+
if (objectKeys.indexOf(pairKey) === -1)
|
|
3106
|
+
objectKeys.push(pairKey);
|
|
3107
|
+
else
|
|
3108
|
+
return false;
|
|
3109
|
+
}
|
|
3110
|
+
return true;
|
|
3111
|
+
}
|
|
3112
|
+
function constructYamlOmap(data) {
|
|
3113
|
+
return data !== null ? data : [];
|
|
3114
|
+
}
|
|
3115
|
+
var omap = new type("tag:yaml.org,2002:omap", {
|
|
3116
|
+
kind: "sequence",
|
|
3117
|
+
resolve: resolveYamlOmap,
|
|
3118
|
+
construct: constructYamlOmap
|
|
3119
|
+
});
|
|
3120
|
+
var _toString$1 = Object.prototype.toString;
|
|
3121
|
+
function resolveYamlPairs(data) {
|
|
3122
|
+
if (data === null)
|
|
3123
|
+
return true;
|
|
3124
|
+
var index, length, pair, keys, result, object = data;
|
|
3125
|
+
result = new Array(object.length);
|
|
3126
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3127
|
+
pair = object[index];
|
|
3128
|
+
if (_toString$1.call(pair) !== "[object Object]")
|
|
3129
|
+
return false;
|
|
3130
|
+
keys = Object.keys(pair);
|
|
3131
|
+
if (keys.length !== 1)
|
|
3132
|
+
return false;
|
|
3133
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
3134
|
+
}
|
|
3135
|
+
return true;
|
|
3136
|
+
}
|
|
3137
|
+
function constructYamlPairs(data) {
|
|
3138
|
+
if (data === null)
|
|
3139
|
+
return [];
|
|
3140
|
+
var index, length, pair, keys, result, object = data;
|
|
3141
|
+
result = new Array(object.length);
|
|
3142
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3143
|
+
pair = object[index];
|
|
3144
|
+
keys = Object.keys(pair);
|
|
3145
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
3146
|
+
}
|
|
3147
|
+
return result;
|
|
3148
|
+
}
|
|
3149
|
+
var pairs = new type("tag:yaml.org,2002:pairs", {
|
|
3150
|
+
kind: "sequence",
|
|
3151
|
+
resolve: resolveYamlPairs,
|
|
3152
|
+
construct: constructYamlPairs
|
|
3153
|
+
});
|
|
3154
|
+
var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
3155
|
+
function resolveYamlSet(data) {
|
|
3156
|
+
if (data === null)
|
|
3157
|
+
return true;
|
|
3158
|
+
var key, object = data;
|
|
3159
|
+
for (key in object) {
|
|
3160
|
+
if (_hasOwnProperty$2.call(object, key)) {
|
|
3161
|
+
if (object[key] !== null)
|
|
3162
|
+
return false;
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
return true;
|
|
3166
|
+
}
|
|
3167
|
+
function constructYamlSet(data) {
|
|
3168
|
+
return data !== null ? data : {};
|
|
3169
|
+
}
|
|
3170
|
+
var set = new type("tag:yaml.org,2002:set", {
|
|
3171
|
+
kind: "mapping",
|
|
3172
|
+
resolve: resolveYamlSet,
|
|
3173
|
+
construct: constructYamlSet
|
|
3174
|
+
});
|
|
3175
|
+
var _default = core.extend({
|
|
3176
|
+
implicit: [
|
|
3177
|
+
timestamp,
|
|
3178
|
+
merge
|
|
3179
|
+
],
|
|
3180
|
+
explicit: [
|
|
3181
|
+
binary,
|
|
3182
|
+
omap,
|
|
3183
|
+
pairs,
|
|
3184
|
+
set
|
|
3185
|
+
]
|
|
3186
|
+
});
|
|
3187
|
+
var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
3188
|
+
var CONTEXT_FLOW_IN = 1;
|
|
3189
|
+
var CONTEXT_FLOW_OUT = 2;
|
|
3190
|
+
var CONTEXT_BLOCK_IN = 3;
|
|
3191
|
+
var CONTEXT_BLOCK_OUT = 4;
|
|
3192
|
+
var CHOMPING_CLIP = 1;
|
|
3193
|
+
var CHOMPING_STRIP = 2;
|
|
3194
|
+
var CHOMPING_KEEP = 3;
|
|
3195
|
+
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
3196
|
+
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
3197
|
+
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
3198
|
+
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
3199
|
+
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
3200
|
+
function _class(obj) {
|
|
3201
|
+
return Object.prototype.toString.call(obj);
|
|
3202
|
+
}
|
|
3203
|
+
function is_EOL(c) {
|
|
3204
|
+
return c === 10 || c === 13;
|
|
3205
|
+
}
|
|
3206
|
+
function is_WHITE_SPACE(c) {
|
|
3207
|
+
return c === 9 || c === 32;
|
|
3208
|
+
}
|
|
3209
|
+
function is_WS_OR_EOL(c) {
|
|
3210
|
+
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
3211
|
+
}
|
|
3212
|
+
function is_FLOW_INDICATOR(c) {
|
|
3213
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
3214
|
+
}
|
|
3215
|
+
function fromHexCode(c) {
|
|
3216
|
+
var lc;
|
|
3217
|
+
if (48 <= c && c <= 57) {
|
|
3218
|
+
return c - 48;
|
|
3219
|
+
}
|
|
3220
|
+
lc = c | 32;
|
|
3221
|
+
if (97 <= lc && lc <= 102) {
|
|
3222
|
+
return lc - 97 + 10;
|
|
3223
|
+
}
|
|
3224
|
+
return -1;
|
|
3225
|
+
}
|
|
3226
|
+
function escapedHexLen(c) {
|
|
3227
|
+
if (c === 120) {
|
|
3228
|
+
return 2;
|
|
3229
|
+
}
|
|
3230
|
+
if (c === 117) {
|
|
3231
|
+
return 4;
|
|
3232
|
+
}
|
|
3233
|
+
if (c === 85) {
|
|
3234
|
+
return 8;
|
|
3235
|
+
}
|
|
3236
|
+
return 0;
|
|
3237
|
+
}
|
|
3238
|
+
function fromDecimalCode(c) {
|
|
3239
|
+
if (48 <= c && c <= 57) {
|
|
3240
|
+
return c - 48;
|
|
3241
|
+
}
|
|
3242
|
+
return -1;
|
|
3243
|
+
}
|
|
3244
|
+
function simpleEscapeSequence(c) {
|
|
3245
|
+
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" : "";
|
|
3246
|
+
}
|
|
3247
|
+
function charFromCodepoint(c) {
|
|
3248
|
+
if (c <= 65535) {
|
|
3249
|
+
return String.fromCharCode(c);
|
|
3250
|
+
}
|
|
3251
|
+
return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
|
|
3252
|
+
}
|
|
3253
|
+
var simpleEscapeCheck = new Array(256);
|
|
3254
|
+
var simpleEscapeMap = new Array(256);
|
|
3255
|
+
for (i = 0; i < 256; i++) {
|
|
3256
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
3257
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
3258
|
+
}
|
|
3259
|
+
var i;
|
|
3260
|
+
function State$1(input, options) {
|
|
3261
|
+
this.input = input;
|
|
3262
|
+
this.filename = options["filename"] || null;
|
|
3263
|
+
this.schema = options["schema"] || _default;
|
|
3264
|
+
this.onWarning = options["onWarning"] || null;
|
|
3265
|
+
this.legacy = options["legacy"] || false;
|
|
3266
|
+
this.json = options["json"] || false;
|
|
3267
|
+
this.listener = options["listener"] || null;
|
|
3268
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
3269
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
3270
|
+
this.length = input.length;
|
|
3271
|
+
this.position = 0;
|
|
3272
|
+
this.line = 0;
|
|
3273
|
+
this.lineStart = 0;
|
|
3274
|
+
this.lineIndent = 0;
|
|
3275
|
+
this.firstTabInLine = -1;
|
|
3276
|
+
this.documents = [];
|
|
3277
|
+
}
|
|
3278
|
+
function generateError(state, message) {
|
|
3279
|
+
var mark = {
|
|
3280
|
+
name: state.filename,
|
|
3281
|
+
buffer: state.input.slice(0, -1),
|
|
3282
|
+
position: state.position,
|
|
3283
|
+
line: state.line,
|
|
3284
|
+
column: state.position - state.lineStart
|
|
3285
|
+
};
|
|
3286
|
+
mark.snippet = snippet(mark);
|
|
3287
|
+
return new exception(message, mark);
|
|
3288
|
+
}
|
|
3289
|
+
function throwError(state, message) {
|
|
3290
|
+
throw generateError(state, message);
|
|
3291
|
+
}
|
|
3292
|
+
function throwWarning(state, message) {
|
|
3293
|
+
if (state.onWarning) {
|
|
3294
|
+
state.onWarning.call(null, generateError(state, message));
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
var directiveHandlers = {
|
|
3298
|
+
YAML: function handleYamlDirective(state, name, args) {
|
|
3299
|
+
var match, major, minor;
|
|
3300
|
+
if (state.version !== null) {
|
|
3301
|
+
throwError(state, "duplication of %YAML directive");
|
|
3302
|
+
}
|
|
3303
|
+
if (args.length !== 1) {
|
|
3304
|
+
throwError(state, "YAML directive accepts exactly one argument");
|
|
3305
|
+
}
|
|
3306
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
3307
|
+
if (match === null) {
|
|
3308
|
+
throwError(state, "ill-formed argument of the YAML directive");
|
|
3309
|
+
}
|
|
3310
|
+
major = parseInt(match[1], 10);
|
|
3311
|
+
minor = parseInt(match[2], 10);
|
|
3312
|
+
if (major !== 1) {
|
|
3313
|
+
throwError(state, "unacceptable YAML version of the document");
|
|
3314
|
+
}
|
|
3315
|
+
state.version = args[0];
|
|
3316
|
+
state.checkLineBreaks = minor < 2;
|
|
3317
|
+
if (minor !== 1 && minor !== 2) {
|
|
3318
|
+
throwWarning(state, "unsupported YAML version of the document");
|
|
3319
|
+
}
|
|
3320
|
+
},
|
|
3321
|
+
TAG: function handleTagDirective(state, name, args) {
|
|
3322
|
+
var handle, prefix;
|
|
3323
|
+
if (args.length !== 2) {
|
|
3324
|
+
throwError(state, "TAG directive accepts exactly two arguments");
|
|
3325
|
+
}
|
|
3326
|
+
handle = args[0];
|
|
3327
|
+
prefix = args[1];
|
|
3328
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
3329
|
+
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
3330
|
+
}
|
|
3331
|
+
if (_hasOwnProperty$1.call(state.tagMap, handle)) {
|
|
3332
|
+
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
3333
|
+
}
|
|
3334
|
+
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
3335
|
+
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
3336
|
+
}
|
|
3337
|
+
try {
|
|
3338
|
+
prefix = decodeURIComponent(prefix);
|
|
3339
|
+
} catch (err) {
|
|
3340
|
+
throwError(state, "tag prefix is malformed: " + prefix);
|
|
3341
|
+
}
|
|
3342
|
+
state.tagMap[handle] = prefix;
|
|
3343
|
+
}
|
|
3344
|
+
};
|
|
3345
|
+
function captureSegment(state, start, end, checkJson) {
|
|
3346
|
+
var _position, _length, _character, _result;
|
|
3347
|
+
if (start < end) {
|
|
3348
|
+
_result = state.input.slice(start, end);
|
|
3349
|
+
if (checkJson) {
|
|
3350
|
+
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
3351
|
+
_character = _result.charCodeAt(_position);
|
|
3352
|
+
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
3353
|
+
throwError(state, "expected valid JSON character");
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
3357
|
+
throwError(state, "the stream contains non-printable characters");
|
|
3358
|
+
}
|
|
3359
|
+
state.result += _result;
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
function mergeMappings(state, destination, source, overridableKeys) {
|
|
3363
|
+
var sourceKeys, key, index, quantity;
|
|
3364
|
+
if (!common.isObject(source)) {
|
|
3365
|
+
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
3366
|
+
}
|
|
3367
|
+
sourceKeys = Object.keys(source);
|
|
3368
|
+
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
3369
|
+
key = sourceKeys[index];
|
|
3370
|
+
if (!_hasOwnProperty$1.call(destination, key)) {
|
|
3371
|
+
destination[key] = source[key];
|
|
3372
|
+
overridableKeys[key] = true;
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
3377
|
+
var index, quantity;
|
|
3378
|
+
if (Array.isArray(keyNode)) {
|
|
3379
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
3380
|
+
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
3381
|
+
if (Array.isArray(keyNode[index])) {
|
|
3382
|
+
throwError(state, "nested arrays are not supported inside keys");
|
|
3383
|
+
}
|
|
3384
|
+
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
3385
|
+
keyNode[index] = "[object Object]";
|
|
3386
|
+
}
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3389
|
+
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
3390
|
+
keyNode = "[object Object]";
|
|
3391
|
+
}
|
|
3392
|
+
keyNode = String(keyNode);
|
|
3393
|
+
if (_result === null) {
|
|
3394
|
+
_result = {};
|
|
3395
|
+
}
|
|
3396
|
+
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
3397
|
+
if (Array.isArray(valueNode)) {
|
|
3398
|
+
for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
3399
|
+
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
3400
|
+
}
|
|
3401
|
+
} else {
|
|
3402
|
+
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
3403
|
+
}
|
|
3404
|
+
} else {
|
|
3405
|
+
if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
|
|
3406
|
+
state.line = startLine || state.line;
|
|
3407
|
+
state.lineStart = startLineStart || state.lineStart;
|
|
3408
|
+
state.position = startPos || state.position;
|
|
3409
|
+
throwError(state, "duplicated mapping key");
|
|
3410
|
+
}
|
|
3411
|
+
if (keyNode === "__proto__") {
|
|
3412
|
+
Object.defineProperty(_result, keyNode, {
|
|
3413
|
+
configurable: true,
|
|
3414
|
+
enumerable: true,
|
|
3415
|
+
writable: true,
|
|
3416
|
+
value: valueNode
|
|
3417
|
+
});
|
|
3418
|
+
} else {
|
|
3419
|
+
_result[keyNode] = valueNode;
|
|
3420
|
+
}
|
|
3421
|
+
delete overridableKeys[keyNode];
|
|
3422
|
+
}
|
|
3423
|
+
return _result;
|
|
3424
|
+
}
|
|
3425
|
+
function readLineBreak(state) {
|
|
3426
|
+
var ch;
|
|
3427
|
+
ch = state.input.charCodeAt(state.position);
|
|
3428
|
+
if (ch === 10) {
|
|
3429
|
+
state.position++;
|
|
3430
|
+
} else if (ch === 13) {
|
|
3431
|
+
state.position++;
|
|
3432
|
+
if (state.input.charCodeAt(state.position) === 10) {
|
|
3433
|
+
state.position++;
|
|
3434
|
+
}
|
|
3435
|
+
} else {
|
|
3436
|
+
throwError(state, "a line break is expected");
|
|
3437
|
+
}
|
|
3438
|
+
state.line += 1;
|
|
3439
|
+
state.lineStart = state.position;
|
|
3440
|
+
state.firstTabInLine = -1;
|
|
3441
|
+
}
|
|
3442
|
+
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
3443
|
+
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
3444
|
+
while (ch !== 0) {
|
|
3445
|
+
while (is_WHITE_SPACE(ch)) {
|
|
3446
|
+
if (ch === 9 && state.firstTabInLine === -1) {
|
|
3447
|
+
state.firstTabInLine = state.position;
|
|
3448
|
+
}
|
|
3449
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3450
|
+
}
|
|
3451
|
+
if (allowComments && ch === 35) {
|
|
3452
|
+
do {
|
|
3453
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3454
|
+
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
3455
|
+
}
|
|
3456
|
+
if (is_EOL(ch)) {
|
|
3457
|
+
readLineBreak(state);
|
|
3458
|
+
ch = state.input.charCodeAt(state.position);
|
|
3459
|
+
lineBreaks++;
|
|
3460
|
+
state.lineIndent = 0;
|
|
3461
|
+
while (ch === 32) {
|
|
3462
|
+
state.lineIndent++;
|
|
3463
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3464
|
+
}
|
|
3465
|
+
} else {
|
|
3466
|
+
break;
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
3470
|
+
throwWarning(state, "deficient indentation");
|
|
3471
|
+
}
|
|
3472
|
+
return lineBreaks;
|
|
3473
|
+
}
|
|
3474
|
+
function testDocumentSeparator(state) {
|
|
3475
|
+
var _position = state.position, ch;
|
|
3476
|
+
ch = state.input.charCodeAt(_position);
|
|
3477
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
3478
|
+
_position += 3;
|
|
3479
|
+
ch = state.input.charCodeAt(_position);
|
|
3480
|
+
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
3481
|
+
return true;
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
return false;
|
|
3485
|
+
}
|
|
3486
|
+
function writeFoldedLines(state, count) {
|
|
3487
|
+
if (count === 1) {
|
|
3488
|
+
state.result += " ";
|
|
3489
|
+
} else if (count > 1) {
|
|
3490
|
+
state.result += common.repeat("\n", count - 1);
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3493
|
+
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
3494
|
+
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
3495
|
+
ch = state.input.charCodeAt(state.position);
|
|
3496
|
+
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) {
|
|
3497
|
+
return false;
|
|
3498
|
+
}
|
|
3499
|
+
if (ch === 63 || ch === 45) {
|
|
3500
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3501
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
3502
|
+
return false;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
state.kind = "scalar";
|
|
3506
|
+
state.result = "";
|
|
3507
|
+
captureStart = captureEnd = state.position;
|
|
3508
|
+
hasPendingContent = false;
|
|
3509
|
+
while (ch !== 0) {
|
|
3510
|
+
if (ch === 58) {
|
|
3511
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3512
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
3513
|
+
break;
|
|
3514
|
+
}
|
|
3515
|
+
} else if (ch === 35) {
|
|
3516
|
+
preceding = state.input.charCodeAt(state.position - 1);
|
|
3517
|
+
if (is_WS_OR_EOL(preceding)) {
|
|
3518
|
+
break;
|
|
3519
|
+
}
|
|
3520
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
3521
|
+
break;
|
|
3522
|
+
} else if (is_EOL(ch)) {
|
|
3523
|
+
_line = state.line;
|
|
3524
|
+
_lineStart = state.lineStart;
|
|
3525
|
+
_lineIndent = state.lineIndent;
|
|
3526
|
+
skipSeparationSpace(state, false, -1);
|
|
3527
|
+
if (state.lineIndent >= nodeIndent) {
|
|
3528
|
+
hasPendingContent = true;
|
|
3529
|
+
ch = state.input.charCodeAt(state.position);
|
|
3530
|
+
continue;
|
|
3531
|
+
} else {
|
|
3532
|
+
state.position = captureEnd;
|
|
3533
|
+
state.line = _line;
|
|
3534
|
+
state.lineStart = _lineStart;
|
|
3535
|
+
state.lineIndent = _lineIndent;
|
|
3536
|
+
break;
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3539
|
+
if (hasPendingContent) {
|
|
3540
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
3541
|
+
writeFoldedLines(state, state.line - _line);
|
|
3542
|
+
captureStart = captureEnd = state.position;
|
|
3543
|
+
hasPendingContent = false;
|
|
3544
|
+
}
|
|
3545
|
+
if (!is_WHITE_SPACE(ch)) {
|
|
3546
|
+
captureEnd = state.position + 1;
|
|
3547
|
+
}
|
|
3548
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3549
|
+
}
|
|
3550
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
3551
|
+
if (state.result) {
|
|
3552
|
+
return true;
|
|
3553
|
+
}
|
|
3554
|
+
state.kind = _kind;
|
|
3555
|
+
state.result = _result;
|
|
3556
|
+
return false;
|
|
3557
|
+
}
|
|
3558
|
+
function readSingleQuotedScalar(state, nodeIndent) {
|
|
3559
|
+
var ch, captureStart, captureEnd;
|
|
3560
|
+
ch = state.input.charCodeAt(state.position);
|
|
3561
|
+
if (ch !== 39) {
|
|
3562
|
+
return false;
|
|
3563
|
+
}
|
|
3564
|
+
state.kind = "scalar";
|
|
3565
|
+
state.result = "";
|
|
3566
|
+
state.position++;
|
|
3567
|
+
captureStart = captureEnd = state.position;
|
|
3568
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
3569
|
+
if (ch === 39) {
|
|
3570
|
+
captureSegment(state, captureStart, state.position, true);
|
|
3571
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3572
|
+
if (ch === 39) {
|
|
3573
|
+
captureStart = state.position;
|
|
3574
|
+
state.position++;
|
|
3575
|
+
captureEnd = state.position;
|
|
3576
|
+
} else {
|
|
3577
|
+
return true;
|
|
3578
|
+
}
|
|
3579
|
+
} else if (is_EOL(ch)) {
|
|
3580
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
3581
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
3582
|
+
captureStart = captureEnd = state.position;
|
|
3583
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
3584
|
+
throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
3585
|
+
} else {
|
|
3586
|
+
state.position++;
|
|
3587
|
+
captureEnd = state.position;
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
3591
|
+
}
|
|
3592
|
+
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
3593
|
+
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
3594
|
+
ch = state.input.charCodeAt(state.position);
|
|
3595
|
+
if (ch !== 34) {
|
|
3596
|
+
return false;
|
|
3597
|
+
}
|
|
3598
|
+
state.kind = "scalar";
|
|
3599
|
+
state.result = "";
|
|
3600
|
+
state.position++;
|
|
3601
|
+
captureStart = captureEnd = state.position;
|
|
3602
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
3603
|
+
if (ch === 34) {
|
|
3604
|
+
captureSegment(state, captureStart, state.position, true);
|
|
3605
|
+
state.position++;
|
|
3606
|
+
return true;
|
|
3607
|
+
} else if (ch === 92) {
|
|
3608
|
+
captureSegment(state, captureStart, state.position, true);
|
|
3609
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3610
|
+
if (is_EOL(ch)) {
|
|
3611
|
+
skipSeparationSpace(state, false, nodeIndent);
|
|
3612
|
+
} else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
3613
|
+
state.result += simpleEscapeMap[ch];
|
|
3614
|
+
state.position++;
|
|
3615
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
3616
|
+
hexLength = tmp;
|
|
3617
|
+
hexResult = 0;
|
|
3618
|
+
for (; hexLength > 0; hexLength--) {
|
|
3619
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3620
|
+
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
3621
|
+
hexResult = (hexResult << 4) + tmp;
|
|
3622
|
+
} else {
|
|
3623
|
+
throwError(state, "expected hexadecimal character");
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
state.result += charFromCodepoint(hexResult);
|
|
3627
|
+
state.position++;
|
|
3628
|
+
} else {
|
|
3629
|
+
throwError(state, "unknown escape sequence");
|
|
3630
|
+
}
|
|
3631
|
+
captureStart = captureEnd = state.position;
|
|
3632
|
+
} else if (is_EOL(ch)) {
|
|
3633
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
3634
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
3635
|
+
captureStart = captureEnd = state.position;
|
|
3636
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
3637
|
+
throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
3638
|
+
} else {
|
|
3639
|
+
state.position++;
|
|
3640
|
+
captureEnd = state.position;
|
|
3641
|
+
}
|
|
3642
|
+
}
|
|
3643
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
3644
|
+
}
|
|
3645
|
+
function readFlowCollection(state, nodeIndent) {
|
|
3646
|
+
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;
|
|
3647
|
+
ch = state.input.charCodeAt(state.position);
|
|
3648
|
+
if (ch === 91) {
|
|
3649
|
+
terminator = 93;
|
|
3650
|
+
isMapping = false;
|
|
3651
|
+
_result = [];
|
|
3652
|
+
} else if (ch === 123) {
|
|
3653
|
+
terminator = 125;
|
|
3654
|
+
isMapping = true;
|
|
3655
|
+
_result = {};
|
|
3656
|
+
} else {
|
|
3657
|
+
return false;
|
|
3658
|
+
}
|
|
3659
|
+
if (state.anchor !== null) {
|
|
3660
|
+
state.anchorMap[state.anchor] = _result;
|
|
3661
|
+
}
|
|
3662
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3663
|
+
while (ch !== 0) {
|
|
3664
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3665
|
+
ch = state.input.charCodeAt(state.position);
|
|
3666
|
+
if (ch === terminator) {
|
|
3667
|
+
state.position++;
|
|
3668
|
+
state.tag = _tag;
|
|
3669
|
+
state.anchor = _anchor;
|
|
3670
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
3671
|
+
state.result = _result;
|
|
3672
|
+
return true;
|
|
3673
|
+
} else if (!readNext) {
|
|
3674
|
+
throwError(state, "missed comma between flow collection entries");
|
|
3675
|
+
} else if (ch === 44) {
|
|
3676
|
+
throwError(state, "expected the node content, but found ','");
|
|
3677
|
+
}
|
|
3678
|
+
keyTag = keyNode = valueNode = null;
|
|
3679
|
+
isPair = isExplicitPair = false;
|
|
3680
|
+
if (ch === 63) {
|
|
3681
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3682
|
+
if (is_WS_OR_EOL(following)) {
|
|
3683
|
+
isPair = isExplicitPair = true;
|
|
3684
|
+
state.position++;
|
|
3685
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3686
|
+
}
|
|
3687
|
+
}
|
|
3688
|
+
_line = state.line;
|
|
3689
|
+
_lineStart = state.lineStart;
|
|
3690
|
+
_pos = state.position;
|
|
3691
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
3692
|
+
keyTag = state.tag;
|
|
3693
|
+
keyNode = state.result;
|
|
3694
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3695
|
+
ch = state.input.charCodeAt(state.position);
|
|
3696
|
+
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
3697
|
+
isPair = true;
|
|
3698
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3699
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3700
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
3701
|
+
valueNode = state.result;
|
|
3702
|
+
}
|
|
3703
|
+
if (isMapping) {
|
|
3704
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
3705
|
+
} else if (isPair) {
|
|
3706
|
+
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
3707
|
+
} else {
|
|
3708
|
+
_result.push(keyNode);
|
|
3709
|
+
}
|
|
3710
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
3711
|
+
ch = state.input.charCodeAt(state.position);
|
|
3712
|
+
if (ch === 44) {
|
|
3713
|
+
readNext = true;
|
|
3714
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3715
|
+
} else {
|
|
3716
|
+
readNext = false;
|
|
3717
|
+
}
|
|
3718
|
+
}
|
|
3719
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
3720
|
+
}
|
|
3721
|
+
function readBlockScalar(state, nodeIndent) {
|
|
3722
|
+
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
3723
|
+
ch = state.input.charCodeAt(state.position);
|
|
3724
|
+
if (ch === 124) {
|
|
3725
|
+
folding = false;
|
|
3726
|
+
} else if (ch === 62) {
|
|
3727
|
+
folding = true;
|
|
3728
|
+
} else {
|
|
3729
|
+
return false;
|
|
3730
|
+
}
|
|
3731
|
+
state.kind = "scalar";
|
|
3732
|
+
state.result = "";
|
|
3733
|
+
while (ch !== 0) {
|
|
3734
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3735
|
+
if (ch === 43 || ch === 45) {
|
|
3736
|
+
if (CHOMPING_CLIP === chomping) {
|
|
3737
|
+
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
3738
|
+
} else {
|
|
3739
|
+
throwError(state, "repeat of a chomping mode identifier");
|
|
3740
|
+
}
|
|
3741
|
+
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
3742
|
+
if (tmp === 0) {
|
|
3743
|
+
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
3744
|
+
} else if (!detectedIndent) {
|
|
3745
|
+
textIndent = nodeIndent + tmp - 1;
|
|
3746
|
+
detectedIndent = true;
|
|
3747
|
+
} else {
|
|
3748
|
+
throwError(state, "repeat of an indentation width identifier");
|
|
3749
|
+
}
|
|
3750
|
+
} else {
|
|
3751
|
+
break;
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3754
|
+
if (is_WHITE_SPACE(ch)) {
|
|
3755
|
+
do {
|
|
3756
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3757
|
+
} while (is_WHITE_SPACE(ch));
|
|
3758
|
+
if (ch === 35) {
|
|
3759
|
+
do {
|
|
3760
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3761
|
+
} while (!is_EOL(ch) && ch !== 0);
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
while (ch !== 0) {
|
|
3765
|
+
readLineBreak(state);
|
|
3766
|
+
state.lineIndent = 0;
|
|
3767
|
+
ch = state.input.charCodeAt(state.position);
|
|
3768
|
+
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
3769
|
+
state.lineIndent++;
|
|
3770
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3771
|
+
}
|
|
3772
|
+
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
3773
|
+
textIndent = state.lineIndent;
|
|
3774
|
+
}
|
|
3775
|
+
if (is_EOL(ch)) {
|
|
3776
|
+
emptyLines++;
|
|
3777
|
+
continue;
|
|
3778
|
+
}
|
|
3779
|
+
if (state.lineIndent < textIndent) {
|
|
3780
|
+
if (chomping === CHOMPING_KEEP) {
|
|
3781
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
3782
|
+
} else if (chomping === CHOMPING_CLIP) {
|
|
3783
|
+
if (didReadContent) {
|
|
3784
|
+
state.result += "\n";
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
break;
|
|
3788
|
+
}
|
|
3789
|
+
if (folding) {
|
|
3790
|
+
if (is_WHITE_SPACE(ch)) {
|
|
3791
|
+
atMoreIndented = true;
|
|
3792
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
3793
|
+
} else if (atMoreIndented) {
|
|
3794
|
+
atMoreIndented = false;
|
|
3795
|
+
state.result += common.repeat("\n", emptyLines + 1);
|
|
3796
|
+
} else if (emptyLines === 0) {
|
|
3797
|
+
if (didReadContent) {
|
|
3798
|
+
state.result += " ";
|
|
3799
|
+
}
|
|
3800
|
+
} else {
|
|
3801
|
+
state.result += common.repeat("\n", emptyLines);
|
|
3802
|
+
}
|
|
3803
|
+
} else {
|
|
3804
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
3805
|
+
}
|
|
3806
|
+
didReadContent = true;
|
|
3807
|
+
detectedIndent = true;
|
|
3808
|
+
emptyLines = 0;
|
|
3809
|
+
captureStart = state.position;
|
|
3810
|
+
while (!is_EOL(ch) && ch !== 0) {
|
|
3811
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3812
|
+
}
|
|
3813
|
+
captureSegment(state, captureStart, state.position, false);
|
|
3814
|
+
}
|
|
3815
|
+
return true;
|
|
3816
|
+
}
|
|
3817
|
+
function readBlockSequence(state, nodeIndent) {
|
|
3818
|
+
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
3819
|
+
if (state.firstTabInLine !== -1)
|
|
3820
|
+
return false;
|
|
3821
|
+
if (state.anchor !== null) {
|
|
3822
|
+
state.anchorMap[state.anchor] = _result;
|
|
3823
|
+
}
|
|
3824
|
+
ch = state.input.charCodeAt(state.position);
|
|
3825
|
+
while (ch !== 0) {
|
|
3826
|
+
if (state.firstTabInLine !== -1) {
|
|
3827
|
+
state.position = state.firstTabInLine;
|
|
3828
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
3829
|
+
}
|
|
3830
|
+
if (ch !== 45) {
|
|
3831
|
+
break;
|
|
3832
|
+
}
|
|
3833
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3834
|
+
if (!is_WS_OR_EOL(following)) {
|
|
3835
|
+
break;
|
|
3836
|
+
}
|
|
3837
|
+
detected = true;
|
|
3838
|
+
state.position++;
|
|
3839
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
3840
|
+
if (state.lineIndent <= nodeIndent) {
|
|
3841
|
+
_result.push(null);
|
|
3842
|
+
ch = state.input.charCodeAt(state.position);
|
|
3843
|
+
continue;
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
_line = state.line;
|
|
3847
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
3848
|
+
_result.push(state.result);
|
|
3849
|
+
skipSeparationSpace(state, true, -1);
|
|
3850
|
+
ch = state.input.charCodeAt(state.position);
|
|
3851
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
3852
|
+
throwError(state, "bad indentation of a sequence entry");
|
|
3853
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
3854
|
+
break;
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
if (detected) {
|
|
3858
|
+
state.tag = _tag;
|
|
3859
|
+
state.anchor = _anchor;
|
|
3860
|
+
state.kind = "sequence";
|
|
3861
|
+
state.result = _result;
|
|
3862
|
+
return true;
|
|
3863
|
+
}
|
|
3864
|
+
return false;
|
|
3865
|
+
}
|
|
3866
|
+
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
3867
|
+
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;
|
|
3868
|
+
if (state.firstTabInLine !== -1)
|
|
3869
|
+
return false;
|
|
3870
|
+
if (state.anchor !== null) {
|
|
3871
|
+
state.anchorMap[state.anchor] = _result;
|
|
3872
|
+
}
|
|
3873
|
+
ch = state.input.charCodeAt(state.position);
|
|
3874
|
+
while (ch !== 0) {
|
|
3875
|
+
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
3876
|
+
state.position = state.firstTabInLine;
|
|
3877
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
3878
|
+
}
|
|
3879
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
3880
|
+
_line = state.line;
|
|
3881
|
+
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
3882
|
+
if (ch === 63) {
|
|
3883
|
+
if (atExplicitKey) {
|
|
3884
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
3885
|
+
keyTag = keyNode = valueNode = null;
|
|
3886
|
+
}
|
|
3887
|
+
detected = true;
|
|
3888
|
+
atExplicitKey = true;
|
|
3889
|
+
allowCompact = true;
|
|
3890
|
+
} else if (atExplicitKey) {
|
|
3891
|
+
atExplicitKey = false;
|
|
3892
|
+
allowCompact = true;
|
|
3893
|
+
} else {
|
|
3894
|
+
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
3895
|
+
}
|
|
3896
|
+
state.position += 1;
|
|
3897
|
+
ch = following;
|
|
3898
|
+
} else {
|
|
3899
|
+
_keyLine = state.line;
|
|
3900
|
+
_keyLineStart = state.lineStart;
|
|
3901
|
+
_keyPos = state.position;
|
|
3902
|
+
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
3903
|
+
break;
|
|
3904
|
+
}
|
|
3905
|
+
if (state.line === _line) {
|
|
3906
|
+
ch = state.input.charCodeAt(state.position);
|
|
3907
|
+
while (is_WHITE_SPACE(ch)) {
|
|
3908
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3909
|
+
}
|
|
3910
|
+
if (ch === 58) {
|
|
3911
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3912
|
+
if (!is_WS_OR_EOL(ch)) {
|
|
3913
|
+
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
3914
|
+
}
|
|
3915
|
+
if (atExplicitKey) {
|
|
3916
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
3917
|
+
keyTag = keyNode = valueNode = null;
|
|
3918
|
+
}
|
|
3919
|
+
detected = true;
|
|
3920
|
+
atExplicitKey = false;
|
|
3921
|
+
allowCompact = false;
|
|
3922
|
+
keyTag = state.tag;
|
|
3923
|
+
keyNode = state.result;
|
|
3924
|
+
} else if (detected) {
|
|
3925
|
+
throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
3926
|
+
} else {
|
|
3927
|
+
state.tag = _tag;
|
|
3928
|
+
state.anchor = _anchor;
|
|
3929
|
+
return true;
|
|
3930
|
+
}
|
|
3931
|
+
} else if (detected) {
|
|
3932
|
+
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
3933
|
+
} else {
|
|
3934
|
+
state.tag = _tag;
|
|
3935
|
+
state.anchor = _anchor;
|
|
3936
|
+
return true;
|
|
3937
|
+
}
|
|
3938
|
+
}
|
|
3939
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
3940
|
+
if (atExplicitKey) {
|
|
3941
|
+
_keyLine = state.line;
|
|
3942
|
+
_keyLineStart = state.lineStart;
|
|
3943
|
+
_keyPos = state.position;
|
|
3944
|
+
}
|
|
3945
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
3946
|
+
if (atExplicitKey) {
|
|
3947
|
+
keyNode = state.result;
|
|
3948
|
+
} else {
|
|
3949
|
+
valueNode = state.result;
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
if (!atExplicitKey) {
|
|
3953
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
3954
|
+
keyTag = keyNode = valueNode = null;
|
|
3955
|
+
}
|
|
3956
|
+
skipSeparationSpace(state, true, -1);
|
|
3957
|
+
ch = state.input.charCodeAt(state.position);
|
|
3958
|
+
}
|
|
3959
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
3960
|
+
throwError(state, "bad indentation of a mapping entry");
|
|
3961
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
3962
|
+
break;
|
|
3963
|
+
}
|
|
3964
|
+
}
|
|
3965
|
+
if (atExplicitKey) {
|
|
3966
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
3967
|
+
}
|
|
3968
|
+
if (detected) {
|
|
3969
|
+
state.tag = _tag;
|
|
3970
|
+
state.anchor = _anchor;
|
|
3971
|
+
state.kind = "mapping";
|
|
3972
|
+
state.result = _result;
|
|
3973
|
+
}
|
|
3974
|
+
return detected;
|
|
3975
|
+
}
|
|
3976
|
+
function readTagProperty(state) {
|
|
3977
|
+
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
3978
|
+
ch = state.input.charCodeAt(state.position);
|
|
3979
|
+
if (ch !== 33)
|
|
3980
|
+
return false;
|
|
3981
|
+
if (state.tag !== null) {
|
|
3982
|
+
throwError(state, "duplication of a tag property");
|
|
3983
|
+
}
|
|
3984
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3985
|
+
if (ch === 60) {
|
|
3986
|
+
isVerbatim = true;
|
|
3987
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3988
|
+
} else if (ch === 33) {
|
|
3989
|
+
isNamed = true;
|
|
3990
|
+
tagHandle = "!!";
|
|
3991
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3992
|
+
} else {
|
|
3993
|
+
tagHandle = "!";
|
|
3994
|
+
}
|
|
3995
|
+
_position = state.position;
|
|
3996
|
+
if (isVerbatim) {
|
|
3997
|
+
do {
|
|
3998
|
+
ch = state.input.charCodeAt(++state.position);
|
|
3999
|
+
} while (ch !== 0 && ch !== 62);
|
|
4000
|
+
if (state.position < state.length) {
|
|
4001
|
+
tagName = state.input.slice(_position, state.position);
|
|
4002
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4003
|
+
} else {
|
|
4004
|
+
throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
4005
|
+
}
|
|
4006
|
+
} else {
|
|
4007
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
4008
|
+
if (ch === 33) {
|
|
4009
|
+
if (!isNamed) {
|
|
4010
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
4011
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
4012
|
+
throwError(state, "named tag handle cannot contain such characters");
|
|
4013
|
+
}
|
|
4014
|
+
isNamed = true;
|
|
4015
|
+
_position = state.position + 1;
|
|
4016
|
+
} else {
|
|
4017
|
+
throwError(state, "tag suffix cannot contain exclamation marks");
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4021
|
+
}
|
|
4022
|
+
tagName = state.input.slice(_position, state.position);
|
|
4023
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
4024
|
+
throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
4025
|
+
}
|
|
4026
|
+
}
|
|
4027
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
4028
|
+
throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
4029
|
+
}
|
|
4030
|
+
try {
|
|
4031
|
+
tagName = decodeURIComponent(tagName);
|
|
4032
|
+
} catch (err) {
|
|
4033
|
+
throwError(state, "tag name is malformed: " + tagName);
|
|
4034
|
+
}
|
|
4035
|
+
if (isVerbatim) {
|
|
4036
|
+
state.tag = tagName;
|
|
4037
|
+
} else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
|
|
4038
|
+
state.tag = state.tagMap[tagHandle] + tagName;
|
|
4039
|
+
} else if (tagHandle === "!") {
|
|
4040
|
+
state.tag = "!" + tagName;
|
|
4041
|
+
} else if (tagHandle === "!!") {
|
|
4042
|
+
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
4043
|
+
} else {
|
|
4044
|
+
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
4045
|
+
}
|
|
4046
|
+
return true;
|
|
4047
|
+
}
|
|
4048
|
+
function readAnchorProperty(state) {
|
|
4049
|
+
var _position, ch;
|
|
4050
|
+
ch = state.input.charCodeAt(state.position);
|
|
4051
|
+
if (ch !== 38)
|
|
4052
|
+
return false;
|
|
4053
|
+
if (state.anchor !== null) {
|
|
4054
|
+
throwError(state, "duplication of an anchor property");
|
|
4055
|
+
}
|
|
4056
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4057
|
+
_position = state.position;
|
|
4058
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
4059
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4060
|
+
}
|
|
4061
|
+
if (state.position === _position) {
|
|
4062
|
+
throwError(state, "name of an anchor node must contain at least one character");
|
|
4063
|
+
}
|
|
4064
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
4065
|
+
return true;
|
|
4066
|
+
}
|
|
4067
|
+
function readAlias(state) {
|
|
4068
|
+
var _position, alias, ch;
|
|
4069
|
+
ch = state.input.charCodeAt(state.position);
|
|
4070
|
+
if (ch !== 42)
|
|
4071
|
+
return false;
|
|
4072
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4073
|
+
_position = state.position;
|
|
4074
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
4075
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4076
|
+
}
|
|
4077
|
+
if (state.position === _position) {
|
|
4078
|
+
throwError(state, "name of an alias node must contain at least one character");
|
|
4079
|
+
}
|
|
4080
|
+
alias = state.input.slice(_position, state.position);
|
|
4081
|
+
if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
|
|
4082
|
+
throwError(state, 'unidentified alias "' + alias + '"');
|
|
4083
|
+
}
|
|
4084
|
+
state.result = state.anchorMap[alias];
|
|
4085
|
+
skipSeparationSpace(state, true, -1);
|
|
4086
|
+
return true;
|
|
4087
|
+
}
|
|
4088
|
+
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
4089
|
+
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
|
|
4090
|
+
if (state.listener !== null) {
|
|
4091
|
+
state.listener("open", state);
|
|
4092
|
+
}
|
|
4093
|
+
state.tag = null;
|
|
4094
|
+
state.anchor = null;
|
|
4095
|
+
state.kind = null;
|
|
4096
|
+
state.result = null;
|
|
4097
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
4098
|
+
if (allowToSeek) {
|
|
4099
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
4100
|
+
atNewLine = true;
|
|
4101
|
+
if (state.lineIndent > parentIndent) {
|
|
4102
|
+
indentStatus = 1;
|
|
4103
|
+
} else if (state.lineIndent === parentIndent) {
|
|
4104
|
+
indentStatus = 0;
|
|
4105
|
+
} else if (state.lineIndent < parentIndent) {
|
|
4106
|
+
indentStatus = -1;
|
|
4107
|
+
}
|
|
4108
|
+
}
|
|
4109
|
+
}
|
|
4110
|
+
if (indentStatus === 1) {
|
|
4111
|
+
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
4112
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
4113
|
+
atNewLine = true;
|
|
4114
|
+
allowBlockCollections = allowBlockStyles;
|
|
4115
|
+
if (state.lineIndent > parentIndent) {
|
|
4116
|
+
indentStatus = 1;
|
|
4117
|
+
} else if (state.lineIndent === parentIndent) {
|
|
4118
|
+
indentStatus = 0;
|
|
4119
|
+
} else if (state.lineIndent < parentIndent) {
|
|
4120
|
+
indentStatus = -1;
|
|
4121
|
+
}
|
|
4122
|
+
} else {
|
|
4123
|
+
allowBlockCollections = false;
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
if (allowBlockCollections) {
|
|
4128
|
+
allowBlockCollections = atNewLine || allowCompact;
|
|
4129
|
+
}
|
|
4130
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
4131
|
+
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
4132
|
+
flowIndent = parentIndent;
|
|
4133
|
+
} else {
|
|
4134
|
+
flowIndent = parentIndent + 1;
|
|
4135
|
+
}
|
|
4136
|
+
blockIndent = state.position - state.lineStart;
|
|
4137
|
+
if (indentStatus === 1) {
|
|
4138
|
+
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
|
|
4139
|
+
hasContent = true;
|
|
4140
|
+
} else {
|
|
4141
|
+
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
|
|
4142
|
+
hasContent = true;
|
|
4143
|
+
} else if (readAlias(state)) {
|
|
4144
|
+
hasContent = true;
|
|
4145
|
+
if (state.tag !== null || state.anchor !== null) {
|
|
4146
|
+
throwError(state, "alias node should not have any properties");
|
|
4147
|
+
}
|
|
4148
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
4149
|
+
hasContent = true;
|
|
4150
|
+
if (state.tag === null) {
|
|
4151
|
+
state.tag = "?";
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
4154
|
+
if (state.anchor !== null) {
|
|
4155
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4156
|
+
}
|
|
4157
|
+
}
|
|
4158
|
+
} else if (indentStatus === 0) {
|
|
4159
|
+
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
4162
|
+
if (state.tag === null) {
|
|
4163
|
+
if (state.anchor !== null) {
|
|
4164
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4165
|
+
}
|
|
4166
|
+
} else if (state.tag === "?") {
|
|
4167
|
+
if (state.result !== null && state.kind !== "scalar") {
|
|
4168
|
+
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
4169
|
+
}
|
|
4170
|
+
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
4171
|
+
type2 = state.implicitTypes[typeIndex];
|
|
4172
|
+
if (type2.resolve(state.result)) {
|
|
4173
|
+
state.result = type2.construct(state.result);
|
|
4174
|
+
state.tag = type2.tag;
|
|
4175
|
+
if (state.anchor !== null) {
|
|
4176
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4177
|
+
}
|
|
4178
|
+
break;
|
|
4179
|
+
}
|
|
4180
|
+
}
|
|
4181
|
+
} else if (state.tag !== "!") {
|
|
4182
|
+
if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
4183
|
+
type2 = state.typeMap[state.kind || "fallback"][state.tag];
|
|
4184
|
+
} else {
|
|
4185
|
+
type2 = null;
|
|
4186
|
+
typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
4187
|
+
for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
4188
|
+
if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
4189
|
+
type2 = typeList[typeIndex];
|
|
4190
|
+
break;
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
}
|
|
4194
|
+
if (!type2) {
|
|
4195
|
+
throwError(state, "unknown tag !<" + state.tag + ">");
|
|
4196
|
+
}
|
|
4197
|
+
if (state.result !== null && type2.kind !== state.kind) {
|
|
4198
|
+
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
|
|
4199
|
+
}
|
|
4200
|
+
if (!type2.resolve(state.result, state.tag)) {
|
|
4201
|
+
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
4202
|
+
} else {
|
|
4203
|
+
state.result = type2.construct(state.result, state.tag);
|
|
4204
|
+
if (state.anchor !== null) {
|
|
4205
|
+
state.anchorMap[state.anchor] = state.result;
|
|
4206
|
+
}
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
if (state.listener !== null) {
|
|
4210
|
+
state.listener("close", state);
|
|
4211
|
+
}
|
|
4212
|
+
return state.tag !== null || state.anchor !== null || hasContent;
|
|
4213
|
+
}
|
|
4214
|
+
function readDocument(state) {
|
|
4215
|
+
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
4216
|
+
state.version = null;
|
|
4217
|
+
state.checkLineBreaks = state.legacy;
|
|
4218
|
+
state.tagMap = Object.create(null);
|
|
4219
|
+
state.anchorMap = Object.create(null);
|
|
4220
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
4221
|
+
skipSeparationSpace(state, true, -1);
|
|
4222
|
+
ch = state.input.charCodeAt(state.position);
|
|
4223
|
+
if (state.lineIndent > 0 || ch !== 37) {
|
|
4224
|
+
break;
|
|
4225
|
+
}
|
|
4226
|
+
hasDirectives = true;
|
|
4227
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4228
|
+
_position = state.position;
|
|
4229
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
4230
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4231
|
+
}
|
|
4232
|
+
directiveName = state.input.slice(_position, state.position);
|
|
4233
|
+
directiveArgs = [];
|
|
4234
|
+
if (directiveName.length < 1) {
|
|
4235
|
+
throwError(state, "directive name must not be less than one character in length");
|
|
4236
|
+
}
|
|
4237
|
+
while (ch !== 0) {
|
|
4238
|
+
while (is_WHITE_SPACE(ch)) {
|
|
4239
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4240
|
+
}
|
|
4241
|
+
if (ch === 35) {
|
|
4242
|
+
do {
|
|
4243
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4244
|
+
} while (ch !== 0 && !is_EOL(ch));
|
|
4245
|
+
break;
|
|
4246
|
+
}
|
|
4247
|
+
if (is_EOL(ch))
|
|
4248
|
+
break;
|
|
4249
|
+
_position = state.position;
|
|
4250
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
4251
|
+
ch = state.input.charCodeAt(++state.position);
|
|
4252
|
+
}
|
|
4253
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
4254
|
+
}
|
|
4255
|
+
if (ch !== 0)
|
|
4256
|
+
readLineBreak(state);
|
|
4257
|
+
if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
|
|
4258
|
+
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
4259
|
+
} else {
|
|
4260
|
+
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
skipSeparationSpace(state, true, -1);
|
|
4264
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
4265
|
+
state.position += 3;
|
|
4266
|
+
skipSeparationSpace(state, true, -1);
|
|
4267
|
+
} else if (hasDirectives) {
|
|
4268
|
+
throwError(state, "directives end mark is expected");
|
|
4269
|
+
}
|
|
4270
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
4271
|
+
skipSeparationSpace(state, true, -1);
|
|
4272
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
4273
|
+
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
4274
|
+
}
|
|
4275
|
+
state.documents.push(state.result);
|
|
4276
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
4277
|
+
if (state.input.charCodeAt(state.position) === 46) {
|
|
4278
|
+
state.position += 3;
|
|
4279
|
+
skipSeparationSpace(state, true, -1);
|
|
4280
|
+
}
|
|
4281
|
+
return;
|
|
4282
|
+
}
|
|
4283
|
+
if (state.position < state.length - 1) {
|
|
4284
|
+
throwError(state, "end of the stream or a document separator is expected");
|
|
4285
|
+
} else {
|
|
4286
|
+
return;
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
function loadDocuments(input, options) {
|
|
4290
|
+
input = String(input);
|
|
4291
|
+
options = options || {};
|
|
4292
|
+
if (input.length !== 0) {
|
|
4293
|
+
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
4294
|
+
input += "\n";
|
|
4295
|
+
}
|
|
4296
|
+
if (input.charCodeAt(0) === 65279) {
|
|
4297
|
+
input = input.slice(1);
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
var state = new State$1(input, options);
|
|
4301
|
+
var nullpos = input.indexOf("\0");
|
|
4302
|
+
if (nullpos !== -1) {
|
|
4303
|
+
state.position = nullpos;
|
|
4304
|
+
throwError(state, "null byte is not allowed in input");
|
|
4305
|
+
}
|
|
4306
|
+
state.input += "\0";
|
|
4307
|
+
while (state.input.charCodeAt(state.position) === 32) {
|
|
4308
|
+
state.lineIndent += 1;
|
|
4309
|
+
state.position += 1;
|
|
4310
|
+
}
|
|
4311
|
+
while (state.position < state.length - 1) {
|
|
4312
|
+
readDocument(state);
|
|
4313
|
+
}
|
|
4314
|
+
return state.documents;
|
|
4315
|
+
}
|
|
4316
|
+
function loadAll$1(input, iterator, options) {
|
|
4317
|
+
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
4318
|
+
options = iterator;
|
|
4319
|
+
iterator = null;
|
|
4320
|
+
}
|
|
4321
|
+
var documents = loadDocuments(input, options);
|
|
4322
|
+
if (typeof iterator !== "function") {
|
|
4323
|
+
return documents;
|
|
4324
|
+
}
|
|
4325
|
+
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
4326
|
+
iterator(documents[index]);
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
function load$1(input, options) {
|
|
4330
|
+
var documents = loadDocuments(input, options);
|
|
4331
|
+
if (documents.length === 0) {
|
|
4332
|
+
return void 0;
|
|
4333
|
+
} else if (documents.length === 1) {
|
|
4334
|
+
return documents[0];
|
|
4335
|
+
}
|
|
4336
|
+
throw new exception("expected a single document in the stream, but found more");
|
|
4337
|
+
}
|
|
4338
|
+
var loadAll_1 = loadAll$1;
|
|
4339
|
+
var load_1 = load$1;
|
|
4340
|
+
var loader = {
|
|
4341
|
+
loadAll: loadAll_1,
|
|
4342
|
+
load: load_1
|
|
4343
|
+
};
|
|
4344
|
+
var _toString = Object.prototype.toString;
|
|
4345
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4346
|
+
var CHAR_BOM = 65279;
|
|
4347
|
+
var CHAR_TAB = 9;
|
|
4348
|
+
var CHAR_LINE_FEED = 10;
|
|
4349
|
+
var CHAR_CARRIAGE_RETURN = 13;
|
|
4350
|
+
var CHAR_SPACE = 32;
|
|
4351
|
+
var CHAR_EXCLAMATION = 33;
|
|
4352
|
+
var CHAR_DOUBLE_QUOTE = 34;
|
|
4353
|
+
var CHAR_SHARP = 35;
|
|
4354
|
+
var CHAR_PERCENT = 37;
|
|
4355
|
+
var CHAR_AMPERSAND = 38;
|
|
4356
|
+
var CHAR_SINGLE_QUOTE = 39;
|
|
4357
|
+
var CHAR_ASTERISK = 42;
|
|
4358
|
+
var CHAR_COMMA = 44;
|
|
4359
|
+
var CHAR_MINUS = 45;
|
|
4360
|
+
var CHAR_COLON = 58;
|
|
4361
|
+
var CHAR_EQUALS = 61;
|
|
4362
|
+
var CHAR_GREATER_THAN = 62;
|
|
4363
|
+
var CHAR_QUESTION = 63;
|
|
4364
|
+
var CHAR_COMMERCIAL_AT = 64;
|
|
4365
|
+
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
4366
|
+
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
4367
|
+
var CHAR_GRAVE_ACCENT = 96;
|
|
4368
|
+
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
4369
|
+
var CHAR_VERTICAL_LINE = 124;
|
|
4370
|
+
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
4371
|
+
var ESCAPE_SEQUENCES = {};
|
|
4372
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
4373
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
4374
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
4375
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
4376
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
4377
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
4378
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
4379
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
4380
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
4381
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
4382
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
4383
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
4384
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
4385
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
4386
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
4387
|
+
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
4388
|
+
"y",
|
|
4389
|
+
"Y",
|
|
4390
|
+
"yes",
|
|
4391
|
+
"Yes",
|
|
4392
|
+
"YES",
|
|
4393
|
+
"on",
|
|
4394
|
+
"On",
|
|
4395
|
+
"ON",
|
|
4396
|
+
"n",
|
|
4397
|
+
"N",
|
|
4398
|
+
"no",
|
|
4399
|
+
"No",
|
|
4400
|
+
"NO",
|
|
4401
|
+
"off",
|
|
4402
|
+
"Off",
|
|
4403
|
+
"OFF"
|
|
4404
|
+
];
|
|
4405
|
+
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
4406
|
+
function compileStyleMap(schema2, map2) {
|
|
4407
|
+
var result, keys, index, length, tag, style, type2;
|
|
4408
|
+
if (map2 === null)
|
|
4409
|
+
return {};
|
|
4410
|
+
result = {};
|
|
4411
|
+
keys = Object.keys(map2);
|
|
4412
|
+
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
4413
|
+
tag = keys[index];
|
|
4414
|
+
style = String(map2[tag]);
|
|
4415
|
+
if (tag.slice(0, 2) === "!!") {
|
|
4416
|
+
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
4417
|
+
}
|
|
4418
|
+
type2 = schema2.compiledTypeMap["fallback"][tag];
|
|
4419
|
+
if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
|
|
4420
|
+
style = type2.styleAliases[style];
|
|
4421
|
+
}
|
|
4422
|
+
result[tag] = style;
|
|
4423
|
+
}
|
|
4424
|
+
return result;
|
|
4425
|
+
}
|
|
4426
|
+
function encodeHex(character) {
|
|
4427
|
+
var string, handle, length;
|
|
4428
|
+
string = character.toString(16).toUpperCase();
|
|
4429
|
+
if (character <= 255) {
|
|
4430
|
+
handle = "x";
|
|
4431
|
+
length = 2;
|
|
4432
|
+
} else if (character <= 65535) {
|
|
4433
|
+
handle = "u";
|
|
4434
|
+
length = 4;
|
|
4435
|
+
} else if (character <= 4294967295) {
|
|
4436
|
+
handle = "U";
|
|
4437
|
+
length = 8;
|
|
4438
|
+
} else {
|
|
4439
|
+
throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
|
|
4440
|
+
}
|
|
4441
|
+
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
4442
|
+
}
|
|
4443
|
+
var QUOTING_TYPE_SINGLE = 1;
|
|
4444
|
+
var QUOTING_TYPE_DOUBLE = 2;
|
|
4445
|
+
function State(options) {
|
|
4446
|
+
this.schema = options["schema"] || _default;
|
|
4447
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
4448
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
4449
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
4450
|
+
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
4451
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
4452
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
4453
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
4454
|
+
this.noRefs = options["noRefs"] || false;
|
|
4455
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
4456
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
4457
|
+
this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
4458
|
+
this.forceQuotes = options["forceQuotes"] || false;
|
|
4459
|
+
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
|
|
4460
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
4461
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
4462
|
+
this.tag = null;
|
|
4463
|
+
this.result = "";
|
|
4464
|
+
this.duplicates = [];
|
|
4465
|
+
this.usedDuplicates = null;
|
|
4466
|
+
}
|
|
4467
|
+
function indentString(string, spaces) {
|
|
4468
|
+
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
4469
|
+
while (position < length) {
|
|
4470
|
+
next = string.indexOf("\n", position);
|
|
4471
|
+
if (next === -1) {
|
|
4472
|
+
line = string.slice(position);
|
|
4473
|
+
position = length;
|
|
4474
|
+
} else {
|
|
4475
|
+
line = string.slice(position, next + 1);
|
|
4476
|
+
position = next + 1;
|
|
4477
|
+
}
|
|
4478
|
+
if (line.length && line !== "\n")
|
|
4479
|
+
result += ind;
|
|
4480
|
+
result += line;
|
|
4481
|
+
}
|
|
4482
|
+
return result;
|
|
4483
|
+
}
|
|
4484
|
+
function generateNextLine(state, level) {
|
|
4485
|
+
return "\n" + common.repeat(" ", state.indent * level);
|
|
4486
|
+
}
|
|
4487
|
+
function testImplicitResolving(state, str2) {
|
|
4488
|
+
var index, length, type2;
|
|
4489
|
+
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
4490
|
+
type2 = state.implicitTypes[index];
|
|
4491
|
+
if (type2.resolve(str2)) {
|
|
4492
|
+
return true;
|
|
4493
|
+
}
|
|
4494
|
+
}
|
|
4495
|
+
return false;
|
|
4496
|
+
}
|
|
4497
|
+
function isWhitespace(c) {
|
|
4498
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
4499
|
+
}
|
|
4500
|
+
function isPrintable(c) {
|
|
4501
|
+
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
|
|
4502
|
+
}
|
|
4503
|
+
function isNsCharOrWhitespace(c) {
|
|
4504
|
+
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
4505
|
+
}
|
|
4506
|
+
function isPlainSafe(c, prev, inblock) {
|
|
4507
|
+
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
4508
|
+
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
4509
|
+
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;
|
|
4510
|
+
}
|
|
4511
|
+
function isPlainSafeFirst(c) {
|
|
4512
|
+
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;
|
|
4513
|
+
}
|
|
4514
|
+
function isPlainSafeLast(c) {
|
|
4515
|
+
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
4516
|
+
}
|
|
4517
|
+
function codePointAt(string, pos) {
|
|
4518
|
+
var first = string.charCodeAt(pos), second;
|
|
4519
|
+
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
|
|
4520
|
+
second = string.charCodeAt(pos + 1);
|
|
4521
|
+
if (second >= 56320 && second <= 57343) {
|
|
4522
|
+
return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
return first;
|
|
4526
|
+
}
|
|
4527
|
+
function needIndentIndicator(string) {
|
|
4528
|
+
var leadingSpaceRe = /^\n* /;
|
|
4529
|
+
return leadingSpaceRe.test(string);
|
|
4530
|
+
}
|
|
4531
|
+
var STYLE_PLAIN = 1;
|
|
4532
|
+
var STYLE_SINGLE = 2;
|
|
4533
|
+
var STYLE_LITERAL = 3;
|
|
4534
|
+
var STYLE_FOLDED = 4;
|
|
4535
|
+
var STYLE_DOUBLE = 5;
|
|
4536
|
+
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
4537
|
+
var i;
|
|
4538
|
+
var char = 0;
|
|
4539
|
+
var prevChar = null;
|
|
4540
|
+
var hasLineBreak = false;
|
|
4541
|
+
var hasFoldableLine = false;
|
|
4542
|
+
var shouldTrackWidth = lineWidth !== -1;
|
|
4543
|
+
var previousLineBreak = -1;
|
|
4544
|
+
var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
4545
|
+
if (singleLineOnly || forceQuotes) {
|
|
4546
|
+
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
4547
|
+
char = codePointAt(string, i);
|
|
4548
|
+
if (!isPrintable(char)) {
|
|
4549
|
+
return STYLE_DOUBLE;
|
|
4550
|
+
}
|
|
4551
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
4552
|
+
prevChar = char;
|
|
4553
|
+
}
|
|
4554
|
+
} else {
|
|
4555
|
+
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
4556
|
+
char = codePointAt(string, i);
|
|
4557
|
+
if (char === CHAR_LINE_FEED) {
|
|
4558
|
+
hasLineBreak = true;
|
|
4559
|
+
if (shouldTrackWidth) {
|
|
4560
|
+
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
4561
|
+
previousLineBreak = i;
|
|
4562
|
+
}
|
|
4563
|
+
} else if (!isPrintable(char)) {
|
|
4564
|
+
return STYLE_DOUBLE;
|
|
4565
|
+
}
|
|
4566
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
4567
|
+
prevChar = char;
|
|
4568
|
+
}
|
|
4569
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
|
|
4570
|
+
}
|
|
4571
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
4572
|
+
if (plain && !forceQuotes && !testAmbiguousType(string)) {
|
|
4573
|
+
return STYLE_PLAIN;
|
|
4574
|
+
}
|
|
4575
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
4576
|
+
}
|
|
4577
|
+
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
|
4578
|
+
return STYLE_DOUBLE;
|
|
4579
|
+
}
|
|
4580
|
+
if (!forceQuotes) {
|
|
4581
|
+
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
4582
|
+
}
|
|
4583
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
4584
|
+
}
|
|
4585
|
+
function writeScalar(state, string, level, iskey, inblock) {
|
|
4586
|
+
state.dump = function() {
|
|
4587
|
+
if (string.length === 0) {
|
|
4588
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
|
4589
|
+
}
|
|
4590
|
+
if (!state.noCompatMode) {
|
|
4591
|
+
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
|
|
4592
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
var indent = state.indent * Math.max(1, level);
|
|
4596
|
+
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
4597
|
+
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
4598
|
+
function testAmbiguity(string2) {
|
|
4599
|
+
return testImplicitResolving(state, string2);
|
|
4600
|
+
}
|
|
4601
|
+
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
|
|
4602
|
+
case STYLE_PLAIN:
|
|
4603
|
+
return string;
|
|
4604
|
+
case STYLE_SINGLE:
|
|
4605
|
+
return "'" + string.replace(/'/g, "''") + "'";
|
|
4606
|
+
case STYLE_LITERAL:
|
|
4607
|
+
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
4608
|
+
case STYLE_FOLDED:
|
|
4609
|
+
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
4610
|
+
case STYLE_DOUBLE:
|
|
4611
|
+
return '"' + escapeString(string) + '"';
|
|
4612
|
+
default:
|
|
4613
|
+
throw new exception("impossible error: invalid scalar style");
|
|
4614
|
+
}
|
|
4615
|
+
}();
|
|
4616
|
+
}
|
|
4617
|
+
function blockHeader(string, indentPerLevel) {
|
|
4618
|
+
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
4619
|
+
var clip = string[string.length - 1] === "\n";
|
|
4620
|
+
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
|
|
4621
|
+
var chomp = keep ? "+" : clip ? "" : "-";
|
|
4622
|
+
return indentIndicator + chomp + "\n";
|
|
4623
|
+
}
|
|
4624
|
+
function dropEndingNewline(string) {
|
|
4625
|
+
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
4626
|
+
}
|
|
4627
|
+
function foldString(string, width) {
|
|
4628
|
+
var lineRe = /(\n+)([^\n]*)/g;
|
|
4629
|
+
var result = function() {
|
|
4630
|
+
var nextLF = string.indexOf("\n");
|
|
4631
|
+
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
4632
|
+
lineRe.lastIndex = nextLF;
|
|
4633
|
+
return foldLine(string.slice(0, nextLF), width);
|
|
4634
|
+
}();
|
|
4635
|
+
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
4636
|
+
var moreIndented;
|
|
4637
|
+
var match;
|
|
4638
|
+
while (match = lineRe.exec(string)) {
|
|
4639
|
+
var prefix = match[1], line = match[2];
|
|
4640
|
+
moreIndented = line[0] === " ";
|
|
4641
|
+
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
4642
|
+
prevMoreIndented = moreIndented;
|
|
4643
|
+
}
|
|
4644
|
+
return result;
|
|
4645
|
+
}
|
|
4646
|
+
function foldLine(line, width) {
|
|
4647
|
+
if (line === "" || line[0] === " ")
|
|
4648
|
+
return line;
|
|
4649
|
+
var breakRe = / [^ ]/g;
|
|
4650
|
+
var match;
|
|
4651
|
+
var start = 0, end, curr = 0, next = 0;
|
|
4652
|
+
var result = "";
|
|
4653
|
+
while (match = breakRe.exec(line)) {
|
|
4654
|
+
next = match.index;
|
|
4655
|
+
if (next - start > width) {
|
|
4656
|
+
end = curr > start ? curr : next;
|
|
4657
|
+
result += "\n" + line.slice(start, end);
|
|
4658
|
+
start = end + 1;
|
|
4659
|
+
}
|
|
4660
|
+
curr = next;
|
|
4661
|
+
}
|
|
4662
|
+
result += "\n";
|
|
4663
|
+
if (line.length - start > width && curr > start) {
|
|
4664
|
+
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
4665
|
+
} else {
|
|
4666
|
+
result += line.slice(start);
|
|
4667
|
+
}
|
|
4668
|
+
return result.slice(1);
|
|
4669
|
+
}
|
|
4670
|
+
function escapeString(string) {
|
|
4671
|
+
var result = "";
|
|
4672
|
+
var char = 0;
|
|
4673
|
+
var escapeSeq;
|
|
4674
|
+
for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
4675
|
+
char = codePointAt(string, i);
|
|
4676
|
+
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
4677
|
+
if (!escapeSeq && isPrintable(char)) {
|
|
4678
|
+
result += string[i];
|
|
4679
|
+
if (char >= 65536)
|
|
4680
|
+
result += string[i + 1];
|
|
4681
|
+
} else {
|
|
4682
|
+
result += escapeSeq || encodeHex(char);
|
|
4683
|
+
}
|
|
4684
|
+
}
|
|
4685
|
+
return result;
|
|
4686
|
+
}
|
|
4687
|
+
function writeFlowSequence(state, level, object) {
|
|
4688
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
4689
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
4690
|
+
value = object[index];
|
|
4691
|
+
if (state.replacer) {
|
|
4692
|
+
value = state.replacer.call(object, String(index), value);
|
|
4693
|
+
}
|
|
4694
|
+
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
|
|
4695
|
+
if (_result !== "")
|
|
4696
|
+
_result += "," + (!state.condenseFlow ? " " : "");
|
|
4697
|
+
_result += state.dump;
|
|
4698
|
+
}
|
|
4699
|
+
}
|
|
4700
|
+
state.tag = _tag;
|
|
4701
|
+
state.dump = "[" + _result + "]";
|
|
4702
|
+
}
|
|
4703
|
+
function writeBlockSequence(state, level, object, compact) {
|
|
4704
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
4705
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
4706
|
+
value = object[index];
|
|
4707
|
+
if (state.replacer) {
|
|
4708
|
+
value = state.replacer.call(object, String(index), value);
|
|
4709
|
+
}
|
|
4710
|
+
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
4711
|
+
if (!compact || _result !== "") {
|
|
4712
|
+
_result += generateNextLine(state, level);
|
|
4713
|
+
}
|
|
4714
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
4715
|
+
_result += "-";
|
|
4716
|
+
} else {
|
|
4717
|
+
_result += "- ";
|
|
4718
|
+
}
|
|
4719
|
+
_result += state.dump;
|
|
4720
|
+
}
|
|
4721
|
+
}
|
|
4722
|
+
state.tag = _tag;
|
|
4723
|
+
state.dump = _result || "[]";
|
|
4724
|
+
}
|
|
4725
|
+
function writeFlowMapping(state, level, object) {
|
|
4726
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
4727
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
4728
|
+
pairBuffer = "";
|
|
4729
|
+
if (_result !== "")
|
|
4730
|
+
pairBuffer += ", ";
|
|
4731
|
+
if (state.condenseFlow)
|
|
4732
|
+
pairBuffer += '"';
|
|
4733
|
+
objectKey = objectKeyList[index];
|
|
4734
|
+
objectValue = object[objectKey];
|
|
4735
|
+
if (state.replacer) {
|
|
4736
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
4737
|
+
}
|
|
4738
|
+
if (!writeNode(state, level, objectKey, false, false)) {
|
|
4739
|
+
continue;
|
|
4740
|
+
}
|
|
4741
|
+
if (state.dump.length > 1024)
|
|
4742
|
+
pairBuffer += "? ";
|
|
4743
|
+
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
4744
|
+
if (!writeNode(state, level, objectValue, false, false)) {
|
|
4745
|
+
continue;
|
|
4746
|
+
}
|
|
4747
|
+
pairBuffer += state.dump;
|
|
4748
|
+
_result += pairBuffer;
|
|
4749
|
+
}
|
|
4750
|
+
state.tag = _tag;
|
|
4751
|
+
state.dump = "{" + _result + "}";
|
|
4752
|
+
}
|
|
4753
|
+
function writeBlockMapping(state, level, object, compact) {
|
|
4754
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
4755
|
+
if (state.sortKeys === true) {
|
|
4756
|
+
objectKeyList.sort();
|
|
4757
|
+
} else if (typeof state.sortKeys === "function") {
|
|
4758
|
+
objectKeyList.sort(state.sortKeys);
|
|
4759
|
+
} else if (state.sortKeys) {
|
|
4760
|
+
throw new exception("sortKeys must be a boolean or a function");
|
|
4761
|
+
}
|
|
4762
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
4763
|
+
pairBuffer = "";
|
|
4764
|
+
if (!compact || _result !== "") {
|
|
4765
|
+
pairBuffer += generateNextLine(state, level);
|
|
4766
|
+
}
|
|
4767
|
+
objectKey = objectKeyList[index];
|
|
4768
|
+
objectValue = object[objectKey];
|
|
4769
|
+
if (state.replacer) {
|
|
4770
|
+
objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
4771
|
+
}
|
|
4772
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
4773
|
+
continue;
|
|
4774
|
+
}
|
|
4775
|
+
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
4776
|
+
if (explicitPair) {
|
|
4777
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
4778
|
+
pairBuffer += "?";
|
|
4779
|
+
} else {
|
|
4780
|
+
pairBuffer += "? ";
|
|
4781
|
+
}
|
|
4782
|
+
}
|
|
4783
|
+
pairBuffer += state.dump;
|
|
4784
|
+
if (explicitPair) {
|
|
4785
|
+
pairBuffer += generateNextLine(state, level);
|
|
4786
|
+
}
|
|
4787
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
4788
|
+
continue;
|
|
4789
|
+
}
|
|
4790
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
4791
|
+
pairBuffer += ":";
|
|
4792
|
+
} else {
|
|
4793
|
+
pairBuffer += ": ";
|
|
4794
|
+
}
|
|
4795
|
+
pairBuffer += state.dump;
|
|
4796
|
+
_result += pairBuffer;
|
|
4797
|
+
}
|
|
4798
|
+
state.tag = _tag;
|
|
4799
|
+
state.dump = _result || "{}";
|
|
4800
|
+
}
|
|
4801
|
+
function detectType(state, object, explicit) {
|
|
4802
|
+
var _result, typeList, index, length, type2, style;
|
|
4803
|
+
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
4804
|
+
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
4805
|
+
type2 = typeList[index];
|
|
4806
|
+
if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
|
|
4807
|
+
if (explicit) {
|
|
4808
|
+
if (type2.multi && type2.representName) {
|
|
4809
|
+
state.tag = type2.representName(object);
|
|
4810
|
+
} else {
|
|
4811
|
+
state.tag = type2.tag;
|
|
4812
|
+
}
|
|
4813
|
+
} else {
|
|
4814
|
+
state.tag = "?";
|
|
4815
|
+
}
|
|
4816
|
+
if (type2.represent) {
|
|
4817
|
+
style = state.styleMap[type2.tag] || type2.defaultStyle;
|
|
4818
|
+
if (_toString.call(type2.represent) === "[object Function]") {
|
|
4819
|
+
_result = type2.represent(object, style);
|
|
4820
|
+
} else if (_hasOwnProperty.call(type2.represent, style)) {
|
|
4821
|
+
_result = type2.represent[style](object, style);
|
|
4822
|
+
} else {
|
|
4823
|
+
throw new exception("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
|
|
4824
|
+
}
|
|
4825
|
+
state.dump = _result;
|
|
4826
|
+
}
|
|
4827
|
+
return true;
|
|
4828
|
+
}
|
|
4829
|
+
}
|
|
4830
|
+
return false;
|
|
4831
|
+
}
|
|
4832
|
+
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
|
|
4833
|
+
state.tag = null;
|
|
4834
|
+
state.dump = object;
|
|
4835
|
+
if (!detectType(state, object, false)) {
|
|
4836
|
+
detectType(state, object, true);
|
|
4837
|
+
}
|
|
4838
|
+
var type2 = _toString.call(state.dump);
|
|
4839
|
+
var inblock = block;
|
|
4840
|
+
var tagStr;
|
|
4841
|
+
if (block) {
|
|
4842
|
+
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
4843
|
+
}
|
|
4844
|
+
var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]", duplicateIndex, duplicate;
|
|
4845
|
+
if (objectOrArray) {
|
|
4846
|
+
duplicateIndex = state.duplicates.indexOf(object);
|
|
4847
|
+
duplicate = duplicateIndex !== -1;
|
|
4848
|
+
}
|
|
4849
|
+
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
4850
|
+
compact = false;
|
|
4851
|
+
}
|
|
4852
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
4853
|
+
state.dump = "*ref_" + duplicateIndex;
|
|
4854
|
+
} else {
|
|
4855
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
4856
|
+
state.usedDuplicates[duplicateIndex] = true;
|
|
4857
|
+
}
|
|
4858
|
+
if (type2 === "[object Object]") {
|
|
4859
|
+
if (block && Object.keys(state.dump).length !== 0) {
|
|
4860
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
4861
|
+
if (duplicate) {
|
|
4862
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
4863
|
+
}
|
|
4864
|
+
} else {
|
|
4865
|
+
writeFlowMapping(state, level, state.dump);
|
|
4866
|
+
if (duplicate) {
|
|
4867
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
4868
|
+
}
|
|
2177
4869
|
}
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
4870
|
+
} else if (type2 === "[object Array]") {
|
|
4871
|
+
if (block && state.dump.length !== 0) {
|
|
4872
|
+
if (state.noArrayIndent && !isblockseq && level > 0) {
|
|
4873
|
+
writeBlockSequence(state, level - 1, state.dump, compact);
|
|
4874
|
+
} else {
|
|
4875
|
+
writeBlockSequence(state, level, state.dump, compact);
|
|
4876
|
+
}
|
|
4877
|
+
if (duplicate) {
|
|
4878
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
4879
|
+
}
|
|
4880
|
+
} else {
|
|
4881
|
+
writeFlowSequence(state, level, state.dump);
|
|
4882
|
+
if (duplicate) {
|
|
4883
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
4884
|
+
}
|
|
2187
4885
|
}
|
|
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;
|
|
4886
|
+
} else if (type2 === "[object String]") {
|
|
4887
|
+
if (state.tag !== "?") {
|
|
4888
|
+
writeScalar(state, state.dump, level, iskey, inblock);
|
|
2197
4889
|
}
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
4890
|
+
} else if (type2 === "[object Undefined]") {
|
|
4891
|
+
return false;
|
|
4892
|
+
} else {
|
|
4893
|
+
if (state.skipInvalid)
|
|
4894
|
+
return false;
|
|
4895
|
+
throw new exception("unacceptable kind of an object to dump " + type2);
|
|
4896
|
+
}
|
|
4897
|
+
if (state.tag !== null && state.tag !== "?") {
|
|
4898
|
+
tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
|
|
4899
|
+
if (state.tag[0] === "!") {
|
|
4900
|
+
tagStr = "!" + tagStr;
|
|
4901
|
+
} else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
|
|
4902
|
+
tagStr = "!!" + tagStr.slice(18);
|
|
4903
|
+
} else {
|
|
4904
|
+
tagStr = "!<" + tagStr + ">";
|
|
2208
4905
|
}
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
4906
|
+
state.dump = tagStr + " " + state.dump;
|
|
4907
|
+
}
|
|
4908
|
+
}
|
|
4909
|
+
return true;
|
|
4910
|
+
}
|
|
4911
|
+
function getDuplicateReferences(object, state) {
|
|
4912
|
+
var objects = [], duplicatesIndexes = [], index, length;
|
|
4913
|
+
inspectNode(object, objects, duplicatesIndexes);
|
|
4914
|
+
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
|
4915
|
+
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
4916
|
+
}
|
|
4917
|
+
state.usedDuplicates = new Array(length);
|
|
4918
|
+
}
|
|
4919
|
+
function inspectNode(object, objects, duplicatesIndexes) {
|
|
4920
|
+
var objectKeyList, index, length;
|
|
4921
|
+
if (object !== null && typeof object === "object") {
|
|
4922
|
+
index = objects.indexOf(object);
|
|
4923
|
+
if (index !== -1) {
|
|
4924
|
+
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
4925
|
+
duplicatesIndexes.push(index);
|
|
2215
4926
|
}
|
|
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;
|
|
4927
|
+
} else {
|
|
4928
|
+
objects.push(object);
|
|
4929
|
+
if (Array.isArray(object)) {
|
|
4930
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
4931
|
+
inspectNode(object[index], objects, duplicatesIndexes);
|
|
2231
4932
|
}
|
|
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;
|
|
4933
|
+
} else {
|
|
4934
|
+
objectKeyList = Object.keys(object);
|
|
4935
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
4936
|
+
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
2244
4937
|
}
|
|
2245
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0)
|
|
2246
|
-
return false;
|
|
2247
4938
|
}
|
|
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;
|
|
4939
|
+
}
|
|
2269
4940
|
}
|
|
2270
|
-
}
|
|
4941
|
+
}
|
|
4942
|
+
function dump$1(input, options) {
|
|
4943
|
+
options = options || {};
|
|
4944
|
+
var state = new State(options);
|
|
4945
|
+
if (!state.noRefs)
|
|
4946
|
+
getDuplicateReferences(input, state);
|
|
4947
|
+
var value = input;
|
|
4948
|
+
if (state.replacer) {
|
|
4949
|
+
value = state.replacer.call({ "": value }, "", value);
|
|
4950
|
+
}
|
|
4951
|
+
if (writeNode(state, 0, value, true, true))
|
|
4952
|
+
return state.dump + "\n";
|
|
4953
|
+
return "";
|
|
4954
|
+
}
|
|
4955
|
+
var dump_1 = dump$1;
|
|
4956
|
+
var dumper = {
|
|
4957
|
+
dump: dump_1
|
|
4958
|
+
};
|
|
4959
|
+
function renamed(from, to) {
|
|
4960
|
+
return function() {
|
|
4961
|
+
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
4962
|
+
};
|
|
4963
|
+
}
|
|
4964
|
+
var Type = type;
|
|
4965
|
+
var Schema = schema;
|
|
4966
|
+
var FAILSAFE_SCHEMA = failsafe;
|
|
4967
|
+
var JSON_SCHEMA = json;
|
|
4968
|
+
var CORE_SCHEMA = core;
|
|
4969
|
+
var DEFAULT_SCHEMA = _default;
|
|
4970
|
+
var load = loader.load;
|
|
4971
|
+
var loadAll = loader.loadAll;
|
|
4972
|
+
var dump = dumper.dump;
|
|
4973
|
+
var YAMLException = exception;
|
|
4974
|
+
var types = {
|
|
4975
|
+
binary,
|
|
4976
|
+
float,
|
|
4977
|
+
map,
|
|
4978
|
+
null: _null,
|
|
4979
|
+
pairs,
|
|
4980
|
+
set,
|
|
4981
|
+
timestamp,
|
|
4982
|
+
bool,
|
|
4983
|
+
int,
|
|
4984
|
+
merge,
|
|
4985
|
+
omap,
|
|
4986
|
+
seq,
|
|
4987
|
+
str
|
|
4988
|
+
};
|
|
4989
|
+
var safeLoad = renamed("safeLoad", "load");
|
|
4990
|
+
var safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
4991
|
+
var safeDump = renamed("safeDump", "dump");
|
|
4992
|
+
var jsYaml = {
|
|
4993
|
+
Type,
|
|
4994
|
+
Schema,
|
|
4995
|
+
FAILSAFE_SCHEMA,
|
|
4996
|
+
JSON_SCHEMA,
|
|
4997
|
+
CORE_SCHEMA,
|
|
4998
|
+
DEFAULT_SCHEMA,
|
|
4999
|
+
load,
|
|
5000
|
+
loadAll,
|
|
5001
|
+
dump,
|
|
5002
|
+
YAMLException,
|
|
5003
|
+
types,
|
|
5004
|
+
safeLoad,
|
|
5005
|
+
safeLoadAll,
|
|
5006
|
+
safeDump
|
|
5007
|
+
};
|
|
5008
|
+
var js_yaml_default = jsYaml;
|
|
2271
5009
|
|
|
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
|
-
};
|
|
5010
|
+
// ../parser/src/core.ts
|
|
5011
|
+
var _utils = require('@antfu/utils');
|
|
5012
|
+
|
|
5013
|
+
// ../parser/src/config.ts
|
|
5014
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
5015
|
+
|
|
5016
|
+
|
|
5017
|
+
// ../parser/src/utils.ts
|
|
5018
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
5019
|
+
|
|
5020
|
+
function parseRangeString(total, rangeStr) {
|
|
5021
|
+
if (!rangeStr || rangeStr === "all" || rangeStr === "*")
|
|
5022
|
+
return _utils.range.call(void 0, 1, total + 1);
|
|
5023
|
+
const pages = [];
|
|
5024
|
+
for (const part of rangeStr.split(/[,;]/g)) {
|
|
5025
|
+
if (!part.includes("-")) {
|
|
5026
|
+
pages.push(+part);
|
|
5027
|
+
} else {
|
|
5028
|
+
const [start, end] = part.split("-", 2);
|
|
5029
|
+
pages.push(..._utils.range.call(void 0, +start, !end ? total + 1 : +end + 1));
|
|
5030
|
+
}
|
|
2323
5031
|
}
|
|
2324
|
-
|
|
5032
|
+
return _utils.uniq.call(void 0, pages).filter((i) => i <= total).sort((a, b) => a - b);
|
|
5033
|
+
}
|
|
5034
|
+
function parseAspectRatio(str2) {
|
|
5035
|
+
if (_utils.isNumber.call(void 0, str2))
|
|
5036
|
+
return str2;
|
|
5037
|
+
if (!isNaN(+str2))
|
|
5038
|
+
return +str2;
|
|
5039
|
+
const [wStr = "", hStr = ""] = str2.split(/[:\/x\|]/);
|
|
5040
|
+
const w = parseFloat(wStr.trim());
|
|
5041
|
+
const h = parseFloat(hStr.trim());
|
|
5042
|
+
if (isNaN(w) || isNaN(h) || h === 0)
|
|
5043
|
+
throw new Error(`Invalid aspect ratio "${str2}"`);
|
|
5044
|
+
return w / h;
|
|
5045
|
+
}
|
|
5046
|
+
|
|
5047
|
+
// ../parser/src/config.ts
|
|
5048
|
+
function resolveConfig(headmatter, themeMeta = {}) {
|
|
5049
|
+
var _a, _b;
|
|
5050
|
+
const themeHightlighter = ["prism", "shiki"].includes(themeMeta.highlighter || "") ? themeMeta.highlighter : void 0;
|
|
5051
|
+
const themeColorSchema = ["light", "dark"].includes(themeMeta.colorSchema || "") ? themeMeta.colorSchema : void 0;
|
|
5052
|
+
const defaultConfig2 = {
|
|
5053
|
+
theme: "default",
|
|
5054
|
+
title: "Slidev",
|
|
5055
|
+
titleTemplate: "%s - Slidev",
|
|
5056
|
+
remoteAssets: false,
|
|
5057
|
+
monaco: "dev",
|
|
5058
|
+
download: false,
|
|
5059
|
+
info: false,
|
|
5060
|
+
highlighter: themeHightlighter || "prism",
|
|
5061
|
+
lineNumbers: false,
|
|
5062
|
+
colorSchema: themeColorSchema || "auto",
|
|
5063
|
+
routerMode: "history",
|
|
5064
|
+
aspectRatio: 16 / 9,
|
|
5065
|
+
canvasWidth: 980,
|
|
5066
|
+
selectable: false,
|
|
5067
|
+
themeConfig: {},
|
|
5068
|
+
fonts: {},
|
|
5069
|
+
favicon: "https://cdn.jsdelivr.net/gh/slidevjs/slidev/assets/favicon.png",
|
|
5070
|
+
drawings: {},
|
|
5071
|
+
plantUmlServer: "https://www.plantuml.com/plantuml"
|
|
5072
|
+
};
|
|
5073
|
+
const config2 = _chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, defaultConfig2), themeMeta.defaults), headmatter.config), headmatter), {
|
|
5074
|
+
fonts: resolveFonts(_chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__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)),
|
|
5075
|
+
drawings: resolveDarwings(headmatter.drawings)
|
|
5076
|
+
});
|
|
5077
|
+
if (config2.colorSchema !== "dark" && config2.colorSchema !== "light")
|
|
5078
|
+
config2.colorSchema = "auto";
|
|
5079
|
+
if (themeColorSchema && config2.colorSchema === "auto")
|
|
5080
|
+
config2.colorSchema = themeColorSchema;
|
|
5081
|
+
config2.aspectRatio = parseAspectRatio(config2.aspectRatio);
|
|
5082
|
+
if (themeColorSchema && config2.colorSchema !== themeColorSchema)
|
|
5083
|
+
console.warn(`[slidev] Color schema "${config2.colorSchema}" does not supported by the theme`);
|
|
5084
|
+
if (themeHightlighter && config2.highlighter !== themeHightlighter)
|
|
5085
|
+
console.warn(`[slidev] Syntax highlighter "${config2.highlighter}" does not supported by the theme`);
|
|
5086
|
+
return config2;
|
|
5087
|
+
}
|
|
5088
|
+
function resolveFonts(fonts = {}) {
|
|
5089
|
+
const {
|
|
5090
|
+
fallbacks = true,
|
|
5091
|
+
italic = false,
|
|
5092
|
+
provider = "google"
|
|
5093
|
+
} = fonts;
|
|
5094
|
+
let sans = _utils.toArray.call(void 0, fonts.sans).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5095
|
+
let serif = _utils.toArray.call(void 0, fonts.serif).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5096
|
+
let mono = _utils.toArray.call(void 0, fonts.mono).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5097
|
+
const weights = _utils.toArray.call(void 0, fonts.weights || "200,400,600").flatMap((i) => i.toString().split(/,\s*/g)).map((i) => i.trim());
|
|
5098
|
+
const custom = _utils.toArray.call(void 0, fonts.custom).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5099
|
+
const local = _utils.toArray.call(void 0, fonts.local).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
|
|
5100
|
+
const webfonts = fonts.webfonts ? fonts.webfonts : fallbacks ? _utils.uniq.call(void 0, [...sans, ...serif, ...mono, ...custom]) : [];
|
|
5101
|
+
webfonts.filter((i) => local.includes(i));
|
|
5102
|
+
function toQuoted(font) {
|
|
5103
|
+
if (/^(['"]).*\1$/.test(font))
|
|
5104
|
+
return font;
|
|
5105
|
+
return `"${font}"`;
|
|
5106
|
+
}
|
|
5107
|
+
if (fallbacks) {
|
|
5108
|
+
sans = _utils.uniq.call(void 0, [
|
|
5109
|
+
...sans.map(toQuoted),
|
|
5110
|
+
"ui-sans-serif",
|
|
5111
|
+
"system-ui",
|
|
5112
|
+
"-apple-system",
|
|
5113
|
+
"BlinkMacSystemFont",
|
|
5114
|
+
'"Segoe UI"',
|
|
5115
|
+
"Roboto",
|
|
5116
|
+
'"Helvetica Neue"',
|
|
5117
|
+
"Arial",
|
|
5118
|
+
'"Noto Sans"',
|
|
5119
|
+
"sans-serif",
|
|
5120
|
+
'"Apple Color Emoji"',
|
|
5121
|
+
'"Segoe UI Emoji"',
|
|
5122
|
+
'"Segoe UI Symbol"',
|
|
5123
|
+
'"Noto Color Emoji"'
|
|
5124
|
+
]);
|
|
5125
|
+
serif = _utils.uniq.call(void 0, [
|
|
5126
|
+
...serif.map(toQuoted),
|
|
5127
|
+
"ui-serif",
|
|
5128
|
+
"Georgia",
|
|
5129
|
+
"Cambria",
|
|
5130
|
+
'"Times New Roman"',
|
|
5131
|
+
"Times",
|
|
5132
|
+
"serif"
|
|
5133
|
+
]);
|
|
5134
|
+
mono = _utils.uniq.call(void 0, [
|
|
5135
|
+
...mono.map(toQuoted),
|
|
5136
|
+
"ui-monospace",
|
|
5137
|
+
"SFMono-Regular",
|
|
5138
|
+
"Menlo",
|
|
5139
|
+
"Monaco",
|
|
5140
|
+
"Consolas",
|
|
5141
|
+
'"Liberation Mono"',
|
|
5142
|
+
'"Courier New"',
|
|
5143
|
+
"monospace"
|
|
5144
|
+
]);
|
|
5145
|
+
}
|
|
5146
|
+
return {
|
|
5147
|
+
sans,
|
|
5148
|
+
serif,
|
|
5149
|
+
mono,
|
|
5150
|
+
webfonts,
|
|
5151
|
+
provider,
|
|
5152
|
+
local,
|
|
5153
|
+
italic,
|
|
5154
|
+
weights
|
|
5155
|
+
};
|
|
5156
|
+
}
|
|
5157
|
+
function resolveDarwings(options = {}) {
|
|
5158
|
+
const {
|
|
5159
|
+
enabled = true,
|
|
5160
|
+
persist = false,
|
|
5161
|
+
presenterOnly = false,
|
|
5162
|
+
syncAll = true
|
|
5163
|
+
} = options;
|
|
5164
|
+
const persistPath = typeof persist === "string" ? persist : persist ? ".slidev/drawings" : false;
|
|
5165
|
+
return {
|
|
5166
|
+
enabled,
|
|
5167
|
+
persist: persistPath,
|
|
5168
|
+
presenterOnly,
|
|
5169
|
+
syncAll
|
|
5170
|
+
};
|
|
5171
|
+
}
|
|
5172
|
+
|
|
5173
|
+
// ../parser/src/core.ts
|
|
5174
|
+
function stringify(data) {
|
|
5175
|
+
return `${data.slides.map((slide, idx) => stringifySlide(slide.inline || slide, idx)).join("\n").trim()}
|
|
5176
|
+
`;
|
|
5177
|
+
}
|
|
5178
|
+
function filterDisabled(data) {
|
|
5179
|
+
data.slides = data.slides.filter((i) => {
|
|
5180
|
+
var _a;
|
|
5181
|
+
return !((_a = i.frontmatter) == null ? void 0 : _a.disabled);
|
|
5182
|
+
});
|
|
5183
|
+
return data;
|
|
5184
|
+
}
|
|
5185
|
+
function stringifySlide(data, idx = 0) {
|
|
5186
|
+
if (data.raw == null)
|
|
5187
|
+
prettifySlide(data);
|
|
5188
|
+
return data.raw.startsWith("---") || idx === 0 ? data.raw : `---
|
|
5189
|
+
${data.raw.startsWith("\n") ? data.raw : `
|
|
5190
|
+
${data.raw}`}`;
|
|
5191
|
+
}
|
|
5192
|
+
function prettifySlide(data) {
|
|
5193
|
+
data.content = `
|
|
5194
|
+
${data.content.trim()}
|
|
5195
|
+
`;
|
|
5196
|
+
data.raw = Object.keys(data.frontmatter || {}).length ? `---
|
|
5197
|
+
${js_yaml_default.dump(data.frontmatter).trim()}
|
|
5198
|
+
---
|
|
5199
|
+
${data.content}` : data.content;
|
|
5200
|
+
if (data.note)
|
|
5201
|
+
data.raw += `
|
|
5202
|
+
<!--
|
|
5203
|
+
${data.note.trim()}
|
|
5204
|
+
-->
|
|
5205
|
+
`;
|
|
5206
|
+
else
|
|
5207
|
+
data.raw += "\n";
|
|
5208
|
+
return data;
|
|
5209
|
+
}
|
|
5210
|
+
function prettify(data) {
|
|
5211
|
+
data.slides.forEach(prettifySlide);
|
|
5212
|
+
return data;
|
|
5213
|
+
}
|
|
5214
|
+
function matter(code) {
|
|
5215
|
+
let data = {};
|
|
5216
|
+
const content = code.replace(/^---.*\r?\n([\s\S]*?)---/, (_, d) => {
|
|
5217
|
+
data = js_yaml_default.load(d);
|
|
5218
|
+
if (!_utils.isObject.call(void 0, data))
|
|
5219
|
+
data = {};
|
|
5220
|
+
return "";
|
|
5221
|
+
});
|
|
5222
|
+
return { data, content };
|
|
5223
|
+
}
|
|
5224
|
+
function detectFeatures(code) {
|
|
5225
|
+
return {
|
|
5226
|
+
katex: !!code.match(/\$.*?\$/) || !!code.match(/$\$\$/),
|
|
5227
|
+
monaco: !!code.match(/{monaco.*}/),
|
|
5228
|
+
tweet: !!code.match(/<Tweet\b/),
|
|
5229
|
+
mermaid: !!code.match(/^```mermaid/m)
|
|
5230
|
+
};
|
|
5231
|
+
}
|
|
5232
|
+
function parseSlide(raw) {
|
|
5233
|
+
var _a, _b;
|
|
5234
|
+
const result = matter(raw);
|
|
5235
|
+
let note;
|
|
5236
|
+
const frontmatter = result.data || {};
|
|
5237
|
+
let content = result.content.trim();
|
|
5238
|
+
const comments = Array.from(content.matchAll(/<!--([\s\S]*?)-->/g));
|
|
5239
|
+
if (comments.length) {
|
|
5240
|
+
const last = comments[comments.length - 1];
|
|
5241
|
+
if (last.index && last.index + last[0].length >= content.length) {
|
|
5242
|
+
note = last[1].trim();
|
|
5243
|
+
content = content.slice(0, last.index).trim();
|
|
5244
|
+
}
|
|
5245
|
+
}
|
|
5246
|
+
let title;
|
|
5247
|
+
let level;
|
|
5248
|
+
if (frontmatter.title || frontmatter.name) {
|
|
5249
|
+
title = frontmatter.title || frontmatter.name;
|
|
5250
|
+
level = frontmatter.level || 1;
|
|
5251
|
+
} else {
|
|
5252
|
+
const match = content.match(/^(#+) (.*)$/m);
|
|
5253
|
+
title = (_a = match == null ? void 0 : match[2]) == null ? void 0 : _a.trim();
|
|
5254
|
+
level = (_b = match == null ? void 0 : match[1]) == null ? void 0 : _b.length;
|
|
5255
|
+
}
|
|
5256
|
+
return {
|
|
5257
|
+
raw,
|
|
5258
|
+
title,
|
|
5259
|
+
level,
|
|
5260
|
+
content,
|
|
5261
|
+
frontmatter,
|
|
5262
|
+
note
|
|
5263
|
+
};
|
|
5264
|
+
}
|
|
5265
|
+
function parse(markdown, filepath, themeMeta) {
|
|
5266
|
+
var _a, _b;
|
|
5267
|
+
const lines = markdown.split(/\r?\n/g);
|
|
5268
|
+
const slides = [];
|
|
5269
|
+
let start = 0;
|
|
5270
|
+
function slice(end) {
|
|
5271
|
+
if (start === end)
|
|
5272
|
+
return;
|
|
5273
|
+
const raw = lines.slice(start, end).join("\n");
|
|
5274
|
+
slides.push(_chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, parseSlide(raw)), {
|
|
5275
|
+
index: slides.length,
|
|
5276
|
+
start,
|
|
5277
|
+
end
|
|
5278
|
+
}));
|
|
5279
|
+
start = end + 1;
|
|
5280
|
+
}
|
|
5281
|
+
for (let i = 0; i < lines.length; i++) {
|
|
5282
|
+
const line = lines[i].trimEnd();
|
|
5283
|
+
if (line.match(/^---+/)) {
|
|
5284
|
+
slice(i);
|
|
5285
|
+
const next = lines[i + 1];
|
|
5286
|
+
if (line.match(/^---([^-].*)?$/) && !(next == null ? void 0 : next.match(/^\s*$/))) {
|
|
5287
|
+
start = i;
|
|
5288
|
+
for (i += 1; i < lines.length; i++) {
|
|
5289
|
+
if (lines[i].trimEnd().match(/^---$/))
|
|
5290
|
+
break;
|
|
5291
|
+
}
|
|
5292
|
+
}
|
|
5293
|
+
} else if (line.startsWith("```")) {
|
|
5294
|
+
for (i += 1; i < lines.length; i++) {
|
|
5295
|
+
if (lines[i].startsWith("```"))
|
|
5296
|
+
break;
|
|
5297
|
+
}
|
|
5298
|
+
}
|
|
5299
|
+
}
|
|
5300
|
+
if (start <= lines.length - 1)
|
|
5301
|
+
slice(lines.length);
|
|
5302
|
+
const headmatter = ((_a = slides[0]) == null ? void 0 : _a.frontmatter) || {};
|
|
5303
|
+
headmatter.title = headmatter.title || ((_b = slides[0]) == null ? void 0 : _b.title);
|
|
5304
|
+
const config2 = resolveConfig(headmatter, themeMeta);
|
|
5305
|
+
const features = detectFeatures(markdown);
|
|
5306
|
+
return {
|
|
5307
|
+
raw: markdown,
|
|
5308
|
+
filepath,
|
|
5309
|
+
slides,
|
|
5310
|
+
config: config2,
|
|
5311
|
+
features,
|
|
5312
|
+
headmatter,
|
|
5313
|
+
themeMeta
|
|
5314
|
+
};
|
|
5315
|
+
}
|
|
5316
|
+
function mergeFeatureFlags(a, b) {
|
|
5317
|
+
return _utils.objectMap.call(void 0, a, (k, v) => [k, v || b[k]]);
|
|
5318
|
+
}
|
|
5319
|
+
function scanMonacoModules(md2) {
|
|
5320
|
+
const typeModules = /* @__PURE__ */ new Set();
|
|
5321
|
+
md2.replace(/^```(\w+?)\s*{monaco([\w:,-]*)}[\s\n]*([\s\S]+?)^```/mg, (full, lang = "ts", options, code) => {
|
|
5322
|
+
options = options || "";
|
|
5323
|
+
lang = lang.trim();
|
|
5324
|
+
if (lang === "ts" || lang === "typescript") {
|
|
5325
|
+
Array.from(code.matchAll(/\s+from\s+(["'])([\/\w@-]+)\1/g)).map((i) => i[2]).filter(_utils.isTruthy).map((i) => typeModules.add(i));
|
|
5326
|
+
}
|
|
5327
|
+
return "";
|
|
5328
|
+
});
|
|
5329
|
+
return Array.from(typeModules);
|
|
5330
|
+
}
|
|
5331
|
+
|
|
5332
|
+
// ../parser/src/fs.ts
|
|
5333
|
+
var md = _markdownit2.default.call(void 0, { html: true });
|
|
5334
|
+
async function load2(filepath, themeMeta, content) {
|
|
5335
|
+
const dir = _path.dirname.call(void 0, filepath);
|
|
5336
|
+
const markdown = content != null ? content : await _fs.promises.readFile(filepath, "utf-8");
|
|
5337
|
+
const data = parse(markdown, filepath, themeMeta);
|
|
5338
|
+
const entries = /* @__PURE__ */ new Set([
|
|
5339
|
+
filepath
|
|
5340
|
+
]);
|
|
5341
|
+
for (const slide of data.slides) {
|
|
5342
|
+
if (slide.title)
|
|
5343
|
+
slide.title = md.render(slide.title).trim().replace(/^<p>/, "").replace(/<\/p>$/, "");
|
|
5344
|
+
if (!slide.frontmatter.src)
|
|
5345
|
+
continue;
|
|
5346
|
+
const path3 = _path.resolve.call(void 0, dir, slide.frontmatter.src);
|
|
5347
|
+
const raw = await _fs.promises.readFile(path3, "utf-8");
|
|
5348
|
+
const source = parseSlide(raw);
|
|
5349
|
+
const inline = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, slide);
|
|
5350
|
+
slide.source = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
5351
|
+
filepath: path3
|
|
5352
|
+
}, source);
|
|
5353
|
+
slide.inline = inline;
|
|
5354
|
+
Object.assign(slide, slide.source);
|
|
5355
|
+
slide.frontmatter = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, slide.source.frontmatter), inline.frontmatter);
|
|
5356
|
+
data.features = mergeFeatureFlags(data.features, detectFeatures(raw));
|
|
5357
|
+
entries.add(path3);
|
|
5358
|
+
}
|
|
5359
|
+
data.entries = Array.from(entries);
|
|
5360
|
+
return data;
|
|
5361
|
+
}
|
|
5362
|
+
async function save(data, filepath) {
|
|
5363
|
+
filepath = filepath || data.filepath;
|
|
5364
|
+
await _fs.promises.writeFile(filepath, stringify(data), "utf-8");
|
|
5365
|
+
}
|
|
5366
|
+
async function saveExternalSlide(slide) {
|
|
5367
|
+
await _fs.promises.writeFile(slide.filepath, stringifySlide(slide), "utf-8");
|
|
5368
|
+
}
|
|
5369
|
+
|
|
5370
|
+
// node/parser.ts
|
|
5371
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
2325
5372
|
|
|
2326
5373
|
// package.json
|
|
2327
|
-
var version = "0.
|
|
5374
|
+
var version = "0.28.3";
|
|
2328
5375
|
|
|
2329
5376
|
// node/themes.ts
|
|
2330
|
-
|
|
5377
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
2331
5378
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
2332
5379
|
|
|
2333
5380
|
// ../../node_modules/.pnpm/@antfu+ni@0.12.0/node_modules/@antfu/ni/dist/index.mjs
|
|
2334
|
-
|
|
5381
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
2335
5382
|
|
|
2336
5383
|
// ../../node_modules/.pnpm/@antfu+ni@0.12.0/node_modules/@antfu/ni/dist/chunk-7FS5ZXAO.mjs
|
|
2337
|
-
|
|
5384
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
2338
5385
|
var _os2 = require('os'); var _os3 = _interopRequireDefault(_os2);
|
|
2339
5386
|
var _child_process = require('child_process');
|
|
2340
|
-
|
|
2341
|
-
|
|
5387
|
+
|
|
5388
|
+
|
|
2342
5389
|
|
|
2343
5390
|
|
|
2344
5391
|
var __create = Object.create;
|
|
@@ -2352,7 +5399,7 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
2352
5399
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2353
5400
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
2354
5401
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2355
|
-
var
|
|
5402
|
+
var __spreadValues2 = (a, b) => {
|
|
2356
5403
|
for (var prop in b || (b = {}))
|
|
2357
5404
|
if (__hasOwnProp.call(b, prop))
|
|
2358
5405
|
__defNormalProp(a, prop, b[prop]);
|
|
@@ -2363,11 +5410,11 @@ var __spreadValues = (a, b) => {
|
|
|
2363
5410
|
}
|
|
2364
5411
|
return a;
|
|
2365
5412
|
};
|
|
2366
|
-
var
|
|
5413
|
+
var __spreadProps2 = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2367
5414
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
2368
5415
|
var __require2 = (x) => {
|
|
2369
|
-
if (typeof
|
|
2370
|
-
return
|
|
5416
|
+
if (typeof _chunkQT3EQ43Ajs.__require !== "undefined")
|
|
5417
|
+
return _chunkQT3EQ43Ajs.__require.call(void 0, x);
|
|
2371
5418
|
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
2372
5419
|
};
|
|
2373
5420
|
var __objRest = (source, exclude2) => {
|
|
@@ -2468,11 +5515,11 @@ var require_mode = __commonJS2({
|
|
|
2468
5515
|
var require_isexe = __commonJS2({
|
|
2469
5516
|
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
2470
5517
|
var fs22 = __require2("fs");
|
|
2471
|
-
var
|
|
5518
|
+
var core2;
|
|
2472
5519
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
2473
|
-
|
|
5520
|
+
core2 = require_windows();
|
|
2474
5521
|
} else {
|
|
2475
|
-
|
|
5522
|
+
core2 = require_mode();
|
|
2476
5523
|
}
|
|
2477
5524
|
module.exports = isexe;
|
|
2478
5525
|
isexe.sync = sync;
|
|
@@ -2495,7 +5542,7 @@ var require_isexe = __commonJS2({
|
|
|
2495
5542
|
});
|
|
2496
5543
|
});
|
|
2497
5544
|
}
|
|
2498
|
-
|
|
5545
|
+
core2(path3, options || {}, function(er, is) {
|
|
2499
5546
|
if (er) {
|
|
2500
5547
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
2501
5548
|
er = null;
|
|
@@ -2507,7 +5554,7 @@ var require_isexe = __commonJS2({
|
|
|
2507
5554
|
}
|
|
2508
5555
|
function sync(path3, options) {
|
|
2509
5556
|
try {
|
|
2510
|
-
return
|
|
5557
|
+
return core2.sync(path3, options || {});
|
|
2511
5558
|
} catch (er) {
|
|
2512
5559
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
2513
5560
|
return false;
|
|
@@ -2643,17 +5690,17 @@ var require_kleur = __commonJS2({
|
|
|
2643
5690
|
bgCyan: init(46, 49),
|
|
2644
5691
|
bgWhite: init(47, 49)
|
|
2645
5692
|
};
|
|
2646
|
-
function run2(arr,
|
|
5693
|
+
function run2(arr, str2) {
|
|
2647
5694
|
let i = 0, tmp, beg = "", end = "";
|
|
2648
5695
|
for (; i < arr.length; i++) {
|
|
2649
5696
|
tmp = arr[i];
|
|
2650
5697
|
beg += tmp.open;
|
|
2651
5698
|
end += tmp.close;
|
|
2652
|
-
if (
|
|
2653
|
-
|
|
5699
|
+
if (str2.includes(tmp.close)) {
|
|
5700
|
+
str2 = str2.replace(tmp.rgx, tmp.close + tmp.open);
|
|
2654
5701
|
}
|
|
2655
5702
|
}
|
|
2656
|
-
return beg +
|
|
5703
|
+
return beg + str2 + end;
|
|
2657
5704
|
}
|
|
2658
5705
|
function chain(has, keys) {
|
|
2659
5706
|
let ctx = { has, keys };
|
|
@@ -2763,10 +5810,10 @@ var require_action = __commonJS2({
|
|
|
2763
5810
|
var require_strip = __commonJS2({
|
|
2764
5811
|
"node_modules/.pnpm/prompts@2.4.1/node_modules/prompts/dist/util/strip.js"(exports, module) {
|
|
2765
5812
|
"use strict";
|
|
2766
|
-
module.exports = (
|
|
5813
|
+
module.exports = (str2) => {
|
|
2767
5814
|
const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");
|
|
2768
5815
|
const RGX = new RegExp(pattern, "g");
|
|
2769
|
-
return typeof
|
|
5816
|
+
return typeof str2 === "string" ? str2.replace(RGX, "") : str2;
|
|
2770
5817
|
};
|
|
2771
5818
|
}
|
|
2772
5819
|
});
|
|
@@ -2895,7 +5942,7 @@ var require_clear = __commonJS2({
|
|
|
2895
5942
|
var _require = require_src();
|
|
2896
5943
|
var erase = _require.erase;
|
|
2897
5944
|
var cursor = _require.cursor;
|
|
2898
|
-
var width = (
|
|
5945
|
+
var width = (str2) => [...strip(str2)].length;
|
|
2899
5946
|
module.exports = function(prompt, perLine) {
|
|
2900
5947
|
if (!perLine)
|
|
2901
5948
|
return erase.line + cursor.to(0);
|
|
@@ -2974,7 +6021,7 @@ var require_style = __commonJS2({
|
|
|
2974
6021
|
render: (input) => `${input}`
|
|
2975
6022
|
}
|
|
2976
6023
|
});
|
|
2977
|
-
var render = (
|
|
6024
|
+
var render = (type2) => styles[type2] || styles.default;
|
|
2978
6025
|
var symbols = Object.freeze({
|
|
2979
6026
|
aborted: c.red(figures.cross),
|
|
2980
6027
|
done: c.green(figures.tick),
|
|
@@ -3079,10 +6126,10 @@ var require_prompt = __commonJS2({
|
|
|
3079
6126
|
if (this.in.isTTY)
|
|
3080
6127
|
this.in.setRawMode(true);
|
|
3081
6128
|
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
3082
|
-
const keypress = (
|
|
6129
|
+
const keypress = (str2, key) => {
|
|
3083
6130
|
let a = action(key, isSelect);
|
|
3084
6131
|
if (a === false) {
|
|
3085
|
-
this._ && this._(
|
|
6132
|
+
this._ && this._(str2, key);
|
|
3086
6133
|
} else if (typeof this[a] === "function") {
|
|
3087
6134
|
this[a](key);
|
|
3088
6135
|
} else {
|
|
@@ -4119,7 +7166,7 @@ var require_number = __commonJS2({
|
|
|
4119
7166
|
var figures = _require2.figures;
|
|
4120
7167
|
var clear = _require2.clear;
|
|
4121
7168
|
var lines = _require2.lines;
|
|
4122
|
-
var
|
|
7169
|
+
var isNumber2 = /[0-9]/;
|
|
4123
7170
|
var isDef = (any) => any !== void 0;
|
|
4124
7171
|
var round = (number, precision) => {
|
|
4125
7172
|
let factor = Math.pow(10, precision);
|
|
@@ -4163,7 +7210,7 @@ var require_number = __commonJS2({
|
|
|
4163
7210
|
return this.float ? parseFloat(x) : parseInt(x);
|
|
4164
7211
|
}
|
|
4165
7212
|
valid(c) {
|
|
4166
|
-
return c === `-` || c === `.` && this.float ||
|
|
7213
|
+
return c === `-` || c === `.` && this.float || isNumber2.test(c);
|
|
4167
7214
|
}
|
|
4168
7215
|
reset() {
|
|
4169
7216
|
this.typed = ``;
|
|
@@ -5054,9 +8101,9 @@ var require_prompts = __commonJS2({
|
|
|
5054
8101
|
var $ = exports;
|
|
5055
8102
|
var el = require_elements();
|
|
5056
8103
|
var noop = (v) => v;
|
|
5057
|
-
function toPrompt(
|
|
8104
|
+
function toPrompt(type2, args, opts = {}) {
|
|
5058
8105
|
return new Promise((res, rej) => {
|
|
5059
|
-
const p = new el[
|
|
8106
|
+
const p = new el[type2](args);
|
|
5060
8107
|
const onAbort = opts.onAbort || noop;
|
|
5061
8108
|
const onSubmit = opts.onSubmit || noop;
|
|
5062
8109
|
const onExit = opts.onExit || noop;
|
|
@@ -5081,7 +8128,7 @@ var require_prompts = __commonJS2({
|
|
|
5081
8128
|
$.list = (args) => {
|
|
5082
8129
|
const sep = args.separator || ",";
|
|
5083
8130
|
return toPrompt("TextPrompt", args, {
|
|
5084
|
-
onSubmit: (
|
|
8131
|
+
onSubmit: (str2) => str2.split(sep).map((s) => s.trim())
|
|
5085
8132
|
});
|
|
5086
8133
|
};
|
|
5087
8134
|
$.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -5253,7 +8300,7 @@ var require_dist = __commonJS2({
|
|
|
5253
8300
|
const answers = {};
|
|
5254
8301
|
const override2 = prompt._override || {};
|
|
5255
8302
|
questions = [].concat(questions);
|
|
5256
|
-
let answer, question, quit, name,
|
|
8303
|
+
let answer, question, quit, name, type2, lastPrompt;
|
|
5257
8304
|
const getFormattedAnswer = /* @__PURE__ */ function() {
|
|
5258
8305
|
var _ref = _asyncToGenerator(function* (question2, answer2, skipValidation = false) {
|
|
5259
8306
|
if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
|
|
@@ -5271,12 +8318,12 @@ var require_dist = __commonJS2({
|
|
|
5271
8318
|
question = _step.value;
|
|
5272
8319
|
var _question = question;
|
|
5273
8320
|
name = _question.name;
|
|
5274
|
-
|
|
5275
|
-
if (typeof
|
|
5276
|
-
|
|
5277
|
-
question["type"] =
|
|
8321
|
+
type2 = _question.type;
|
|
8322
|
+
if (typeof type2 === "function") {
|
|
8323
|
+
type2 = yield type2(answer, _objectSpread({}, answers), question);
|
|
8324
|
+
question["type"] = type2;
|
|
5278
8325
|
}
|
|
5279
|
-
if (!
|
|
8326
|
+
if (!type2)
|
|
5280
8327
|
continue;
|
|
5281
8328
|
for (let key in question) {
|
|
5282
8329
|
if (passOn.includes(key))
|
|
@@ -5290,9 +8337,9 @@ var require_dist = __commonJS2({
|
|
|
5290
8337
|
}
|
|
5291
8338
|
var _question2 = question;
|
|
5292
8339
|
name = _question2.name;
|
|
5293
|
-
|
|
5294
|
-
if (prompts3[
|
|
5295
|
-
throw new Error(`prompt type (${
|
|
8340
|
+
type2 = _question2.type;
|
|
8341
|
+
if (prompts3[type2] === void 0) {
|
|
8342
|
+
throw new Error(`prompt type (${type2}) is not defined`);
|
|
5296
8343
|
}
|
|
5297
8344
|
if (override2[question.name] !== void 0) {
|
|
5298
8345
|
answer = yield getFormattedAnswer(question, override2[question.name]);
|
|
@@ -5302,7 +8349,7 @@ var require_dist = __commonJS2({
|
|
|
5302
8349
|
}
|
|
5303
8350
|
}
|
|
5304
8351
|
try {
|
|
5305
|
-
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts3[
|
|
8352
|
+
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts3[type2](question);
|
|
5306
8353
|
answers[name] = answer = yield getFormattedAnswer(question, answer, true);
|
|
5307
8354
|
quit = yield onSubmit(question, answer, answers);
|
|
5308
8355
|
} catch (err) {
|
|
@@ -5402,13 +8449,13 @@ var require_action2 = __commonJS2({
|
|
|
5402
8449
|
var require_strip2 = __commonJS2({
|
|
5403
8450
|
"node_modules/.pnpm/prompts@2.4.1/node_modules/prompts/lib/util/strip.js"(exports, module) {
|
|
5404
8451
|
"use strict";
|
|
5405
|
-
module.exports = (
|
|
8452
|
+
module.exports = (str2) => {
|
|
5406
8453
|
const pattern = [
|
|
5407
8454
|
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)",
|
|
5408
8455
|
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"
|
|
5409
8456
|
].join("|");
|
|
5410
8457
|
const RGX = new RegExp(pattern, "g");
|
|
5411
|
-
return typeof
|
|
8458
|
+
return typeof str2 === "string" ? str2.replace(RGX, "") : str2;
|
|
5412
8459
|
};
|
|
5413
8460
|
}
|
|
5414
8461
|
});
|
|
@@ -5417,7 +8464,7 @@ var require_clear2 = __commonJS2({
|
|
|
5417
8464
|
"use strict";
|
|
5418
8465
|
var strip = require_strip2();
|
|
5419
8466
|
var { erase, cursor } = require_src();
|
|
5420
|
-
var width = (
|
|
8467
|
+
var width = (str2) => [...strip(str2)].length;
|
|
5421
8468
|
module.exports = function(prompt, perLine) {
|
|
5422
8469
|
if (!perLine)
|
|
5423
8470
|
return erase.line + cursor.to(0);
|
|
@@ -5476,7 +8523,7 @@ var require_style2 = __commonJS2({
|
|
|
5476
8523
|
invisible: { scale: 0, render: (input) => "" },
|
|
5477
8524
|
default: { scale: 1, render: (input) => `${input}` }
|
|
5478
8525
|
});
|
|
5479
|
-
var render = (
|
|
8526
|
+
var render = (type2) => styles[type2] || styles.default;
|
|
5480
8527
|
var symbols = Object.freeze({
|
|
5481
8528
|
aborted: c.red(figures.cross),
|
|
5482
8529
|
done: c.green(figures.tick),
|
|
@@ -5572,10 +8619,10 @@ var require_prompt2 = __commonJS2({
|
|
|
5572
8619
|
if (this.in.isTTY)
|
|
5573
8620
|
this.in.setRawMode(true);
|
|
5574
8621
|
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
5575
|
-
const keypress = (
|
|
8622
|
+
const keypress = (str2, key) => {
|
|
5576
8623
|
let a = action(key, isSelect);
|
|
5577
8624
|
if (a === false) {
|
|
5578
|
-
this._ && this._(
|
|
8625
|
+
this._ && this._(str2, key);
|
|
5579
8626
|
} else if (typeof this[a] === "function") {
|
|
5580
8627
|
this[a](key);
|
|
5581
8628
|
} else {
|
|
@@ -6478,7 +9525,7 @@ var require_number2 = __commonJS2({
|
|
|
6478
9525
|
var Prompt = require_prompt2();
|
|
6479
9526
|
var { cursor, erase } = require_src();
|
|
6480
9527
|
var { style, figures, clear, lines } = require_util2();
|
|
6481
|
-
var
|
|
9528
|
+
var isNumber2 = /[0-9]/;
|
|
6482
9529
|
var isDef = (any) => any !== void 0;
|
|
6483
9530
|
var round = (number, precision) => {
|
|
6484
9531
|
let factor = Math.pow(10, precision);
|
|
@@ -6522,7 +9569,7 @@ var require_number2 = __commonJS2({
|
|
|
6522
9569
|
return this.float ? parseFloat(x) : parseInt(x);
|
|
6523
9570
|
}
|
|
6524
9571
|
valid(c) {
|
|
6525
|
-
return c === `-` || c === `.` && this.float ||
|
|
9572
|
+
return c === `-` || c === `.` && this.float || isNumber2.test(c);
|
|
6526
9573
|
}
|
|
6527
9574
|
reset() {
|
|
6528
9575
|
this.typed = ``;
|
|
@@ -7359,9 +10406,9 @@ var require_prompts2 = __commonJS2({
|
|
|
7359
10406
|
var $ = exports;
|
|
7360
10407
|
var el = require_elements2();
|
|
7361
10408
|
var noop = (v) => v;
|
|
7362
|
-
function toPrompt(
|
|
10409
|
+
function toPrompt(type2, args, opts = {}) {
|
|
7363
10410
|
return new Promise((res, rej) => {
|
|
7364
|
-
const p = new el[
|
|
10411
|
+
const p = new el[type2](args);
|
|
7365
10412
|
const onAbort = opts.onAbort || noop;
|
|
7366
10413
|
const onSubmit = opts.onSubmit || noop;
|
|
7367
10414
|
const onExit = opts.onExit || noop;
|
|
@@ -7386,7 +10433,7 @@ var require_prompts2 = __commonJS2({
|
|
|
7386
10433
|
$.list = (args) => {
|
|
7387
10434
|
const sep = args.separator || ",";
|
|
7388
10435
|
return toPrompt("TextPrompt", args, {
|
|
7389
|
-
onSubmit: (
|
|
10436
|
+
onSubmit: (str2) => str2.split(sep).map((s) => s.trim())
|
|
7390
10437
|
});
|
|
7391
10438
|
};
|
|
7392
10439
|
$.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -7426,7 +10473,7 @@ var require_lib = __commonJS2({
|
|
|
7426
10473
|
const answers = {};
|
|
7427
10474
|
const override2 = prompt._override || {};
|
|
7428
10475
|
questions = [].concat(questions);
|
|
7429
|
-
let answer, question, quit, name,
|
|
10476
|
+
let answer, question, quit, name, type2, lastPrompt;
|
|
7430
10477
|
const getFormattedAnswer = async (question2, answer2, skipValidation = false) => {
|
|
7431
10478
|
if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
|
|
7432
10479
|
return;
|
|
@@ -7434,26 +10481,26 @@ var require_lib = __commonJS2({
|
|
|
7434
10481
|
return question2.format ? await question2.format(answer2, answers) : answer2;
|
|
7435
10482
|
};
|
|
7436
10483
|
for (question of questions) {
|
|
7437
|
-
({ name, type } = question);
|
|
7438
|
-
if (typeof
|
|
7439
|
-
|
|
7440
|
-
question["type"] =
|
|
10484
|
+
({ name, type: type2 } = question);
|
|
10485
|
+
if (typeof type2 === "function") {
|
|
10486
|
+
type2 = await type2(answer, __spreadValues2({}, answers), question);
|
|
10487
|
+
question["type"] = type2;
|
|
7441
10488
|
}
|
|
7442
|
-
if (!
|
|
10489
|
+
if (!type2)
|
|
7443
10490
|
continue;
|
|
7444
10491
|
for (let key in question) {
|
|
7445
10492
|
if (passOn.includes(key))
|
|
7446
10493
|
continue;
|
|
7447
10494
|
let value = question[key];
|
|
7448
|
-
question[key] = typeof value === "function" ? await value(answer,
|
|
10495
|
+
question[key] = typeof value === "function" ? await value(answer, __spreadValues2({}, answers), lastPrompt) : value;
|
|
7449
10496
|
}
|
|
7450
10497
|
lastPrompt = question;
|
|
7451
10498
|
if (typeof question.message !== "string") {
|
|
7452
10499
|
throw new Error("prompt message is required");
|
|
7453
10500
|
}
|
|
7454
|
-
({ name, type } = question);
|
|
7455
|
-
if (prompts3[
|
|
7456
|
-
throw new Error(`prompt type (${
|
|
10501
|
+
({ name, type: type2 } = question);
|
|
10502
|
+
if (prompts3[type2] === void 0) {
|
|
10503
|
+
throw new Error(`prompt type (${type2}) is not defined`);
|
|
7457
10504
|
}
|
|
7458
10505
|
if (override2[question.name] !== void 0) {
|
|
7459
10506
|
answer = await getFormattedAnswer(question, override2[question.name]);
|
|
@@ -7463,7 +10510,7 @@ var require_lib = __commonJS2({
|
|
|
7463
10510
|
}
|
|
7464
10511
|
}
|
|
7465
10512
|
try {
|
|
7466
|
-
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts3[
|
|
10513
|
+
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts3[type2](question);
|
|
7467
10514
|
answers[name] = answer = await getFormattedAnswer(question, answer, true);
|
|
7468
10515
|
quit = await onSubmit(question, answer, answers);
|
|
7469
10516
|
} catch (err) {
|
|
@@ -7549,13 +10596,13 @@ var require_ini = __commonJS2({
|
|
|
7549
10596
|
}
|
|
7550
10597
|
return out;
|
|
7551
10598
|
};
|
|
7552
|
-
var dotSplit = (
|
|
7553
|
-
var decode = (
|
|
10599
|
+
var dotSplit = (str2) => str2.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map((part) => part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, ""));
|
|
10600
|
+
var decode = (str2) => {
|
|
7554
10601
|
const out = Object.create(null);
|
|
7555
10602
|
let p = out;
|
|
7556
10603
|
let section = null;
|
|
7557
10604
|
const re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
|
|
7558
|
-
const lines =
|
|
10605
|
+
const lines = str2.split(/[\r\n]+/g);
|
|
7559
10606
|
for (const line of lines) {
|
|
7560
10607
|
if (!line || line.match(/^\s*[;#]/))
|
|
7561
10608
|
continue;
|
|
@@ -7784,7 +10831,7 @@ var require_p_locate = __commonJS2({
|
|
|
7784
10831
|
return false;
|
|
7785
10832
|
};
|
|
7786
10833
|
var pLocate = async (iterable, tester, options) => {
|
|
7787
|
-
options =
|
|
10834
|
+
options = __spreadValues2({
|
|
7788
10835
|
concurrency: Infinity,
|
|
7789
10836
|
preserveOrder: true
|
|
7790
10837
|
}, options);
|
|
@@ -7816,15 +10863,15 @@ var require_locate_path = __commonJS2({
|
|
|
7816
10863
|
directory: "isDirectory",
|
|
7817
10864
|
file: "isFile"
|
|
7818
10865
|
};
|
|
7819
|
-
function checkType({ type }) {
|
|
7820
|
-
if (
|
|
10866
|
+
function checkType({ type: type2 }) {
|
|
10867
|
+
if (type2 in typeMappings) {
|
|
7821
10868
|
return;
|
|
7822
10869
|
}
|
|
7823
|
-
throw new Error(`Invalid type specified: ${
|
|
10870
|
+
throw new Error(`Invalid type specified: ${type2}`);
|
|
7824
10871
|
}
|
|
7825
|
-
var matchType = (
|
|
10872
|
+
var matchType = (type2, stat) => type2 === void 0 || stat[typeMappings[type2]]();
|
|
7826
10873
|
module.exports = async (paths, options) => {
|
|
7827
|
-
options =
|
|
10874
|
+
options = __spreadValues2({
|
|
7828
10875
|
cwd: process.cwd(),
|
|
7829
10876
|
type: "file",
|
|
7830
10877
|
allowSymlinks: true
|
|
@@ -7841,7 +10888,7 @@ var require_locate_path = __commonJS2({
|
|
|
7841
10888
|
}, options);
|
|
7842
10889
|
};
|
|
7843
10890
|
module.exports.sync = (paths, options) => {
|
|
7844
|
-
options =
|
|
10891
|
+
options = __spreadValues2({
|
|
7845
10892
|
cwd: process.cwd(),
|
|
7846
10893
|
allowSymlinks: true,
|
|
7847
10894
|
type: "file"
|
|
@@ -7906,7 +10953,7 @@ var require_find_up = __commonJS2({
|
|
|
7906
10953
|
return foundPath;
|
|
7907
10954
|
};
|
|
7908
10955
|
while (true) {
|
|
7909
|
-
const foundPath = await runMatcher(
|
|
10956
|
+
const foundPath = await runMatcher(__spreadProps2(__spreadValues2({}, options), { cwd: directory }));
|
|
7910
10957
|
if (foundPath === stop) {
|
|
7911
10958
|
return;
|
|
7912
10959
|
}
|
|
@@ -7934,7 +10981,7 @@ var require_find_up = __commonJS2({
|
|
|
7934
10981
|
return foundPath;
|
|
7935
10982
|
};
|
|
7936
10983
|
while (true) {
|
|
7937
|
-
const foundPath = runMatcher(
|
|
10984
|
+
const foundPath = runMatcher(__spreadProps2(__spreadValues2({}, options), { cwd: directory }));
|
|
7938
10985
|
if (foundPath === stop) {
|
|
7939
10986
|
return;
|
|
7940
10987
|
}
|
|
@@ -8046,11 +11093,11 @@ var require_shebang_command = __commonJS2({
|
|
|
8046
11093
|
return null;
|
|
8047
11094
|
}
|
|
8048
11095
|
const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
8049
|
-
const
|
|
8050
|
-
if (
|
|
11096
|
+
const binary2 = path3.split("/").pop();
|
|
11097
|
+
if (binary2 === "env") {
|
|
8051
11098
|
return argument;
|
|
8052
11099
|
}
|
|
8053
|
-
return argument ? `${
|
|
11100
|
+
return argument ? `${binary2} ${argument}` : binary2;
|
|
8054
11101
|
};
|
|
8055
11102
|
}
|
|
8056
11103
|
});
|
|
@@ -8112,7 +11159,7 @@ var require_parse = __commonJS2({
|
|
|
8112
11159
|
}
|
|
8113
11160
|
return parsed;
|
|
8114
11161
|
}
|
|
8115
|
-
function
|
|
11162
|
+
function parse2(command, args, options) {
|
|
8116
11163
|
if (args && !Array.isArray(args)) {
|
|
8117
11164
|
options = args;
|
|
8118
11165
|
args = null;
|
|
@@ -8131,7 +11178,7 @@ var require_parse = __commonJS2({
|
|
|
8131
11178
|
};
|
|
8132
11179
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
8133
11180
|
}
|
|
8134
|
-
module.exports =
|
|
11181
|
+
module.exports = parse2;
|
|
8135
11182
|
}
|
|
8136
11183
|
});
|
|
8137
11184
|
var require_enoent = __commonJS2({
|
|
@@ -8186,16 +11233,16 @@ var require_cross_spawn = __commonJS2({
|
|
|
8186
11233
|
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports, module) {
|
|
8187
11234
|
"use strict";
|
|
8188
11235
|
var cp = __require2("child_process");
|
|
8189
|
-
var
|
|
11236
|
+
var parse2 = require_parse();
|
|
8190
11237
|
var enoent = require_enoent();
|
|
8191
11238
|
function spawn(command, args, options) {
|
|
8192
|
-
const parsed =
|
|
11239
|
+
const parsed = parse2(command, args, options);
|
|
8193
11240
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
8194
11241
|
enoent.hookChildProcess(spawned, parsed);
|
|
8195
11242
|
return spawned;
|
|
8196
11243
|
}
|
|
8197
11244
|
function spawnSync(command, args, options) {
|
|
8198
|
-
const parsed =
|
|
11245
|
+
const parsed = parse2(command, args, options);
|
|
8199
11246
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
8200
11247
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
8201
11248
|
return result;
|
|
@@ -8203,7 +11250,7 @@ var require_cross_spawn = __commonJS2({
|
|
|
8203
11250
|
module.exports = spawn;
|
|
8204
11251
|
module.exports.spawn = spawn;
|
|
8205
11252
|
module.exports.sync = spawnSync;
|
|
8206
|
-
module.exports._parse =
|
|
11253
|
+
module.exports._parse = parse2;
|
|
8207
11254
|
module.exports._enoent = enoent;
|
|
8208
11255
|
}
|
|
8209
11256
|
});
|
|
@@ -8229,7 +11276,7 @@ var require_npm_run_path = __commonJS2({
|
|
|
8229
11276
|
var path3 = __require2("path");
|
|
8230
11277
|
var pathKey = require_path_key();
|
|
8231
11278
|
var npmRunPath = (options) => {
|
|
8232
|
-
options =
|
|
11279
|
+
options = __spreadValues2({
|
|
8233
11280
|
cwd: process.cwd(),
|
|
8234
11281
|
path: process.env[pathKey()],
|
|
8235
11282
|
execPath: process.execPath
|
|
@@ -8249,10 +11296,10 @@ var require_npm_run_path = __commonJS2({
|
|
|
8249
11296
|
module.exports = npmRunPath;
|
|
8250
11297
|
module.exports.default = npmRunPath;
|
|
8251
11298
|
module.exports.env = (options) => {
|
|
8252
|
-
options =
|
|
11299
|
+
options = __spreadValues2({
|
|
8253
11300
|
env: process.env
|
|
8254
11301
|
}, options);
|
|
8255
|
-
const env =
|
|
11302
|
+
const env = __spreadValues2({}, options.env);
|
|
8256
11303
|
const path4 = pathKey({ env });
|
|
8257
11304
|
options.path = env[path4];
|
|
8258
11305
|
env[path4] = module.exports(options);
|
|
@@ -8656,7 +11703,7 @@ var require_main = __commonJS2({
|
|
|
8656
11703
|
return signals.reduce(getSignalByName, {});
|
|
8657
11704
|
};
|
|
8658
11705
|
var getSignalByName = function(signalByNameMemo, { name, number, description, supported, action, forced, standard }) {
|
|
8659
|
-
return
|
|
11706
|
+
return __spreadProps2(__spreadValues2({}, signalByNameMemo), {
|
|
8660
11707
|
[name]: { name, number, description, supported, action, forced, standard }
|
|
8661
11708
|
});
|
|
8662
11709
|
};
|
|
@@ -8854,7 +11901,7 @@ var require_signal_exit = __commonJS2({
|
|
|
8854
11901
|
module.exports = function(cb, opts) {
|
|
8855
11902
|
assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
|
|
8856
11903
|
if (loaded === false) {
|
|
8857
|
-
|
|
11904
|
+
load3();
|
|
8858
11905
|
}
|
|
8859
11906
|
var ev = "exit";
|
|
8860
11907
|
if (opts && opts.alwaysLast) {
|
|
@@ -8910,9 +11957,9 @@ var require_signal_exit = __commonJS2({
|
|
|
8910
11957
|
module.exports.signals = function() {
|
|
8911
11958
|
return signals;
|
|
8912
11959
|
};
|
|
8913
|
-
module.exports.load =
|
|
11960
|
+
module.exports.load = load3;
|
|
8914
11961
|
var loaded = false;
|
|
8915
|
-
function
|
|
11962
|
+
function load3() {
|
|
8916
11963
|
if (loaded) {
|
|
8917
11964
|
return;
|
|
8918
11965
|
}
|
|
@@ -9056,7 +12103,7 @@ var require_buffer_stream = __commonJS2({
|
|
|
9056
12103
|
"use strict";
|
|
9057
12104
|
var { PassThrough: PassThroughStream } = __require2("stream");
|
|
9058
12105
|
module.exports = (options) => {
|
|
9059
|
-
options =
|
|
12106
|
+
options = __spreadValues2({}, options);
|
|
9060
12107
|
const { array } = options;
|
|
9061
12108
|
let { encoding } = options;
|
|
9062
12109
|
const isBuffer = encoding === "buffer";
|
|
@@ -9112,7 +12159,7 @@ var require_get_stream = __commonJS2({
|
|
|
9112
12159
|
if (!inputStream) {
|
|
9113
12160
|
throw new Error("Expected a stream");
|
|
9114
12161
|
}
|
|
9115
|
-
options =
|
|
12162
|
+
options = __spreadValues2({
|
|
9116
12163
|
maxBuffer: Infinity
|
|
9117
12164
|
}, options);
|
|
9118
12165
|
const { maxBuffer } = options;
|
|
@@ -9141,8 +12188,8 @@ var require_get_stream = __commonJS2({
|
|
|
9141
12188
|
return stream2.getBufferedValue();
|
|
9142
12189
|
}
|
|
9143
12190
|
module.exports = getStream;
|
|
9144
|
-
module.exports.buffer = (stream2, options) => getStream(stream2,
|
|
9145
|
-
module.exports.array = (stream2, options) => getStream(stream2,
|
|
12191
|
+
module.exports.buffer = (stream2, options) => getStream(stream2, __spreadProps2(__spreadValues2({}, options), { encoding: "buffer" }));
|
|
12192
|
+
module.exports.array = (stream2, options) => getStream(stream2, __spreadProps2(__spreadValues2({}, options), { array: true }));
|
|
9146
12193
|
module.exports.MaxBufferError = MaxBufferError;
|
|
9147
12194
|
}
|
|
9148
12195
|
});
|
|
@@ -9273,7 +12320,7 @@ var require_promise = __commonJS2({
|
|
|
9273
12320
|
var mergePromise = (spawned, promise) => {
|
|
9274
12321
|
for (const [property, descriptor] of descriptors) {
|
|
9275
12322
|
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
9276
|
-
Reflect.defineProperty(spawned, property,
|
|
12323
|
+
Reflect.defineProperty(spawned, property, __spreadProps2(__spreadValues2({}, descriptor), { value }));
|
|
9277
12324
|
}
|
|
9278
12325
|
return spawned;
|
|
9279
12326
|
};
|
|
@@ -9358,7 +12405,7 @@ var require_execa = __commonJS2({
|
|
|
9358
12405
|
var { joinCommand, parseCommand, getEscapedCommand } = require_command();
|
|
9359
12406
|
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
9360
12407
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
9361
|
-
const env = extendEnv ?
|
|
12408
|
+
const env = extendEnv ? __spreadValues2(__spreadValues2({}, process.env), envOption) : envOption;
|
|
9362
12409
|
if (preferLocal) {
|
|
9363
12410
|
return npmRunPath.env({ env, cwd: localDir, execPath });
|
|
9364
12411
|
}
|
|
@@ -9369,7 +12416,7 @@ var require_execa = __commonJS2({
|
|
|
9369
12416
|
file = parsed.command;
|
|
9370
12417
|
args = parsed.args;
|
|
9371
12418
|
options = parsed.options;
|
|
9372
|
-
options =
|
|
12419
|
+
options = __spreadValues2({
|
|
9373
12420
|
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
9374
12421
|
buffer: true,
|
|
9375
12422
|
stripFinalNewline: true,
|
|
@@ -9551,7 +12598,7 @@ var require_execa = __commonJS2({
|
|
|
9551
12598
|
...nodeOptions,
|
|
9552
12599
|
scriptPath,
|
|
9553
12600
|
...Array.isArray(args) ? args : []
|
|
9554
|
-
],
|
|
12601
|
+
], __spreadProps2(__spreadValues2({}, options), {
|
|
9555
12602
|
stdin: void 0,
|
|
9556
12603
|
stdout: void 0,
|
|
9557
12604
|
stderr: void 0,
|
|
@@ -10022,7 +13069,7 @@ function terminalLink(text, url, _a = {}) {
|
|
|
10022
13069
|
return ansi_escapes_default.link(text, url);
|
|
10023
13070
|
}
|
|
10024
13071
|
terminalLink.isSupported = import_supports_hyperlinks.default.stdout;
|
|
10025
|
-
terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url,
|
|
13072
|
+
terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, __spreadValues2({ target: "stderr" }, options));
|
|
10026
13073
|
terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
|
|
10027
13074
|
var import_prompts = __toModule2(require_prompts3());
|
|
10028
13075
|
async function detect({ autoInstall, cwd }) {
|
|
@@ -10064,7 +13111,7 @@ async function run(fn, args, options = {}) {
|
|
|
10064
13111
|
if (isGlobal) {
|
|
10065
13112
|
command = await fn(await getGlobalAgent(), args);
|
|
10066
13113
|
} else {
|
|
10067
|
-
let agent = await detect(
|
|
13114
|
+
let agent = await detect(__spreadProps2(__spreadValues2({}, options), { cwd })) || await getDefaultAgent();
|
|
10068
13115
|
if (agent === "prompt") {
|
|
10069
13116
|
agent = (await (0, import_prompts2.default)({
|
|
10070
13117
|
name: "agent",
|
|
@@ -10093,20 +13140,19 @@ async function run(fn, args, options = {}) {
|
|
|
10093
13140
|
}
|
|
10094
13141
|
|
|
10095
13142
|
// node/themes.ts
|
|
10096
|
-
var import_semver =
|
|
13143
|
+
var import_semver = _chunkQT3EQ43Ajs.__toModule.call(void 0, require_semver2());
|
|
10097
13144
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
10098
13145
|
var _kolorist = require('kolorist');
|
|
10099
13146
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
10100
13147
|
|
|
10101
13148
|
// node/options.ts
|
|
10102
|
-
|
|
13149
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
13150
|
+
|
|
10103
13151
|
|
|
10104
|
-
var _utils = require('@antfu/utils');
|
|
10105
|
-
var _fs3 = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs3);
|
|
10106
13152
|
var _debug2 = require('debug'); var _debug3 = _interopRequireDefault(_debug2);
|
|
10107
13153
|
var debug = _debug3.default.call(void 0, "slidev:options");
|
|
10108
13154
|
function getClientRoot() {
|
|
10109
|
-
return _path.dirname.call(void 0,
|
|
13155
|
+
return _path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "@slidev/client/package.json", true));
|
|
10110
13156
|
}
|
|
10111
13157
|
function getCLIRoot() {
|
|
10112
13158
|
return _path.resolve.call(void 0, __dirname, "..");
|
|
@@ -10123,7 +13169,7 @@ function getThemeRoots(name, entry) {
|
|
|
10123
13169
|
];
|
|
10124
13170
|
} else {
|
|
10125
13171
|
return [
|
|
10126
|
-
_path.dirname.call(void 0,
|
|
13172
|
+
_path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, `${name}/package.json`, true))
|
|
10127
13173
|
];
|
|
10128
13174
|
}
|
|
10129
13175
|
}
|
|
@@ -10137,7 +13183,7 @@ async function resolveOptions(options, mode, promptForInstallation = true) {
|
|
|
10137
13183
|
entry,
|
|
10138
13184
|
userRoot
|
|
10139
13185
|
} = getUserRoot(options);
|
|
10140
|
-
const data = await
|
|
13186
|
+
const data = await fs_exports.load(entry);
|
|
10141
13187
|
const theme = resolveThemeName(options.theme || data.config.theme);
|
|
10142
13188
|
if (promptForInstallation) {
|
|
10143
13189
|
if (await promptForThemeInstallation(theme) === false)
|
|
@@ -10156,7 +13202,7 @@ async function resolveOptions(options, mode, promptForInstallation = true) {
|
|
|
10156
13202
|
const themeMeta = await getThemeMeta(theme, _path.join.call(void 0, themeRoots[0], "package.json"));
|
|
10157
13203
|
data.themeMeta = themeMeta;
|
|
10158
13204
|
if (themeMeta)
|
|
10159
|
-
data.config =
|
|
13205
|
+
data.config = fs_exports.resolveConfig(data.headmatter, themeMeta);
|
|
10160
13206
|
}
|
|
10161
13207
|
debug({
|
|
10162
13208
|
config: data.config,
|
|
@@ -10192,7 +13238,7 @@ var officialThemes = {
|
|
|
10192
13238
|
"bricks": "@slidev/theme-bricks"
|
|
10193
13239
|
};
|
|
10194
13240
|
function packageExists(name) {
|
|
10195
|
-
if (
|
|
13241
|
+
if (_chunkQT3EQ43Ajs.resolveImportPath.call(void 0, `${name}/package.json`))
|
|
10196
13242
|
return true;
|
|
10197
13243
|
return false;
|
|
10198
13244
|
}
|
|
@@ -10253,4 +13299,6 @@ async function promptForThemeInstallation(name) {
|
|
|
10253
13299
|
|
|
10254
13300
|
|
|
10255
13301
|
|
|
10256
|
-
|
|
13302
|
+
|
|
13303
|
+
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;
|
|
13304
|
+
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|