peachsim 0.1.2599 → 0.1.2601
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/cli/commands/detect.ts +16 -10
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +11432 -11074
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +11 -2276
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-KSGHEC5L.mjs → acorn-QZ2CUPHM.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-CK4NJNKN.mjs → chunk-36UH63MB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HDVUUMWS.mjs → chunk-3XOVNNLW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IFVAWDHV.mjs → chunk-4DSC65OJ.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-KYAFF2Q6.mjs → chunk-5SWBLCBW.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-JDBFQAWY.mjs → chunk-6YPM2YPR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CQ4RWCRW.mjs → chunk-7NCBX65P.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BWGJ6NXY.mjs → chunk-AJARDL5C.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7AHYPBWO.mjs → chunk-CK3Z4ICA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VQUR3L3X.mjs → chunk-E26HGQSD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WIT6VFZO.mjs → chunk-EWL5AKTY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F5HRYLB4.mjs → chunk-EZ4QHTFM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MPWL7GEG.mjs → chunk-K7OOJRZB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WTHOPBFM.mjs → chunk-N4YUQWGP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-P4IK6BSJ.mjs → chunk-OSRDW3DT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-E2OVC7ZZ.mjs → chunk-PE2YXAKR.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-PC5C5JIJ.mjs → chunk-Q37TTP7V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7WHQG7AP.mjs → chunk-RL5UG2KA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-V6QNDMVW.mjs → chunk-SGLGSFK7.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-35Z53AZY.mjs → chunk-SYLKF7NM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4D3WJ4I7.mjs → chunk-VZZ4446Y.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YJOP3ITO.mjs → chunk-Y4RGOFWV.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-S6JNYU27.mjs → chunk-ZGZPGLDT.mjs} +1024 -653
- package/dist-lib/esm-chunks/{metro-layout-parser-PPZSA2LY.mjs → metro-layout-parser-GIQWWTMJ.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-L7A7TT6Q.mjs → swift-package-prebuilt-XEZH6YEY.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-B63EAEQ5.mjs → swift-sdk-app-module-COF7L4HK.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-QQQA3AAT.mjs → swift-sdk-image-AQCBWHPL.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-QP6XD5O7.mjs → swift-sdk-image-producer-5L5LD4VP.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +12833 -12475
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +12809 -12451
- package/dist-lib/host/fetch-proxy-handler.cjs +5434 -5422
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +10 -2275
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +23 -11
- package/dist-lib/native-app-identity-project.mjs +16 -16
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +82 -81
- package/dist-lib/public-origins-lib.json +372 -435
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +1107 -745
- package/dist-lib/swift-compile.cjs +1029 -652
- package/dist-lib/swift-compile.mjs +10 -10
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/package.json +1 -3
- package/src/device-catalog.ts +4 -5
- package/src/ios-version.ts +8 -0
- package/src/kotlin-version-catalog.ts +6 -4
- package/src/swift-guest-compile.ts +5 -3
- package/src/swift-guest-image-ledger.ts +563 -264
- package/src/swift-guest-link.ts +628 -468
- package/src/wasm-binary-sections.ts +1 -1
- package/dist-lib/vendor/smol-toml.cjs +0 -768
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2601 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -4386,2271 +4386,6 @@ var import_node_child_process4 = require("node:child_process");
|
|
|
4386
4386
|
var import_node_fs14 = require("node:fs");
|
|
4387
4387
|
var import_node_path12 = require("node:path");
|
|
4388
4388
|
|
|
4389
|
-
// ../../node_modules/yaml/browser/dist/nodes/identity.js
|
|
4390
|
-
var ALIAS = Symbol.for("yaml.alias");
|
|
4391
|
-
var DOC = Symbol.for("yaml.document");
|
|
4392
|
-
var MAP = Symbol.for("yaml.map");
|
|
4393
|
-
var PAIR = Symbol.for("yaml.pair");
|
|
4394
|
-
var SCALAR = Symbol.for("yaml.scalar");
|
|
4395
|
-
var SEQ = Symbol.for("yaml.seq");
|
|
4396
|
-
var NODE_TYPE = Symbol.for("yaml.node.type");
|
|
4397
|
-
var isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS;
|
|
4398
|
-
var isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC;
|
|
4399
|
-
var isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP;
|
|
4400
|
-
var isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR;
|
|
4401
|
-
var isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR;
|
|
4402
|
-
var isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ;
|
|
4403
|
-
function isCollection(node) {
|
|
4404
|
-
if (node && typeof node === "object")
|
|
4405
|
-
switch (node[NODE_TYPE]) {
|
|
4406
|
-
case MAP:
|
|
4407
|
-
case SEQ:
|
|
4408
|
-
return true;
|
|
4409
|
-
}
|
|
4410
|
-
return false;
|
|
4411
|
-
}
|
|
4412
|
-
function isNode(node) {
|
|
4413
|
-
if (node && typeof node === "object")
|
|
4414
|
-
switch (node[NODE_TYPE]) {
|
|
4415
|
-
case ALIAS:
|
|
4416
|
-
case MAP:
|
|
4417
|
-
case SCALAR:
|
|
4418
|
-
case SEQ:
|
|
4419
|
-
return true;
|
|
4420
|
-
}
|
|
4421
|
-
return false;
|
|
4422
|
-
}
|
|
4423
|
-
var hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
|
|
4424
|
-
|
|
4425
|
-
// ../../node_modules/yaml/browser/dist/visit.js
|
|
4426
|
-
var BREAK = Symbol("break visit");
|
|
4427
|
-
var SKIP = Symbol("skip children");
|
|
4428
|
-
var REMOVE = Symbol("remove node");
|
|
4429
|
-
function visit(node, visitor) {
|
|
4430
|
-
const visitor_ = initVisitor(visitor);
|
|
4431
|
-
if (isDocument(node)) {
|
|
4432
|
-
const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
|
|
4433
|
-
if (cd === REMOVE)
|
|
4434
|
-
node.contents = null;
|
|
4435
|
-
} else
|
|
4436
|
-
visit_(null, node, visitor_, Object.freeze([]));
|
|
4437
|
-
}
|
|
4438
|
-
visit.BREAK = BREAK;
|
|
4439
|
-
visit.SKIP = SKIP;
|
|
4440
|
-
visit.REMOVE = REMOVE;
|
|
4441
|
-
function visit_(key, node, visitor, path14) {
|
|
4442
|
-
const ctrl = callVisitor(key, node, visitor, path14);
|
|
4443
|
-
if (isNode(ctrl) || isPair(ctrl)) {
|
|
4444
|
-
replaceNode(key, path14, ctrl);
|
|
4445
|
-
return visit_(key, ctrl, visitor, path14);
|
|
4446
|
-
}
|
|
4447
|
-
if (typeof ctrl !== "symbol") {
|
|
4448
|
-
if (isCollection(node)) {
|
|
4449
|
-
path14 = Object.freeze(path14.concat(node));
|
|
4450
|
-
for (let i = 0; i < node.items.length; ++i) {
|
|
4451
|
-
const ci = visit_(i, node.items[i], visitor, path14);
|
|
4452
|
-
if (typeof ci === "number")
|
|
4453
|
-
i = ci - 1;
|
|
4454
|
-
else if (ci === BREAK)
|
|
4455
|
-
return BREAK;
|
|
4456
|
-
else if (ci === REMOVE) {
|
|
4457
|
-
node.items.splice(i, 1);
|
|
4458
|
-
i -= 1;
|
|
4459
|
-
}
|
|
4460
|
-
}
|
|
4461
|
-
} else if (isPair(node)) {
|
|
4462
|
-
path14 = Object.freeze(path14.concat(node));
|
|
4463
|
-
const ck = visit_("key", node.key, visitor, path14);
|
|
4464
|
-
if (ck === BREAK)
|
|
4465
|
-
return BREAK;
|
|
4466
|
-
else if (ck === REMOVE)
|
|
4467
|
-
node.key = null;
|
|
4468
|
-
const cv = visit_("value", node.value, visitor, path14);
|
|
4469
|
-
if (cv === BREAK)
|
|
4470
|
-
return BREAK;
|
|
4471
|
-
else if (cv === REMOVE)
|
|
4472
|
-
node.value = null;
|
|
4473
|
-
}
|
|
4474
|
-
}
|
|
4475
|
-
return ctrl;
|
|
4476
|
-
}
|
|
4477
|
-
async function visitAsync(node, visitor) {
|
|
4478
|
-
const visitor_ = initVisitor(visitor);
|
|
4479
|
-
if (isDocument(node)) {
|
|
4480
|
-
const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
|
|
4481
|
-
if (cd === REMOVE)
|
|
4482
|
-
node.contents = null;
|
|
4483
|
-
} else
|
|
4484
|
-
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
4485
|
-
}
|
|
4486
|
-
visitAsync.BREAK = BREAK;
|
|
4487
|
-
visitAsync.SKIP = SKIP;
|
|
4488
|
-
visitAsync.REMOVE = REMOVE;
|
|
4489
|
-
async function visitAsync_(key, node, visitor, path14) {
|
|
4490
|
-
const ctrl = await callVisitor(key, node, visitor, path14);
|
|
4491
|
-
if (isNode(ctrl) || isPair(ctrl)) {
|
|
4492
|
-
replaceNode(key, path14, ctrl);
|
|
4493
|
-
return visitAsync_(key, ctrl, visitor, path14);
|
|
4494
|
-
}
|
|
4495
|
-
if (typeof ctrl !== "symbol") {
|
|
4496
|
-
if (isCollection(node)) {
|
|
4497
|
-
path14 = Object.freeze(path14.concat(node));
|
|
4498
|
-
for (let i = 0; i < node.items.length; ++i) {
|
|
4499
|
-
const ci = await visitAsync_(i, node.items[i], visitor, path14);
|
|
4500
|
-
if (typeof ci === "number")
|
|
4501
|
-
i = ci - 1;
|
|
4502
|
-
else if (ci === BREAK)
|
|
4503
|
-
return BREAK;
|
|
4504
|
-
else if (ci === REMOVE) {
|
|
4505
|
-
node.items.splice(i, 1);
|
|
4506
|
-
i -= 1;
|
|
4507
|
-
}
|
|
4508
|
-
}
|
|
4509
|
-
} else if (isPair(node)) {
|
|
4510
|
-
path14 = Object.freeze(path14.concat(node));
|
|
4511
|
-
const ck = await visitAsync_("key", node.key, visitor, path14);
|
|
4512
|
-
if (ck === BREAK)
|
|
4513
|
-
return BREAK;
|
|
4514
|
-
else if (ck === REMOVE)
|
|
4515
|
-
node.key = null;
|
|
4516
|
-
const cv = await visitAsync_("value", node.value, visitor, path14);
|
|
4517
|
-
if (cv === BREAK)
|
|
4518
|
-
return BREAK;
|
|
4519
|
-
else if (cv === REMOVE)
|
|
4520
|
-
node.value = null;
|
|
4521
|
-
}
|
|
4522
|
-
}
|
|
4523
|
-
return ctrl;
|
|
4524
|
-
}
|
|
4525
|
-
function initVisitor(visitor) {
|
|
4526
|
-
if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) {
|
|
4527
|
-
return Object.assign({
|
|
4528
|
-
Alias: visitor.Node,
|
|
4529
|
-
Map: visitor.Node,
|
|
4530
|
-
Scalar: visitor.Node,
|
|
4531
|
-
Seq: visitor.Node
|
|
4532
|
-
}, visitor.Value && {
|
|
4533
|
-
Map: visitor.Value,
|
|
4534
|
-
Scalar: visitor.Value,
|
|
4535
|
-
Seq: visitor.Value
|
|
4536
|
-
}, visitor.Collection && {
|
|
4537
|
-
Map: visitor.Collection,
|
|
4538
|
-
Seq: visitor.Collection
|
|
4539
|
-
}, visitor);
|
|
4540
|
-
}
|
|
4541
|
-
return visitor;
|
|
4542
|
-
}
|
|
4543
|
-
function callVisitor(key, node, visitor, path14) {
|
|
4544
|
-
if (typeof visitor === "function")
|
|
4545
|
-
return visitor(key, node, path14);
|
|
4546
|
-
if (isMap(node))
|
|
4547
|
-
return visitor.Map?.(key, node, path14);
|
|
4548
|
-
if (isSeq(node))
|
|
4549
|
-
return visitor.Seq?.(key, node, path14);
|
|
4550
|
-
if (isPair(node))
|
|
4551
|
-
return visitor.Pair?.(key, node, path14);
|
|
4552
|
-
if (isScalar(node))
|
|
4553
|
-
return visitor.Scalar?.(key, node, path14);
|
|
4554
|
-
if (isAlias(node))
|
|
4555
|
-
return visitor.Alias?.(key, node, path14);
|
|
4556
|
-
return void 0;
|
|
4557
|
-
}
|
|
4558
|
-
function replaceNode(key, path14, node) {
|
|
4559
|
-
const parent = path14[path14.length - 1];
|
|
4560
|
-
if (isCollection(parent)) {
|
|
4561
|
-
parent.items[key] = node;
|
|
4562
|
-
} else if (isPair(parent)) {
|
|
4563
|
-
if (key === "key")
|
|
4564
|
-
parent.key = node;
|
|
4565
|
-
else
|
|
4566
|
-
parent.value = node;
|
|
4567
|
-
} else if (isDocument(parent)) {
|
|
4568
|
-
parent.contents = node;
|
|
4569
|
-
} else {
|
|
4570
|
-
const pt = isAlias(parent) ? "alias" : "scalar";
|
|
4571
|
-
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
4572
|
-
}
|
|
4573
|
-
}
|
|
4574
|
-
|
|
4575
|
-
// ../../node_modules/yaml/browser/dist/doc/directives.js
|
|
4576
|
-
var escapeChars = {
|
|
4577
|
-
"!": "%21",
|
|
4578
|
-
",": "%2C",
|
|
4579
|
-
"[": "%5B",
|
|
4580
|
-
"]": "%5D",
|
|
4581
|
-
"{": "%7B",
|
|
4582
|
-
"}": "%7D"
|
|
4583
|
-
};
|
|
4584
|
-
var escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]);
|
|
4585
|
-
var Directives = class _Directives {
|
|
4586
|
-
constructor(yaml, tags) {
|
|
4587
|
-
this.docStart = null;
|
|
4588
|
-
this.docEnd = false;
|
|
4589
|
-
this.yaml = Object.assign({}, _Directives.defaultYaml, yaml);
|
|
4590
|
-
this.tags = Object.assign({}, _Directives.defaultTags, tags);
|
|
4591
|
-
}
|
|
4592
|
-
clone() {
|
|
4593
|
-
const copy = new _Directives(this.yaml, this.tags);
|
|
4594
|
-
copy.docStart = this.docStart;
|
|
4595
|
-
return copy;
|
|
4596
|
-
}
|
|
4597
|
-
/**
|
|
4598
|
-
* During parsing, get a Directives instance for the current document and
|
|
4599
|
-
* update the stream state according to the current version's spec.
|
|
4600
|
-
*/
|
|
4601
|
-
atDocument() {
|
|
4602
|
-
const res = new _Directives(this.yaml, this.tags);
|
|
4603
|
-
switch (this.yaml.version) {
|
|
4604
|
-
case "1.1":
|
|
4605
|
-
this.atNextDocument = true;
|
|
4606
|
-
break;
|
|
4607
|
-
case "1.2":
|
|
4608
|
-
this.atNextDocument = false;
|
|
4609
|
-
this.yaml = {
|
|
4610
|
-
explicit: _Directives.defaultYaml.explicit,
|
|
4611
|
-
version: "1.2"
|
|
4612
|
-
};
|
|
4613
|
-
this.tags = Object.assign({}, _Directives.defaultTags);
|
|
4614
|
-
break;
|
|
4615
|
-
}
|
|
4616
|
-
return res;
|
|
4617
|
-
}
|
|
4618
|
-
/**
|
|
4619
|
-
* @param onError - May be called even if the action was successful
|
|
4620
|
-
* @returns `true` on success
|
|
4621
|
-
*/
|
|
4622
|
-
add(line, onError) {
|
|
4623
|
-
if (this.atNextDocument) {
|
|
4624
|
-
this.yaml = { explicit: _Directives.defaultYaml.explicit, version: "1.1" };
|
|
4625
|
-
this.tags = Object.assign({}, _Directives.defaultTags);
|
|
4626
|
-
this.atNextDocument = false;
|
|
4627
|
-
}
|
|
4628
|
-
const parts = line.trim().split(/[ \t]+/);
|
|
4629
|
-
const name2 = parts.shift();
|
|
4630
|
-
switch (name2) {
|
|
4631
|
-
case "%TAG": {
|
|
4632
|
-
if (parts.length !== 2) {
|
|
4633
|
-
onError(0, "%TAG directive should contain exactly two parts");
|
|
4634
|
-
if (parts.length < 2)
|
|
4635
|
-
return false;
|
|
4636
|
-
}
|
|
4637
|
-
const [handle, prefix] = parts;
|
|
4638
|
-
this.tags[handle] = prefix;
|
|
4639
|
-
return true;
|
|
4640
|
-
}
|
|
4641
|
-
case "%YAML": {
|
|
4642
|
-
this.yaml.explicit = true;
|
|
4643
|
-
if (parts.length !== 1) {
|
|
4644
|
-
onError(0, "%YAML directive should contain exactly one part");
|
|
4645
|
-
return false;
|
|
4646
|
-
}
|
|
4647
|
-
const [version] = parts;
|
|
4648
|
-
if (version === "1.1" || version === "1.2") {
|
|
4649
|
-
this.yaml.version = version;
|
|
4650
|
-
return true;
|
|
4651
|
-
} else {
|
|
4652
|
-
const isValid = /^\d+\.\d+$/.test(version);
|
|
4653
|
-
onError(6, `Unsupported YAML version ${version}`, isValid);
|
|
4654
|
-
return false;
|
|
4655
|
-
}
|
|
4656
|
-
}
|
|
4657
|
-
default:
|
|
4658
|
-
onError(0, `Unknown directive ${name2}`, true);
|
|
4659
|
-
return false;
|
|
4660
|
-
}
|
|
4661
|
-
}
|
|
4662
|
-
/**
|
|
4663
|
-
* Resolves a tag, matching handles to those defined in %TAG directives.
|
|
4664
|
-
*
|
|
4665
|
-
* @returns Resolved tag, which may also be the non-specific tag `'!'` or a
|
|
4666
|
-
* `'!local'` tag, or `null` if unresolvable.
|
|
4667
|
-
*/
|
|
4668
|
-
tagName(source, onError) {
|
|
4669
|
-
if (source === "!")
|
|
4670
|
-
return "!";
|
|
4671
|
-
if (source[0] !== "!") {
|
|
4672
|
-
onError(`Not a valid tag: ${source}`);
|
|
4673
|
-
return null;
|
|
4674
|
-
}
|
|
4675
|
-
if (source[1] === "<") {
|
|
4676
|
-
const verbatim = source.slice(2, -1);
|
|
4677
|
-
if (verbatim === "!" || verbatim === "!!") {
|
|
4678
|
-
onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
|
|
4679
|
-
return null;
|
|
4680
|
-
}
|
|
4681
|
-
if (source[source.length - 1] !== ">")
|
|
4682
|
-
onError("Verbatim tags must end with a >");
|
|
4683
|
-
return verbatim;
|
|
4684
|
-
}
|
|
4685
|
-
const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
|
|
4686
|
-
if (!suffix)
|
|
4687
|
-
onError(`The ${source} tag has no suffix`);
|
|
4688
|
-
const prefix = this.tags[handle];
|
|
4689
|
-
if (prefix) {
|
|
4690
|
-
try {
|
|
4691
|
-
return prefix + decodeURIComponent(suffix);
|
|
4692
|
-
} catch (error) {
|
|
4693
|
-
onError(String(error));
|
|
4694
|
-
return null;
|
|
4695
|
-
}
|
|
4696
|
-
}
|
|
4697
|
-
if (handle === "!")
|
|
4698
|
-
return source;
|
|
4699
|
-
onError(`Could not resolve tag: ${source}`);
|
|
4700
|
-
return null;
|
|
4701
|
-
}
|
|
4702
|
-
/**
|
|
4703
|
-
* Given a fully resolved tag, returns its printable string form,
|
|
4704
|
-
* taking into account current tag prefixes and defaults.
|
|
4705
|
-
*/
|
|
4706
|
-
tagString(tag) {
|
|
4707
|
-
for (const [handle, prefix] of Object.entries(this.tags)) {
|
|
4708
|
-
if (tag.startsWith(prefix))
|
|
4709
|
-
return handle + escapeTagName(tag.substring(prefix.length));
|
|
4710
|
-
}
|
|
4711
|
-
return tag[0] === "!" ? tag : `!<${tag}>`;
|
|
4712
|
-
}
|
|
4713
|
-
toString(doc) {
|
|
4714
|
-
const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
|
|
4715
|
-
const tagEntries = Object.entries(this.tags);
|
|
4716
|
-
let tagNames;
|
|
4717
|
-
if (doc && tagEntries.length > 0 && isNode(doc.contents)) {
|
|
4718
|
-
const tags = {};
|
|
4719
|
-
visit(doc.contents, (_key, node) => {
|
|
4720
|
-
if (isNode(node) && node.tag)
|
|
4721
|
-
tags[node.tag] = true;
|
|
4722
|
-
});
|
|
4723
|
-
tagNames = Object.keys(tags);
|
|
4724
|
-
} else
|
|
4725
|
-
tagNames = [];
|
|
4726
|
-
for (const [handle, prefix] of tagEntries) {
|
|
4727
|
-
if (handle === "!!" && prefix === "tag:yaml.org,2002:")
|
|
4728
|
-
continue;
|
|
4729
|
-
if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))
|
|
4730
|
-
lines.push(`%TAG ${handle} ${prefix}`);
|
|
4731
|
-
}
|
|
4732
|
-
return lines.join("\n");
|
|
4733
|
-
}
|
|
4734
|
-
};
|
|
4735
|
-
Directives.defaultYaml = { explicit: false, version: "1.2" };
|
|
4736
|
-
Directives.defaultTags = { "!!": "tag:yaml.org,2002:" };
|
|
4737
|
-
|
|
4738
|
-
// ../../node_modules/yaml/browser/dist/doc/anchors.js
|
|
4739
|
-
function anchorIsValid(anchor) {
|
|
4740
|
-
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
|
|
4741
|
-
const sa = JSON.stringify(anchor);
|
|
4742
|
-
const msg = `Anchor must not contain whitespace or control characters: ${sa}`;
|
|
4743
|
-
throw new Error(msg);
|
|
4744
|
-
}
|
|
4745
|
-
return true;
|
|
4746
|
-
}
|
|
4747
|
-
|
|
4748
|
-
// ../../node_modules/yaml/browser/dist/doc/applyReviver.js
|
|
4749
|
-
function applyReviver(reviver, obj, key, val) {
|
|
4750
|
-
if (val && typeof val === "object") {
|
|
4751
|
-
if (Array.isArray(val)) {
|
|
4752
|
-
for (let i = 0, len = val.length; i < len; ++i) {
|
|
4753
|
-
const v0 = val[i];
|
|
4754
|
-
const v1 = applyReviver(reviver, val, String(i), v0);
|
|
4755
|
-
if (v1 === void 0)
|
|
4756
|
-
delete val[i];
|
|
4757
|
-
else if (v1 !== v0)
|
|
4758
|
-
val[i] = v1;
|
|
4759
|
-
}
|
|
4760
|
-
} else if (val instanceof Map) {
|
|
4761
|
-
for (const k of Array.from(val.keys())) {
|
|
4762
|
-
const v0 = val.get(k);
|
|
4763
|
-
const v1 = applyReviver(reviver, val, k, v0);
|
|
4764
|
-
if (v1 === void 0)
|
|
4765
|
-
val.delete(k);
|
|
4766
|
-
else if (v1 !== v0)
|
|
4767
|
-
val.set(k, v1);
|
|
4768
|
-
}
|
|
4769
|
-
} else if (val instanceof Set) {
|
|
4770
|
-
for (const v0 of Array.from(val)) {
|
|
4771
|
-
const v1 = applyReviver(reviver, val, v0, v0);
|
|
4772
|
-
if (v1 === void 0)
|
|
4773
|
-
val.delete(v0);
|
|
4774
|
-
else if (v1 !== v0) {
|
|
4775
|
-
val.delete(v0);
|
|
4776
|
-
val.add(v1);
|
|
4777
|
-
}
|
|
4778
|
-
}
|
|
4779
|
-
} else {
|
|
4780
|
-
for (const [k, v0] of Object.entries(val)) {
|
|
4781
|
-
const v1 = applyReviver(reviver, val, k, v0);
|
|
4782
|
-
if (v1 === void 0)
|
|
4783
|
-
delete val[k];
|
|
4784
|
-
else if (v1 !== v0)
|
|
4785
|
-
val[k] = v1;
|
|
4786
|
-
}
|
|
4787
|
-
}
|
|
4788
|
-
}
|
|
4789
|
-
return reviver.call(obj, key, val);
|
|
4790
|
-
}
|
|
4791
|
-
|
|
4792
|
-
// ../../node_modules/yaml/browser/dist/nodes/toJS.js
|
|
4793
|
-
function toJS(value, arg, ctx) {
|
|
4794
|
-
if (Array.isArray(value))
|
|
4795
|
-
return value.map((v, i) => toJS(v, String(i), ctx));
|
|
4796
|
-
if (value && typeof value.toJSON === "function") {
|
|
4797
|
-
if (!ctx || !hasAnchor(value))
|
|
4798
|
-
return value.toJSON(arg, ctx);
|
|
4799
|
-
const data = { aliasCount: 0, count: 1, res: void 0 };
|
|
4800
|
-
ctx.anchors.set(value, data);
|
|
4801
|
-
ctx.onCreate = (res2) => {
|
|
4802
|
-
data.res = res2;
|
|
4803
|
-
delete ctx.onCreate;
|
|
4804
|
-
};
|
|
4805
|
-
const res = value.toJSON(arg, ctx);
|
|
4806
|
-
if (ctx.onCreate)
|
|
4807
|
-
ctx.onCreate(res);
|
|
4808
|
-
return res;
|
|
4809
|
-
}
|
|
4810
|
-
if (typeof value === "bigint" && !ctx?.keep)
|
|
4811
|
-
return Number(value);
|
|
4812
|
-
return value;
|
|
4813
|
-
}
|
|
4814
|
-
|
|
4815
|
-
// ../../node_modules/yaml/browser/dist/nodes/Node.js
|
|
4816
|
-
var NodeBase = class {
|
|
4817
|
-
constructor(type) {
|
|
4818
|
-
Object.defineProperty(this, NODE_TYPE, { value: type });
|
|
4819
|
-
}
|
|
4820
|
-
/** Create a copy of this node. */
|
|
4821
|
-
clone() {
|
|
4822
|
-
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
4823
|
-
if (this.range)
|
|
4824
|
-
copy.range = this.range.slice();
|
|
4825
|
-
return copy;
|
|
4826
|
-
}
|
|
4827
|
-
/** A plain JavaScript representation of this node. */
|
|
4828
|
-
toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
|
4829
|
-
if (!isDocument(doc))
|
|
4830
|
-
throw new TypeError("A document argument is required");
|
|
4831
|
-
const ctx = {
|
|
4832
|
-
anchors: /* @__PURE__ */ new Map(),
|
|
4833
|
-
doc,
|
|
4834
|
-
keep: true,
|
|
4835
|
-
mapAsMap: mapAsMap === true,
|
|
4836
|
-
mapKeyWarned: false,
|
|
4837
|
-
maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
|
|
4838
|
-
};
|
|
4839
|
-
const res = toJS(this, "", ctx);
|
|
4840
|
-
if (typeof onAnchor === "function")
|
|
4841
|
-
for (const { count, res: res2 } of ctx.anchors.values())
|
|
4842
|
-
onAnchor(res2, count);
|
|
4843
|
-
return typeof reviver === "function" ? applyReviver(reviver, { "": res }, "", res) : res;
|
|
4844
|
-
}
|
|
4845
|
-
};
|
|
4846
|
-
|
|
4847
|
-
// ../../node_modules/yaml/browser/dist/nodes/Alias.js
|
|
4848
|
-
var Alias = class extends NodeBase {
|
|
4849
|
-
constructor(source) {
|
|
4850
|
-
super(ALIAS);
|
|
4851
|
-
this.source = source;
|
|
4852
|
-
Object.defineProperty(this, "tag", {
|
|
4853
|
-
set() {
|
|
4854
|
-
throw new Error("Alias nodes cannot have tags");
|
|
4855
|
-
}
|
|
4856
|
-
});
|
|
4857
|
-
}
|
|
4858
|
-
/**
|
|
4859
|
-
* Resolve the value of this alias within `doc`, finding the last
|
|
4860
|
-
* instance of the `source` anchor before this node.
|
|
4861
|
-
*/
|
|
4862
|
-
resolve(doc, ctx) {
|
|
4863
|
-
if (ctx?.maxAliasCount === 0)
|
|
4864
|
-
throw new ReferenceError("Alias resolution is disabled");
|
|
4865
|
-
let nodes;
|
|
4866
|
-
if (ctx?.aliasResolveCache) {
|
|
4867
|
-
nodes = ctx.aliasResolveCache;
|
|
4868
|
-
} else {
|
|
4869
|
-
nodes = [];
|
|
4870
|
-
visit(doc, {
|
|
4871
|
-
Node: (_key, node) => {
|
|
4872
|
-
if (isAlias(node) || hasAnchor(node))
|
|
4873
|
-
nodes.push(node);
|
|
4874
|
-
}
|
|
4875
|
-
});
|
|
4876
|
-
if (ctx)
|
|
4877
|
-
ctx.aliasResolveCache = nodes;
|
|
4878
|
-
}
|
|
4879
|
-
let found = void 0;
|
|
4880
|
-
for (const node of nodes) {
|
|
4881
|
-
if (node === this)
|
|
4882
|
-
break;
|
|
4883
|
-
if (node.anchor === this.source)
|
|
4884
|
-
found = node;
|
|
4885
|
-
}
|
|
4886
|
-
return found;
|
|
4887
|
-
}
|
|
4888
|
-
toJSON(_arg, ctx) {
|
|
4889
|
-
if (!ctx)
|
|
4890
|
-
return { source: this.source };
|
|
4891
|
-
const { anchors, doc, maxAliasCount } = ctx;
|
|
4892
|
-
const source = this.resolve(doc, ctx);
|
|
4893
|
-
if (!source) {
|
|
4894
|
-
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
4895
|
-
throw new ReferenceError(msg);
|
|
4896
|
-
}
|
|
4897
|
-
let data = anchors.get(source);
|
|
4898
|
-
if (!data) {
|
|
4899
|
-
toJS(source, null, ctx);
|
|
4900
|
-
data = anchors.get(source);
|
|
4901
|
-
}
|
|
4902
|
-
if (data?.res === void 0) {
|
|
4903
|
-
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
4904
|
-
throw new ReferenceError(msg);
|
|
4905
|
-
}
|
|
4906
|
-
if (maxAliasCount >= 0) {
|
|
4907
|
-
data.count += 1;
|
|
4908
|
-
if (data.aliasCount === 0)
|
|
4909
|
-
data.aliasCount = getAliasCount(doc, source, anchors);
|
|
4910
|
-
if (data.count * data.aliasCount > maxAliasCount) {
|
|
4911
|
-
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
4912
|
-
throw new ReferenceError(msg);
|
|
4913
|
-
}
|
|
4914
|
-
}
|
|
4915
|
-
return data.res;
|
|
4916
|
-
}
|
|
4917
|
-
toString(ctx, _onComment, _onChompKeep) {
|
|
4918
|
-
const src = `*${this.source}`;
|
|
4919
|
-
if (ctx) {
|
|
4920
|
-
anchorIsValid(this.source);
|
|
4921
|
-
if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
|
|
4922
|
-
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
4923
|
-
throw new Error(msg);
|
|
4924
|
-
}
|
|
4925
|
-
if (ctx.implicitKey)
|
|
4926
|
-
return `${src} `;
|
|
4927
|
-
}
|
|
4928
|
-
return src;
|
|
4929
|
-
}
|
|
4930
|
-
};
|
|
4931
|
-
function getAliasCount(doc, node, anchors) {
|
|
4932
|
-
if (isAlias(node)) {
|
|
4933
|
-
const source = node.resolve(doc);
|
|
4934
|
-
const anchor = anchors && source && anchors.get(source);
|
|
4935
|
-
return anchor ? anchor.count * anchor.aliasCount : 0;
|
|
4936
|
-
} else if (isCollection(node)) {
|
|
4937
|
-
let count = 0;
|
|
4938
|
-
for (const item of node.items) {
|
|
4939
|
-
const c = getAliasCount(doc, item, anchors);
|
|
4940
|
-
if (c > count)
|
|
4941
|
-
count = c;
|
|
4942
|
-
}
|
|
4943
|
-
return count;
|
|
4944
|
-
} else if (isPair(node)) {
|
|
4945
|
-
const kc = getAliasCount(doc, node.key, anchors);
|
|
4946
|
-
const vc = getAliasCount(doc, node.value, anchors);
|
|
4947
|
-
return Math.max(kc, vc);
|
|
4948
|
-
}
|
|
4949
|
-
return 1;
|
|
4950
|
-
}
|
|
4951
|
-
|
|
4952
|
-
// ../../node_modules/yaml/browser/dist/nodes/Scalar.js
|
|
4953
|
-
var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
|
|
4954
|
-
var Scalar = class extends NodeBase {
|
|
4955
|
-
constructor(value) {
|
|
4956
|
-
super(SCALAR);
|
|
4957
|
-
this.value = value;
|
|
4958
|
-
}
|
|
4959
|
-
toJSON(arg, ctx) {
|
|
4960
|
-
return ctx?.keep ? this.value : toJS(this.value, arg, ctx);
|
|
4961
|
-
}
|
|
4962
|
-
toString() {
|
|
4963
|
-
return String(this.value);
|
|
4964
|
-
}
|
|
4965
|
-
};
|
|
4966
|
-
Scalar.BLOCK_FOLDED = "BLOCK_FOLDED";
|
|
4967
|
-
Scalar.BLOCK_LITERAL = "BLOCK_LITERAL";
|
|
4968
|
-
Scalar.PLAIN = "PLAIN";
|
|
4969
|
-
Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE";
|
|
4970
|
-
Scalar.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
4971
|
-
|
|
4972
|
-
// ../../node_modules/yaml/browser/dist/doc/createNode.js
|
|
4973
|
-
var defaultTagPrefix = "tag:yaml.org,2002:";
|
|
4974
|
-
function findTagObject(value, tagName, tags) {
|
|
4975
|
-
if (tagName) {
|
|
4976
|
-
const match = tags.filter((t) => t.tag === tagName);
|
|
4977
|
-
const tagObj = match.find((t) => !t.format) ?? match[0];
|
|
4978
|
-
if (!tagObj)
|
|
4979
|
-
throw new Error(`Tag ${tagName} not found`);
|
|
4980
|
-
return tagObj;
|
|
4981
|
-
}
|
|
4982
|
-
return tags.find((t) => t.identify?.(value) && !t.format);
|
|
4983
|
-
}
|
|
4984
|
-
function createNode(value, tagName, ctx) {
|
|
4985
|
-
if (isDocument(value))
|
|
4986
|
-
value = value.contents;
|
|
4987
|
-
if (isNode(value))
|
|
4988
|
-
return value;
|
|
4989
|
-
if (isPair(value)) {
|
|
4990
|
-
const map2 = ctx.schema[MAP].createNode?.(ctx.schema, null, ctx);
|
|
4991
|
-
map2.items.push(value);
|
|
4992
|
-
return map2;
|
|
4993
|
-
}
|
|
4994
|
-
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
4995
|
-
value = value.valueOf();
|
|
4996
|
-
}
|
|
4997
|
-
const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema4, sourceObjects } = ctx;
|
|
4998
|
-
let ref = void 0;
|
|
4999
|
-
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
5000
|
-
ref = sourceObjects.get(value);
|
|
5001
|
-
if (ref) {
|
|
5002
|
-
ref.anchor ?? (ref.anchor = onAnchor(value));
|
|
5003
|
-
return new Alias(ref.anchor);
|
|
5004
|
-
} else {
|
|
5005
|
-
ref = { anchor: null, node: null };
|
|
5006
|
-
sourceObjects.set(value, ref);
|
|
5007
|
-
}
|
|
5008
|
-
}
|
|
5009
|
-
if (tagName?.startsWith("!!"))
|
|
5010
|
-
tagName = defaultTagPrefix + tagName.slice(2);
|
|
5011
|
-
let tagObj = findTagObject(value, tagName, schema4.tags);
|
|
5012
|
-
if (!tagObj) {
|
|
5013
|
-
if (value && typeof value.toJSON === "function") {
|
|
5014
|
-
value = value.toJSON();
|
|
5015
|
-
}
|
|
5016
|
-
if (!value || typeof value !== "object") {
|
|
5017
|
-
const node2 = new Scalar(value);
|
|
5018
|
-
if (ref)
|
|
5019
|
-
ref.node = node2;
|
|
5020
|
-
return node2;
|
|
5021
|
-
}
|
|
5022
|
-
tagObj = value instanceof Map ? schema4[MAP] : Symbol.iterator in Object(value) ? schema4[SEQ] : schema4[MAP];
|
|
5023
|
-
}
|
|
5024
|
-
if (onTagObj) {
|
|
5025
|
-
onTagObj(tagObj);
|
|
5026
|
-
delete ctx.onTagObj;
|
|
5027
|
-
}
|
|
5028
|
-
const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar(value);
|
|
5029
|
-
if (tagName)
|
|
5030
|
-
node.tag = tagName;
|
|
5031
|
-
else if (!tagObj.default)
|
|
5032
|
-
node.tag = tagObj.tag;
|
|
5033
|
-
if (ref)
|
|
5034
|
-
ref.node = node;
|
|
5035
|
-
return node;
|
|
5036
|
-
}
|
|
5037
|
-
|
|
5038
|
-
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
5039
|
-
function collectionFromPath(schema4, path14, value) {
|
|
5040
|
-
let v = value;
|
|
5041
|
-
for (let i = path14.length - 1; i >= 0; --i) {
|
|
5042
|
-
const k = path14[i];
|
|
5043
|
-
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
5044
|
-
const a = [];
|
|
5045
|
-
a[k] = v;
|
|
5046
|
-
v = a;
|
|
5047
|
-
} else {
|
|
5048
|
-
v = /* @__PURE__ */ new Map([[k, v]]);
|
|
5049
|
-
}
|
|
5050
|
-
}
|
|
5051
|
-
return createNode(v, void 0, {
|
|
5052
|
-
aliasDuplicateObjects: false,
|
|
5053
|
-
keepUndefined: false,
|
|
5054
|
-
onAnchor: () => {
|
|
5055
|
-
throw new Error("This should not happen, please report a bug.");
|
|
5056
|
-
},
|
|
5057
|
-
schema: schema4,
|
|
5058
|
-
sourceObjects: /* @__PURE__ */ new Map()
|
|
5059
|
-
});
|
|
5060
|
-
}
|
|
5061
|
-
var isEmptyPath = (path14) => path14 == null || typeof path14 === "object" && !!path14[Symbol.iterator]().next().done;
|
|
5062
|
-
var Collection = class extends NodeBase {
|
|
5063
|
-
constructor(type, schema4) {
|
|
5064
|
-
super(type);
|
|
5065
|
-
Object.defineProperty(this, "schema", {
|
|
5066
|
-
value: schema4,
|
|
5067
|
-
configurable: true,
|
|
5068
|
-
enumerable: false,
|
|
5069
|
-
writable: true
|
|
5070
|
-
});
|
|
5071
|
-
}
|
|
5072
|
-
/**
|
|
5073
|
-
* Create a copy of this collection.
|
|
5074
|
-
*
|
|
5075
|
-
* @param schema - If defined, overwrites the original's schema
|
|
5076
|
-
*/
|
|
5077
|
-
clone(schema4) {
|
|
5078
|
-
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
5079
|
-
if (schema4)
|
|
5080
|
-
copy.schema = schema4;
|
|
5081
|
-
copy.items = copy.items.map((it) => isNode(it) || isPair(it) ? it.clone(schema4) : it);
|
|
5082
|
-
if (this.range)
|
|
5083
|
-
copy.range = this.range.slice();
|
|
5084
|
-
return copy;
|
|
5085
|
-
}
|
|
5086
|
-
/**
|
|
5087
|
-
* Adds a value to the collection. For `!!map` and `!!omap` the value must
|
|
5088
|
-
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
5089
|
-
* that already exists in the map.
|
|
5090
|
-
*/
|
|
5091
|
-
addIn(path14, value) {
|
|
5092
|
-
if (isEmptyPath(path14))
|
|
5093
|
-
this.add(value);
|
|
5094
|
-
else {
|
|
5095
|
-
const [key, ...rest] = path14;
|
|
5096
|
-
const node = this.get(key, true);
|
|
5097
|
-
if (isCollection(node))
|
|
5098
|
-
node.addIn(rest, value);
|
|
5099
|
-
else if (node === void 0 && this.schema)
|
|
5100
|
-
this.set(key, collectionFromPath(this.schema, rest, value));
|
|
5101
|
-
else
|
|
5102
|
-
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
|
5103
|
-
}
|
|
5104
|
-
}
|
|
5105
|
-
/**
|
|
5106
|
-
* Removes a value from the collection.
|
|
5107
|
-
* @returns `true` if the item was found and removed.
|
|
5108
|
-
*/
|
|
5109
|
-
deleteIn(path14) {
|
|
5110
|
-
const [key, ...rest] = path14;
|
|
5111
|
-
if (rest.length === 0)
|
|
5112
|
-
return this.delete(key);
|
|
5113
|
-
const node = this.get(key, true);
|
|
5114
|
-
if (isCollection(node))
|
|
5115
|
-
return node.deleteIn(rest);
|
|
5116
|
-
else
|
|
5117
|
-
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
|
5118
|
-
}
|
|
5119
|
-
/**
|
|
5120
|
-
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
5121
|
-
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
5122
|
-
* `true` (collections are always returned intact).
|
|
5123
|
-
*/
|
|
5124
|
-
getIn(path14, keepScalar) {
|
|
5125
|
-
const [key, ...rest] = path14;
|
|
5126
|
-
const node = this.get(key, true);
|
|
5127
|
-
if (rest.length === 0)
|
|
5128
|
-
return !keepScalar && isScalar(node) ? node.value : node;
|
|
5129
|
-
else
|
|
5130
|
-
return isCollection(node) ? node.getIn(rest, keepScalar) : void 0;
|
|
5131
|
-
}
|
|
5132
|
-
hasAllNullValues(allowScalar) {
|
|
5133
|
-
return this.items.every((node) => {
|
|
5134
|
-
if (!isPair(node))
|
|
5135
|
-
return false;
|
|
5136
|
-
const n = node.value;
|
|
5137
|
-
return n == null || allowScalar && isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
5138
|
-
});
|
|
5139
|
-
}
|
|
5140
|
-
/**
|
|
5141
|
-
* Checks if the collection includes a value with the key `key`.
|
|
5142
|
-
*/
|
|
5143
|
-
hasIn(path14) {
|
|
5144
|
-
const [key, ...rest] = path14;
|
|
5145
|
-
if (rest.length === 0)
|
|
5146
|
-
return this.has(key);
|
|
5147
|
-
const node = this.get(key, true);
|
|
5148
|
-
return isCollection(node) ? node.hasIn(rest) : false;
|
|
5149
|
-
}
|
|
5150
|
-
/**
|
|
5151
|
-
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
5152
|
-
* boolean to add/remove the item from the set.
|
|
5153
|
-
*/
|
|
5154
|
-
setIn(path14, value) {
|
|
5155
|
-
const [key, ...rest] = path14;
|
|
5156
|
-
if (rest.length === 0) {
|
|
5157
|
-
this.set(key, value);
|
|
5158
|
-
} else {
|
|
5159
|
-
const node = this.get(key, true);
|
|
5160
|
-
if (isCollection(node))
|
|
5161
|
-
node.setIn(rest, value);
|
|
5162
|
-
else if (node === void 0 && this.schema)
|
|
5163
|
-
this.set(key, collectionFromPath(this.schema, rest, value));
|
|
5164
|
-
else
|
|
5165
|
-
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
|
5166
|
-
}
|
|
5167
|
-
}
|
|
5168
|
-
};
|
|
5169
|
-
|
|
5170
|
-
// ../../node_modules/yaml/browser/dist/stringify/stringifyComment.js
|
|
5171
|
-
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
5172
|
-
function indentComment(comment, indent) {
|
|
5173
|
-
if (/^\n+$/.test(comment))
|
|
5174
|
-
return comment.substring(1);
|
|
5175
|
-
return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
|
|
5176
|
-
}
|
|
5177
|
-
var lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment;
|
|
5178
|
-
|
|
5179
|
-
// ../../node_modules/yaml/browser/dist/stringify/foldFlowLines.js
|
|
5180
|
-
var FOLD_FLOW = "flow";
|
|
5181
|
-
var FOLD_BLOCK = "block";
|
|
5182
|
-
var FOLD_QUOTED = "quoted";
|
|
5183
|
-
function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
|
|
5184
|
-
if (!lineWidth || lineWidth < 0)
|
|
5185
|
-
return text;
|
|
5186
|
-
if (lineWidth < minContentWidth)
|
|
5187
|
-
minContentWidth = 0;
|
|
5188
|
-
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
|
|
5189
|
-
if (text.length <= endStep)
|
|
5190
|
-
return text;
|
|
5191
|
-
const folds = [];
|
|
5192
|
-
const escapedFolds = {};
|
|
5193
|
-
let end = lineWidth - indent.length;
|
|
5194
|
-
if (typeof indentAtStart === "number") {
|
|
5195
|
-
if (indentAtStart > lineWidth - Math.max(2, minContentWidth))
|
|
5196
|
-
folds.push(0);
|
|
5197
|
-
else
|
|
5198
|
-
end = lineWidth - indentAtStart;
|
|
5199
|
-
}
|
|
5200
|
-
let split = void 0;
|
|
5201
|
-
let prev = void 0;
|
|
5202
|
-
let overflow = false;
|
|
5203
|
-
let i = -1;
|
|
5204
|
-
let escStart = -1;
|
|
5205
|
-
let escEnd = -1;
|
|
5206
|
-
if (mode === FOLD_BLOCK) {
|
|
5207
|
-
i = consumeMoreIndentedLines(text, i, indent.length);
|
|
5208
|
-
if (i !== -1)
|
|
5209
|
-
end = i + endStep;
|
|
5210
|
-
}
|
|
5211
|
-
for (let ch; ch = text[i += 1]; ) {
|
|
5212
|
-
if (mode === FOLD_QUOTED && ch === "\\") {
|
|
5213
|
-
escStart = i;
|
|
5214
|
-
switch (text[i + 1]) {
|
|
5215
|
-
case "x":
|
|
5216
|
-
i += 3;
|
|
5217
|
-
break;
|
|
5218
|
-
case "u":
|
|
5219
|
-
i += 5;
|
|
5220
|
-
break;
|
|
5221
|
-
case "U":
|
|
5222
|
-
i += 9;
|
|
5223
|
-
break;
|
|
5224
|
-
default:
|
|
5225
|
-
i += 1;
|
|
5226
|
-
}
|
|
5227
|
-
escEnd = i;
|
|
5228
|
-
}
|
|
5229
|
-
if (ch === "\n") {
|
|
5230
|
-
if (mode === FOLD_BLOCK)
|
|
5231
|
-
i = consumeMoreIndentedLines(text, i, indent.length);
|
|
5232
|
-
end = i + indent.length + endStep;
|
|
5233
|
-
split = void 0;
|
|
5234
|
-
} else {
|
|
5235
|
-
if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") {
|
|
5236
|
-
const next = text[i + 1];
|
|
5237
|
-
if (next && next !== " " && next !== "\n" && next !== " ")
|
|
5238
|
-
split = i;
|
|
5239
|
-
}
|
|
5240
|
-
if (i >= end) {
|
|
5241
|
-
if (split) {
|
|
5242
|
-
folds.push(split);
|
|
5243
|
-
end = split + endStep;
|
|
5244
|
-
split = void 0;
|
|
5245
|
-
} else if (mode === FOLD_QUOTED) {
|
|
5246
|
-
while (prev === " " || prev === " ") {
|
|
5247
|
-
prev = ch;
|
|
5248
|
-
ch = text[i += 1];
|
|
5249
|
-
overflow = true;
|
|
5250
|
-
}
|
|
5251
|
-
const j = i > escEnd + 1 ? i - 2 : escStart - 1;
|
|
5252
|
-
if (escapedFolds[j])
|
|
5253
|
-
return text;
|
|
5254
|
-
folds.push(j);
|
|
5255
|
-
escapedFolds[j] = true;
|
|
5256
|
-
end = j + endStep;
|
|
5257
|
-
split = void 0;
|
|
5258
|
-
} else {
|
|
5259
|
-
overflow = true;
|
|
5260
|
-
}
|
|
5261
|
-
}
|
|
5262
|
-
}
|
|
5263
|
-
prev = ch;
|
|
5264
|
-
}
|
|
5265
|
-
if (overflow && onOverflow)
|
|
5266
|
-
onOverflow();
|
|
5267
|
-
if (folds.length === 0)
|
|
5268
|
-
return text;
|
|
5269
|
-
if (onFold)
|
|
5270
|
-
onFold();
|
|
5271
|
-
let res = text.slice(0, folds[0]);
|
|
5272
|
-
for (let i2 = 0; i2 < folds.length; ++i2) {
|
|
5273
|
-
const fold = folds[i2];
|
|
5274
|
-
const end2 = folds[i2 + 1] || text.length;
|
|
5275
|
-
if (fold === 0)
|
|
5276
|
-
res = `
|
|
5277
|
-
${indent}${text.slice(0, end2)}`;
|
|
5278
|
-
else {
|
|
5279
|
-
if (mode === FOLD_QUOTED && escapedFolds[fold])
|
|
5280
|
-
res += `${text[fold]}\\`;
|
|
5281
|
-
res += `
|
|
5282
|
-
${indent}${text.slice(fold + 1, end2)}`;
|
|
5283
|
-
}
|
|
5284
|
-
}
|
|
5285
|
-
return res;
|
|
5286
|
-
}
|
|
5287
|
-
function consumeMoreIndentedLines(text, i, indent) {
|
|
5288
|
-
let end = i;
|
|
5289
|
-
let start = i + 1;
|
|
5290
|
-
let ch = text[start];
|
|
5291
|
-
while (ch === " " || ch === " ") {
|
|
5292
|
-
if (i < start + indent) {
|
|
5293
|
-
ch = text[++i];
|
|
5294
|
-
} else {
|
|
5295
|
-
do {
|
|
5296
|
-
ch = text[++i];
|
|
5297
|
-
} while (ch && ch !== "\n");
|
|
5298
|
-
end = i;
|
|
5299
|
-
start = i + 1;
|
|
5300
|
-
ch = text[start];
|
|
5301
|
-
}
|
|
5302
|
-
}
|
|
5303
|
-
return end;
|
|
5304
|
-
}
|
|
5305
|
-
|
|
5306
|
-
// ../../node_modules/yaml/browser/dist/stringify/stringifyString.js
|
|
5307
|
-
var getFoldOptions = (ctx, isBlock) => ({
|
|
5308
|
-
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
5309
|
-
lineWidth: ctx.options.lineWidth,
|
|
5310
|
-
minContentWidth: ctx.options.minContentWidth
|
|
5311
|
-
});
|
|
5312
|
-
var containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
|
|
5313
|
-
function lineLengthOverLimit(str, lineWidth, indentLength) {
|
|
5314
|
-
if (!lineWidth || lineWidth < 0)
|
|
5315
|
-
return false;
|
|
5316
|
-
const limit = lineWidth - indentLength;
|
|
5317
|
-
const strLen = str.length;
|
|
5318
|
-
if (strLen <= limit)
|
|
5319
|
-
return false;
|
|
5320
|
-
for (let i = 0, start = 0; i < strLen; ++i) {
|
|
5321
|
-
if (str[i] === "\n") {
|
|
5322
|
-
if (i - start > limit)
|
|
5323
|
-
return true;
|
|
5324
|
-
start = i + 1;
|
|
5325
|
-
if (strLen - start <= limit)
|
|
5326
|
-
return false;
|
|
5327
|
-
}
|
|
5328
|
-
}
|
|
5329
|
-
return true;
|
|
5330
|
-
}
|
|
5331
|
-
function doubleQuotedString(value, ctx) {
|
|
5332
|
-
const json = JSON.stringify(value);
|
|
5333
|
-
if (ctx.options.doubleQuotedAsJSON)
|
|
5334
|
-
return json;
|
|
5335
|
-
const { implicitKey } = ctx;
|
|
5336
|
-
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
|
|
5337
|
-
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
|
|
5338
|
-
let str = "";
|
|
5339
|
-
let start = 0;
|
|
5340
|
-
for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
|
|
5341
|
-
if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
|
|
5342
|
-
str += json.slice(start, i) + "\\ ";
|
|
5343
|
-
i += 1;
|
|
5344
|
-
start = i;
|
|
5345
|
-
ch = "\\";
|
|
5346
|
-
}
|
|
5347
|
-
if (ch === "\\")
|
|
5348
|
-
switch (json[i + 1]) {
|
|
5349
|
-
case "u":
|
|
5350
|
-
{
|
|
5351
|
-
str += json.slice(start, i);
|
|
5352
|
-
const code = json.substr(i + 2, 4);
|
|
5353
|
-
switch (code) {
|
|
5354
|
-
case "0000":
|
|
5355
|
-
str += "\\0";
|
|
5356
|
-
break;
|
|
5357
|
-
case "0007":
|
|
5358
|
-
str += "\\a";
|
|
5359
|
-
break;
|
|
5360
|
-
case "000b":
|
|
5361
|
-
str += "\\v";
|
|
5362
|
-
break;
|
|
5363
|
-
case "001b":
|
|
5364
|
-
str += "\\e";
|
|
5365
|
-
break;
|
|
5366
|
-
case "0085":
|
|
5367
|
-
str += "\\N";
|
|
5368
|
-
break;
|
|
5369
|
-
case "00a0":
|
|
5370
|
-
str += "\\_";
|
|
5371
|
-
break;
|
|
5372
|
-
case "2028":
|
|
5373
|
-
str += "\\L";
|
|
5374
|
-
break;
|
|
5375
|
-
case "2029":
|
|
5376
|
-
str += "\\P";
|
|
5377
|
-
break;
|
|
5378
|
-
default:
|
|
5379
|
-
if (code.substr(0, 2) === "00")
|
|
5380
|
-
str += "\\x" + code.substr(2);
|
|
5381
|
-
else
|
|
5382
|
-
str += json.substr(i, 6);
|
|
5383
|
-
}
|
|
5384
|
-
i += 5;
|
|
5385
|
-
start = i + 1;
|
|
5386
|
-
}
|
|
5387
|
-
break;
|
|
5388
|
-
case "n":
|
|
5389
|
-
if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) {
|
|
5390
|
-
i += 1;
|
|
5391
|
-
} else {
|
|
5392
|
-
str += json.slice(start, i) + "\n\n";
|
|
5393
|
-
while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') {
|
|
5394
|
-
str += "\n";
|
|
5395
|
-
i += 2;
|
|
5396
|
-
}
|
|
5397
|
-
str += indent;
|
|
5398
|
-
if (json[i + 2] === " ")
|
|
5399
|
-
str += "\\";
|
|
5400
|
-
i += 1;
|
|
5401
|
-
start = i + 1;
|
|
5402
|
-
}
|
|
5403
|
-
break;
|
|
5404
|
-
default:
|
|
5405
|
-
i += 1;
|
|
5406
|
-
}
|
|
5407
|
-
}
|
|
5408
|
-
str = start ? str + json.slice(start) : json;
|
|
5409
|
-
return implicitKey ? str : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
5410
|
-
}
|
|
5411
|
-
function singleQuotedString(value, ctx) {
|
|
5412
|
-
if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
|
|
5413
|
-
return doubleQuotedString(value, ctx);
|
|
5414
|
-
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
|
|
5415
|
-
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&
|
|
5416
|
-
${indent}`) + "'";
|
|
5417
|
-
return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false));
|
|
5418
|
-
}
|
|
5419
|
-
function quotedString(value, ctx) {
|
|
5420
|
-
const { singleQuote } = ctx.options;
|
|
5421
|
-
let qs;
|
|
5422
|
-
if (singleQuote === false)
|
|
5423
|
-
qs = doubleQuotedString;
|
|
5424
|
-
else {
|
|
5425
|
-
const hasDouble = value.includes('"');
|
|
5426
|
-
const hasSingle = value.includes("'");
|
|
5427
|
-
if (hasDouble && !hasSingle)
|
|
5428
|
-
qs = singleQuotedString;
|
|
5429
|
-
else if (hasSingle && !hasDouble)
|
|
5430
|
-
qs = doubleQuotedString;
|
|
5431
|
-
else
|
|
5432
|
-
qs = singleQuote ? singleQuotedString : doubleQuotedString;
|
|
5433
|
-
}
|
|
5434
|
-
return qs(value, ctx);
|
|
5435
|
-
}
|
|
5436
|
-
var blockEndNewlines;
|
|
5437
|
-
try {
|
|
5438
|
-
blockEndNewlines = new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
|
|
5439
|
-
} catch {
|
|
5440
|
-
blockEndNewlines = /\n+(?!\n|$)/g;
|
|
5441
|
-
}
|
|
5442
|
-
function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
5443
|
-
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
5444
|
-
if (!blockQuote || /\n[\t ]+$/.test(value)) {
|
|
5445
|
-
return quotedString(value, ctx);
|
|
5446
|
-
}
|
|
5447
|
-
const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? " " : "");
|
|
5448
|
-
const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.BLOCK_FOLDED ? false : type === Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
|
|
5449
|
-
if (!value)
|
|
5450
|
-
return literal ? "|\n" : ">\n";
|
|
5451
|
-
let chomp;
|
|
5452
|
-
let endStart;
|
|
5453
|
-
for (endStart = value.length; endStart > 0; --endStart) {
|
|
5454
|
-
const ch = value[endStart - 1];
|
|
5455
|
-
if (ch !== "\n" && ch !== " " && ch !== " ")
|
|
5456
|
-
break;
|
|
5457
|
-
}
|
|
5458
|
-
let end = value.substring(endStart);
|
|
5459
|
-
const endNlPos = end.indexOf("\n");
|
|
5460
|
-
if (endNlPos === -1) {
|
|
5461
|
-
chomp = "-";
|
|
5462
|
-
} else if (value === end || endNlPos !== end.length - 1) {
|
|
5463
|
-
chomp = "+";
|
|
5464
|
-
if (onChompKeep)
|
|
5465
|
-
onChompKeep();
|
|
5466
|
-
} else {
|
|
5467
|
-
chomp = "";
|
|
5468
|
-
}
|
|
5469
|
-
if (end) {
|
|
5470
|
-
value = value.slice(0, -end.length);
|
|
5471
|
-
if (end[end.length - 1] === "\n")
|
|
5472
|
-
end = end.slice(0, -1);
|
|
5473
|
-
end = end.replace(blockEndNewlines, `$&${indent}`);
|
|
5474
|
-
}
|
|
5475
|
-
let startWithSpace = false;
|
|
5476
|
-
let startEnd;
|
|
5477
|
-
let startNlPos = -1;
|
|
5478
|
-
for (startEnd = 0; startEnd < value.length; ++startEnd) {
|
|
5479
|
-
const ch = value[startEnd];
|
|
5480
|
-
if (ch === " ")
|
|
5481
|
-
startWithSpace = true;
|
|
5482
|
-
else if (ch === "\n")
|
|
5483
|
-
startNlPos = startEnd;
|
|
5484
|
-
else
|
|
5485
|
-
break;
|
|
5486
|
-
}
|
|
5487
|
-
let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
|
|
5488
|
-
if (start) {
|
|
5489
|
-
value = value.substring(start.length);
|
|
5490
|
-
start = start.replace(/\n+/g, `$&${indent}`);
|
|
5491
|
-
}
|
|
5492
|
-
const indentSize = indent ? "2" : "1";
|
|
5493
|
-
let header = (startWithSpace ? indentSize : "") + chomp;
|
|
5494
|
-
if (comment) {
|
|
5495
|
-
header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " "));
|
|
5496
|
-
if (onComment)
|
|
5497
|
-
onComment();
|
|
5498
|
-
}
|
|
5499
|
-
if (!literal) {
|
|
5500
|
-
const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
|
|
5501
|
-
let literalFallback = false;
|
|
5502
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
5503
|
-
if (blockQuote !== "folded" && type !== Scalar.BLOCK_FOLDED) {
|
|
5504
|
-
foldOptions.onOverflow = () => {
|
|
5505
|
-
literalFallback = true;
|
|
5506
|
-
};
|
|
5507
|
-
}
|
|
5508
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
5509
|
-
if (!literalFallback)
|
|
5510
|
-
return `>${header}
|
|
5511
|
-
${indent}${body}`;
|
|
5512
|
-
}
|
|
5513
|
-
value = value.replace(/\n+/g, `$&${indent}`);
|
|
5514
|
-
return `|${header}
|
|
5515
|
-
${indent}${start}${value}${end}`;
|
|
5516
|
-
}
|
|
5517
|
-
function plainString(item, ctx, onComment, onChompKeep) {
|
|
5518
|
-
const { type, value } = item;
|
|
5519
|
-
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
|
|
5520
|
-
if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) {
|
|
5521
|
-
return quotedString(value, ctx);
|
|
5522
|
-
}
|
|
5523
|
-
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
5524
|
-
return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
|
|
5525
|
-
}
|
|
5526
|
-
if (!implicitKey && !inFlow && type !== Scalar.PLAIN && value.includes("\n")) {
|
|
5527
|
-
return blockString(item, ctx, onComment, onChompKeep);
|
|
5528
|
-
}
|
|
5529
|
-
if (containsDocumentMarker(value)) {
|
|
5530
|
-
if (indent === "") {
|
|
5531
|
-
ctx.forceBlockIndent = true;
|
|
5532
|
-
return blockString(item, ctx, onComment, onChompKeep);
|
|
5533
|
-
} else if (implicitKey && indent === indentStep) {
|
|
5534
|
-
return quotedString(value, ctx);
|
|
5535
|
-
}
|
|
5536
|
-
}
|
|
5537
|
-
const str = value.replace(/\n+/g, `$&
|
|
5538
|
-
${indent}`);
|
|
5539
|
-
if (actualString) {
|
|
5540
|
-
const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str);
|
|
5541
|
-
const { compat, tags } = ctx.doc.schema;
|
|
5542
|
-
if (tags.some(test) || compat?.some(test))
|
|
5543
|
-
return quotedString(value, ctx);
|
|
5544
|
-
}
|
|
5545
|
-
return implicitKey ? str : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false));
|
|
5546
|
-
}
|
|
5547
|
-
function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
5548
|
-
const { implicitKey, inFlow } = ctx;
|
|
5549
|
-
const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) });
|
|
5550
|
-
let { type } = item;
|
|
5551
|
-
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
5552
|
-
if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
|
|
5553
|
-
type = Scalar.QUOTE_DOUBLE;
|
|
5554
|
-
}
|
|
5555
|
-
const _stringify = (_type) => {
|
|
5556
|
-
switch (_type) {
|
|
5557
|
-
case Scalar.BLOCK_FOLDED:
|
|
5558
|
-
case Scalar.BLOCK_LITERAL:
|
|
5559
|
-
return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
|
|
5560
|
-
case Scalar.QUOTE_DOUBLE:
|
|
5561
|
-
return doubleQuotedString(ss.value, ctx);
|
|
5562
|
-
case Scalar.QUOTE_SINGLE:
|
|
5563
|
-
return singleQuotedString(ss.value, ctx);
|
|
5564
|
-
case Scalar.PLAIN:
|
|
5565
|
-
return plainString(ss, ctx, onComment, onChompKeep);
|
|
5566
|
-
default:
|
|
5567
|
-
return null;
|
|
5568
|
-
}
|
|
5569
|
-
};
|
|
5570
|
-
let res = _stringify(type);
|
|
5571
|
-
if (res === null) {
|
|
5572
|
-
const { defaultKeyType, defaultStringType } = ctx.options;
|
|
5573
|
-
const t = implicitKey && defaultKeyType || defaultStringType;
|
|
5574
|
-
res = _stringify(t);
|
|
5575
|
-
if (res === null)
|
|
5576
|
-
throw new Error(`Unsupported default string type ${t}`);
|
|
5577
|
-
}
|
|
5578
|
-
return res;
|
|
5579
|
-
}
|
|
5580
|
-
|
|
5581
|
-
// ../../node_modules/yaml/browser/dist/stringify/stringify.js
|
|
5582
|
-
function createStringifyContext(doc, options) {
|
|
5583
|
-
const opt = Object.assign({
|
|
5584
|
-
blockQuote: true,
|
|
5585
|
-
commentString: stringifyComment,
|
|
5586
|
-
defaultKeyType: null,
|
|
5587
|
-
defaultStringType: "PLAIN",
|
|
5588
|
-
directives: null,
|
|
5589
|
-
doubleQuotedAsJSON: false,
|
|
5590
|
-
doubleQuotedMinMultiLineLength: 40,
|
|
5591
|
-
falseStr: "false",
|
|
5592
|
-
flowCollectionPadding: true,
|
|
5593
|
-
indentSeq: true,
|
|
5594
|
-
lineWidth: 80,
|
|
5595
|
-
minContentWidth: 20,
|
|
5596
|
-
nullStr: "null",
|
|
5597
|
-
simpleKeys: false,
|
|
5598
|
-
singleQuote: null,
|
|
5599
|
-
trailingComma: false,
|
|
5600
|
-
trueStr: "true",
|
|
5601
|
-
verifyAliasOrder: true
|
|
5602
|
-
}, doc.schema.toStringOptions, options);
|
|
5603
|
-
let inFlow;
|
|
5604
|
-
switch (opt.collectionStyle) {
|
|
5605
|
-
case "block":
|
|
5606
|
-
inFlow = false;
|
|
5607
|
-
break;
|
|
5608
|
-
case "flow":
|
|
5609
|
-
inFlow = true;
|
|
5610
|
-
break;
|
|
5611
|
-
default:
|
|
5612
|
-
inFlow = null;
|
|
5613
|
-
}
|
|
5614
|
-
return {
|
|
5615
|
-
anchors: /* @__PURE__ */ new Set(),
|
|
5616
|
-
doc,
|
|
5617
|
-
flowCollectionPadding: opt.flowCollectionPadding ? " " : "",
|
|
5618
|
-
indent: "",
|
|
5619
|
-
indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : " ",
|
|
5620
|
-
inFlow,
|
|
5621
|
-
options: opt
|
|
5622
|
-
};
|
|
5623
|
-
}
|
|
5624
|
-
function getTagObject(tags, item) {
|
|
5625
|
-
if (item.tag) {
|
|
5626
|
-
const match = tags.filter((t) => t.tag === item.tag);
|
|
5627
|
-
if (match.length > 0)
|
|
5628
|
-
return match.find((t) => t.format === item.format) ?? match[0];
|
|
5629
|
-
}
|
|
5630
|
-
let tagObj = void 0;
|
|
5631
|
-
let obj;
|
|
5632
|
-
if (isScalar(item)) {
|
|
5633
|
-
obj = item.value;
|
|
5634
|
-
let match = tags.filter((t) => t.identify?.(obj));
|
|
5635
|
-
if (match.length > 1) {
|
|
5636
|
-
const testMatch = match.filter((t) => t.test);
|
|
5637
|
-
if (testMatch.length > 0)
|
|
5638
|
-
match = testMatch;
|
|
5639
|
-
}
|
|
5640
|
-
tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format);
|
|
5641
|
-
} else {
|
|
5642
|
-
obj = item;
|
|
5643
|
-
tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass);
|
|
5644
|
-
}
|
|
5645
|
-
if (!tagObj) {
|
|
5646
|
-
const name2 = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
|
|
5647
|
-
throw new Error(`Tag not resolved for ${name2} value`);
|
|
5648
|
-
}
|
|
5649
|
-
return tagObj;
|
|
5650
|
-
}
|
|
5651
|
-
function stringifyProps(node, tagObj, { anchors, doc }) {
|
|
5652
|
-
if (!doc.directives)
|
|
5653
|
-
return "";
|
|
5654
|
-
const props = [];
|
|
5655
|
-
const anchor = (isScalar(node) || isCollection(node)) && node.anchor;
|
|
5656
|
-
if (anchor && anchorIsValid(anchor)) {
|
|
5657
|
-
anchors.add(anchor);
|
|
5658
|
-
props.push(`&${anchor}`);
|
|
5659
|
-
}
|
|
5660
|
-
const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
|
|
5661
|
-
if (tag)
|
|
5662
|
-
props.push(doc.directives.tagString(tag));
|
|
5663
|
-
return props.join(" ");
|
|
5664
|
-
}
|
|
5665
|
-
function stringify(item, ctx, onComment, onChompKeep) {
|
|
5666
|
-
if (isPair(item))
|
|
5667
|
-
return item.toString(ctx, onComment, onChompKeep);
|
|
5668
|
-
if (isAlias(item)) {
|
|
5669
|
-
if (ctx.doc.directives)
|
|
5670
|
-
return item.toString(ctx);
|
|
5671
|
-
if (ctx.resolvedAliases?.has(item)) {
|
|
5672
|
-
throw new TypeError(`Cannot stringify circular structure without alias nodes`);
|
|
5673
|
-
} else {
|
|
5674
|
-
if (ctx.resolvedAliases)
|
|
5675
|
-
ctx.resolvedAliases.add(item);
|
|
5676
|
-
else
|
|
5677
|
-
ctx.resolvedAliases = /* @__PURE__ */ new Set([item]);
|
|
5678
|
-
item = item.resolve(ctx.doc);
|
|
5679
|
-
}
|
|
5680
|
-
}
|
|
5681
|
-
let tagObj = void 0;
|
|
5682
|
-
const node = isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
|
|
5683
|
-
tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
|
|
5684
|
-
const props = stringifyProps(node, tagObj, ctx);
|
|
5685
|
-
if (props.length > 0)
|
|
5686
|
-
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
5687
|
-
const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : isScalar(node) ? stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
|
|
5688
|
-
if (!props)
|
|
5689
|
-
return str;
|
|
5690
|
-
return isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
|
|
5691
|
-
${ctx.indent}${str}`;
|
|
5692
|
-
}
|
|
5693
|
-
|
|
5694
|
-
// ../../node_modules/yaml/browser/dist/stringify/stringifyPair.js
|
|
5695
|
-
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
5696
|
-
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
5697
|
-
let keyComment = isNode(key) && key.comment || null;
|
|
5698
|
-
if (simpleKeys) {
|
|
5699
|
-
if (keyComment) {
|
|
5700
|
-
throw new Error("With simple keys, key nodes cannot have comments");
|
|
5701
|
-
}
|
|
5702
|
-
if (isCollection(key) || !isNode(key) && typeof key === "object") {
|
|
5703
|
-
const msg = "With simple keys, collection cannot be used as a key value";
|
|
5704
|
-
throw new Error(msg);
|
|
5705
|
-
}
|
|
5706
|
-
}
|
|
5707
|
-
let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || isCollection(key) || (isScalar(key) ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL : typeof key === "object"));
|
|
5708
|
-
ctx = Object.assign({}, ctx, {
|
|
5709
|
-
allNullValues: false,
|
|
5710
|
-
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
|
|
5711
|
-
indent: indent + indentStep
|
|
5712
|
-
});
|
|
5713
|
-
let keyCommentDone = false;
|
|
5714
|
-
let chompKeep = false;
|
|
5715
|
-
let str = stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
5716
|
-
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
|
5717
|
-
if (simpleKeys)
|
|
5718
|
-
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
5719
|
-
explicitKey = true;
|
|
5720
|
-
}
|
|
5721
|
-
if (ctx.inFlow) {
|
|
5722
|
-
if (allNullValues || value == null) {
|
|
5723
|
-
if (keyCommentDone && onComment)
|
|
5724
|
-
onComment();
|
|
5725
|
-
return str === "" ? "?" : explicitKey ? `? ${str}` : str;
|
|
5726
|
-
}
|
|
5727
|
-
} else if (allNullValues && !simpleKeys || value == null && explicitKey) {
|
|
5728
|
-
str = `? ${str}`;
|
|
5729
|
-
if (keyComment && !keyCommentDone) {
|
|
5730
|
-
str += lineComment(str, ctx.indent, commentString(keyComment));
|
|
5731
|
-
} else if (chompKeep && onChompKeep)
|
|
5732
|
-
onChompKeep();
|
|
5733
|
-
return str;
|
|
5734
|
-
}
|
|
5735
|
-
if (keyCommentDone)
|
|
5736
|
-
keyComment = null;
|
|
5737
|
-
if (explicitKey) {
|
|
5738
|
-
if (keyComment)
|
|
5739
|
-
str += lineComment(str, ctx.indent, commentString(keyComment));
|
|
5740
|
-
str = `? ${str}
|
|
5741
|
-
${indent}:`;
|
|
5742
|
-
} else {
|
|
5743
|
-
str = `${str}:`;
|
|
5744
|
-
if (keyComment)
|
|
5745
|
-
str += lineComment(str, ctx.indent, commentString(keyComment));
|
|
5746
|
-
}
|
|
5747
|
-
let vsb, vcb, valueComment;
|
|
5748
|
-
if (isNode(value)) {
|
|
5749
|
-
vsb = !!value.spaceBefore;
|
|
5750
|
-
vcb = value.commentBefore;
|
|
5751
|
-
valueComment = value.comment;
|
|
5752
|
-
} else {
|
|
5753
|
-
vsb = false;
|
|
5754
|
-
vcb = null;
|
|
5755
|
-
valueComment = null;
|
|
5756
|
-
if (value && typeof value === "object")
|
|
5757
|
-
value = doc.createNode(value);
|
|
5758
|
-
}
|
|
5759
|
-
ctx.implicitKey = false;
|
|
5760
|
-
if (!explicitKey && !keyComment && isScalar(value))
|
|
5761
|
-
ctx.indentAtStart = str.length + 1;
|
|
5762
|
-
chompKeep = false;
|
|
5763
|
-
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && isSeq(value) && !value.flow && !value.tag && !value.anchor) {
|
|
5764
|
-
ctx.indent = ctx.indent.substring(2);
|
|
5765
|
-
}
|
|
5766
|
-
let valueCommentDone = false;
|
|
5767
|
-
const valueStr = stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
|
|
5768
|
-
let ws = " ";
|
|
5769
|
-
if (keyComment || vsb || vcb) {
|
|
5770
|
-
ws = vsb ? "\n" : "";
|
|
5771
|
-
if (vcb) {
|
|
5772
|
-
const cs = commentString(vcb);
|
|
5773
|
-
ws += `
|
|
5774
|
-
${indentComment(cs, ctx.indent)}`;
|
|
5775
|
-
}
|
|
5776
|
-
if (valueStr === "" && !ctx.inFlow) {
|
|
5777
|
-
if (ws === "\n" && valueComment)
|
|
5778
|
-
ws = "\n\n";
|
|
5779
|
-
} else {
|
|
5780
|
-
ws += `
|
|
5781
|
-
${ctx.indent}`;
|
|
5782
|
-
}
|
|
5783
|
-
} else if (!explicitKey && isCollection(value)) {
|
|
5784
|
-
const vs0 = valueStr[0];
|
|
5785
|
-
const nl0 = valueStr.indexOf("\n");
|
|
5786
|
-
const hasNewline = nl0 !== -1;
|
|
5787
|
-
const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
|
|
5788
|
-
if (hasNewline || !flow) {
|
|
5789
|
-
let hasPropsLine = false;
|
|
5790
|
-
if (hasNewline && (vs0 === "&" || vs0 === "!")) {
|
|
5791
|
-
let sp0 = valueStr.indexOf(" ");
|
|
5792
|
-
if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") {
|
|
5793
|
-
sp0 = valueStr.indexOf(" ", sp0 + 1);
|
|
5794
|
-
}
|
|
5795
|
-
if (sp0 === -1 || nl0 < sp0)
|
|
5796
|
-
hasPropsLine = true;
|
|
5797
|
-
}
|
|
5798
|
-
if (!hasPropsLine)
|
|
5799
|
-
ws = `
|
|
5800
|
-
${ctx.indent}`;
|
|
5801
|
-
}
|
|
5802
|
-
} else if (valueStr === "" || valueStr[0] === "\n") {
|
|
5803
|
-
ws = "";
|
|
5804
|
-
}
|
|
5805
|
-
str += ws + valueStr;
|
|
5806
|
-
if (ctx.inFlow) {
|
|
5807
|
-
if (valueCommentDone && onComment)
|
|
5808
|
-
onComment();
|
|
5809
|
-
} else if (valueComment && !valueCommentDone) {
|
|
5810
|
-
str += lineComment(str, ctx.indent, commentString(valueComment));
|
|
5811
|
-
} else if (chompKeep && onChompKeep) {
|
|
5812
|
-
onChompKeep();
|
|
5813
|
-
}
|
|
5814
|
-
return str;
|
|
5815
|
-
}
|
|
5816
|
-
|
|
5817
|
-
// ../../node_modules/yaml/browser/dist/log.js
|
|
5818
|
-
function warn(logLevel, warning) {
|
|
5819
|
-
if (logLevel === "debug" || logLevel === "warn") {
|
|
5820
|
-
console.warn(warning);
|
|
5821
|
-
}
|
|
5822
|
-
}
|
|
5823
|
-
|
|
5824
|
-
// ../../node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js
|
|
5825
|
-
var MERGE_KEY = "<<";
|
|
5826
|
-
var merge = {
|
|
5827
|
-
identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY,
|
|
5828
|
-
default: "key",
|
|
5829
|
-
tag: "tag:yaml.org,2002:merge",
|
|
5830
|
-
test: /^<<$/,
|
|
5831
|
-
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
5832
|
-
addToJSMap: addMergeToJSMap
|
|
5833
|
-
}),
|
|
5834
|
-
stringify: () => MERGE_KEY
|
|
5835
|
-
};
|
|
5836
|
-
var isMergeKey = (ctx, key) => (merge.identify(key) || isScalar(key) && (!key.type || key.type === Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default);
|
|
5837
|
-
function addMergeToJSMap(ctx, map2, value) {
|
|
5838
|
-
const source = resolveAliasValue(ctx, value);
|
|
5839
|
-
if (isSeq(source))
|
|
5840
|
-
for (const it of source.items)
|
|
5841
|
-
mergeValue(ctx, map2, it);
|
|
5842
|
-
else if (Array.isArray(source))
|
|
5843
|
-
for (const it of source)
|
|
5844
|
-
mergeValue(ctx, map2, it);
|
|
5845
|
-
else
|
|
5846
|
-
mergeValue(ctx, map2, source);
|
|
5847
|
-
}
|
|
5848
|
-
function mergeValue(ctx, map2, value) {
|
|
5849
|
-
const source = resolveAliasValue(ctx, value);
|
|
5850
|
-
if (!isMap(source))
|
|
5851
|
-
throw new Error("Merge sources must be maps or map aliases");
|
|
5852
|
-
const srcMap = source.toJSON(null, ctx, Map);
|
|
5853
|
-
for (const [key, value2] of srcMap) {
|
|
5854
|
-
if (map2 instanceof Map) {
|
|
5855
|
-
if (!map2.has(key))
|
|
5856
|
-
map2.set(key, value2);
|
|
5857
|
-
} else if (map2 instanceof Set) {
|
|
5858
|
-
map2.add(key);
|
|
5859
|
-
} else if (!Object.prototype.hasOwnProperty.call(map2, key)) {
|
|
5860
|
-
Object.defineProperty(map2, key, {
|
|
5861
|
-
value: value2,
|
|
5862
|
-
writable: true,
|
|
5863
|
-
enumerable: true,
|
|
5864
|
-
configurable: true
|
|
5865
|
-
});
|
|
5866
|
-
}
|
|
5867
|
-
}
|
|
5868
|
-
return map2;
|
|
5869
|
-
}
|
|
5870
|
-
function resolveAliasValue(ctx, value) {
|
|
5871
|
-
return ctx && isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
|
|
5872
|
-
}
|
|
5873
|
-
|
|
5874
|
-
// ../../node_modules/yaml/browser/dist/nodes/addPairToJSMap.js
|
|
5875
|
-
function addPairToJSMap(ctx, map2, { key, value }) {
|
|
5876
|
-
if (isNode(key) && key.addToJSMap)
|
|
5877
|
-
key.addToJSMap(ctx, map2, value);
|
|
5878
|
-
else if (isMergeKey(ctx, key))
|
|
5879
|
-
addMergeToJSMap(ctx, map2, value);
|
|
5880
|
-
else {
|
|
5881
|
-
const jsKey = toJS(key, "", ctx);
|
|
5882
|
-
if (map2 instanceof Map) {
|
|
5883
|
-
map2.set(jsKey, toJS(value, jsKey, ctx));
|
|
5884
|
-
} else if (map2 instanceof Set) {
|
|
5885
|
-
map2.add(jsKey);
|
|
5886
|
-
} else {
|
|
5887
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
5888
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
5889
|
-
if (stringKey in map2)
|
|
5890
|
-
Object.defineProperty(map2, stringKey, {
|
|
5891
|
-
value: jsValue,
|
|
5892
|
-
writable: true,
|
|
5893
|
-
enumerable: true,
|
|
5894
|
-
configurable: true
|
|
5895
|
-
});
|
|
5896
|
-
else
|
|
5897
|
-
map2[stringKey] = jsValue;
|
|
5898
|
-
}
|
|
5899
|
-
}
|
|
5900
|
-
return map2;
|
|
5901
|
-
}
|
|
5902
|
-
function stringifyKey(key, jsKey, ctx) {
|
|
5903
|
-
if (jsKey === null)
|
|
5904
|
-
return "";
|
|
5905
|
-
if (typeof jsKey !== "object")
|
|
5906
|
-
return String(jsKey);
|
|
5907
|
-
if (isNode(key) && ctx?.doc) {
|
|
5908
|
-
const strCtx = createStringifyContext(ctx.doc, {});
|
|
5909
|
-
strCtx.anchors = /* @__PURE__ */ new Set();
|
|
5910
|
-
for (const node of ctx.anchors.keys())
|
|
5911
|
-
strCtx.anchors.add(node.anchor);
|
|
5912
|
-
strCtx.inFlow = true;
|
|
5913
|
-
strCtx.inStringifyKey = true;
|
|
5914
|
-
const strKey = key.toString(strCtx);
|
|
5915
|
-
if (!ctx.mapKeyWarned) {
|
|
5916
|
-
let jsonStr = JSON.stringify(strKey);
|
|
5917
|
-
if (jsonStr.length > 40)
|
|
5918
|
-
jsonStr = jsonStr.substring(0, 36) + '..."';
|
|
5919
|
-
warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
|
|
5920
|
-
ctx.mapKeyWarned = true;
|
|
5921
|
-
}
|
|
5922
|
-
return strKey;
|
|
5923
|
-
}
|
|
5924
|
-
return JSON.stringify(jsKey);
|
|
5925
|
-
}
|
|
5926
|
-
|
|
5927
|
-
// ../../node_modules/yaml/browser/dist/nodes/Pair.js
|
|
5928
|
-
function createPair(key, value, ctx) {
|
|
5929
|
-
const k = createNode(key, void 0, ctx);
|
|
5930
|
-
const v = createNode(value, void 0, ctx);
|
|
5931
|
-
return new Pair(k, v);
|
|
5932
|
-
}
|
|
5933
|
-
var Pair = class _Pair {
|
|
5934
|
-
constructor(key, value = null) {
|
|
5935
|
-
Object.defineProperty(this, NODE_TYPE, { value: PAIR });
|
|
5936
|
-
this.key = key;
|
|
5937
|
-
this.value = value;
|
|
5938
|
-
}
|
|
5939
|
-
clone(schema4) {
|
|
5940
|
-
let { key, value } = this;
|
|
5941
|
-
if (isNode(key))
|
|
5942
|
-
key = key.clone(schema4);
|
|
5943
|
-
if (isNode(value))
|
|
5944
|
-
value = value.clone(schema4);
|
|
5945
|
-
return new _Pair(key, value);
|
|
5946
|
-
}
|
|
5947
|
-
toJSON(_, ctx) {
|
|
5948
|
-
const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
5949
|
-
return addPairToJSMap(ctx, pair, this);
|
|
5950
|
-
}
|
|
5951
|
-
toString(ctx, onComment, onChompKeep) {
|
|
5952
|
-
return ctx?.doc ? stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
|
|
5953
|
-
}
|
|
5954
|
-
};
|
|
5955
|
-
|
|
5956
|
-
// ../../node_modules/yaml/browser/dist/stringify/stringifyCollection.js
|
|
5957
|
-
function stringifyCollection(collection, ctx, options) {
|
|
5958
|
-
const flow = ctx.inFlow ?? collection.flow;
|
|
5959
|
-
const stringify4 = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
5960
|
-
return stringify4(collection, ctx, options);
|
|
5961
|
-
}
|
|
5962
|
-
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
5963
|
-
const { indent, options: { commentString } } = ctx;
|
|
5964
|
-
const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
|
|
5965
|
-
let chompKeep = false;
|
|
5966
|
-
const lines = [];
|
|
5967
|
-
for (let i = 0; i < items.length; ++i) {
|
|
5968
|
-
const item = items[i];
|
|
5969
|
-
let comment2 = null;
|
|
5970
|
-
if (isNode(item)) {
|
|
5971
|
-
if (!chompKeep && item.spaceBefore)
|
|
5972
|
-
lines.push("");
|
|
5973
|
-
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
|
|
5974
|
-
if (item.comment)
|
|
5975
|
-
comment2 = item.comment;
|
|
5976
|
-
} else if (isPair(item)) {
|
|
5977
|
-
const ik = isNode(item.key) ? item.key : null;
|
|
5978
|
-
if (ik) {
|
|
5979
|
-
if (!chompKeep && ik.spaceBefore)
|
|
5980
|
-
lines.push("");
|
|
5981
|
-
addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);
|
|
5982
|
-
}
|
|
5983
|
-
}
|
|
5984
|
-
chompKeep = false;
|
|
5985
|
-
let str2 = stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
|
|
5986
|
-
if (comment2)
|
|
5987
|
-
str2 += lineComment(str2, itemIndent, commentString(comment2));
|
|
5988
|
-
if (chompKeep && comment2)
|
|
5989
|
-
chompKeep = false;
|
|
5990
|
-
lines.push(blockItemPrefix + str2);
|
|
5991
|
-
}
|
|
5992
|
-
let str;
|
|
5993
|
-
if (lines.length === 0) {
|
|
5994
|
-
str = flowChars.start + flowChars.end;
|
|
5995
|
-
} else {
|
|
5996
|
-
str = lines[0];
|
|
5997
|
-
for (let i = 1; i < lines.length; ++i) {
|
|
5998
|
-
const line = lines[i];
|
|
5999
|
-
str += line ? `
|
|
6000
|
-
${indent}${line}` : "\n";
|
|
6001
|
-
}
|
|
6002
|
-
}
|
|
6003
|
-
if (comment) {
|
|
6004
|
-
str += "\n" + indentComment(commentString(comment), indent);
|
|
6005
|
-
if (onComment)
|
|
6006
|
-
onComment();
|
|
6007
|
-
} else if (chompKeep && onChompKeep)
|
|
6008
|
-
onChompKeep();
|
|
6009
|
-
return str;
|
|
6010
|
-
}
|
|
6011
|
-
function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
|
|
6012
|
-
const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
|
|
6013
|
-
itemIndent += indentStep;
|
|
6014
|
-
const itemCtx = Object.assign({}, ctx, {
|
|
6015
|
-
indent: itemIndent,
|
|
6016
|
-
inFlow: true,
|
|
6017
|
-
type: null
|
|
6018
|
-
});
|
|
6019
|
-
let reqNewline = false;
|
|
6020
|
-
let linesAtValue = 0;
|
|
6021
|
-
const lines = [];
|
|
6022
|
-
for (let i = 0; i < items.length; ++i) {
|
|
6023
|
-
const item = items[i];
|
|
6024
|
-
let comment = null;
|
|
6025
|
-
if (isNode(item)) {
|
|
6026
|
-
if (item.spaceBefore)
|
|
6027
|
-
lines.push("");
|
|
6028
|
-
addCommentBefore(ctx, lines, item.commentBefore, false);
|
|
6029
|
-
if (item.comment)
|
|
6030
|
-
comment = item.comment;
|
|
6031
|
-
} else if (isPair(item)) {
|
|
6032
|
-
const ik = isNode(item.key) ? item.key : null;
|
|
6033
|
-
if (ik) {
|
|
6034
|
-
if (ik.spaceBefore)
|
|
6035
|
-
lines.push("");
|
|
6036
|
-
addCommentBefore(ctx, lines, ik.commentBefore, false);
|
|
6037
|
-
if (ik.comment)
|
|
6038
|
-
reqNewline = true;
|
|
6039
|
-
}
|
|
6040
|
-
const iv = isNode(item.value) ? item.value : null;
|
|
6041
|
-
if (iv) {
|
|
6042
|
-
if (iv.comment)
|
|
6043
|
-
comment = iv.comment;
|
|
6044
|
-
if (iv.commentBefore)
|
|
6045
|
-
reqNewline = true;
|
|
6046
|
-
} else if (item.value == null && ik?.comment) {
|
|
6047
|
-
comment = ik.comment;
|
|
6048
|
-
}
|
|
6049
|
-
}
|
|
6050
|
-
if (comment)
|
|
6051
|
-
reqNewline = true;
|
|
6052
|
-
let str = stringify(item, itemCtx, () => comment = null);
|
|
6053
|
-
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
|
|
6054
|
-
if (i < items.length - 1) {
|
|
6055
|
-
str += ",";
|
|
6056
|
-
} else if (ctx.options.trailingComma) {
|
|
6057
|
-
if (ctx.options.lineWidth > 0) {
|
|
6058
|
-
reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
|
|
6059
|
-
}
|
|
6060
|
-
if (reqNewline) {
|
|
6061
|
-
str += ",";
|
|
6062
|
-
}
|
|
6063
|
-
}
|
|
6064
|
-
if (comment)
|
|
6065
|
-
str += lineComment(str, itemIndent, commentString(comment));
|
|
6066
|
-
lines.push(str);
|
|
6067
|
-
linesAtValue = lines.length;
|
|
6068
|
-
}
|
|
6069
|
-
const { start, end } = flowChars;
|
|
6070
|
-
if (lines.length === 0) {
|
|
6071
|
-
return start + end;
|
|
6072
|
-
} else {
|
|
6073
|
-
if (!reqNewline) {
|
|
6074
|
-
const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
|
|
6075
|
-
reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
|
|
6076
|
-
}
|
|
6077
|
-
if (reqNewline) {
|
|
6078
|
-
let str = start;
|
|
6079
|
-
for (const line of lines)
|
|
6080
|
-
str += line ? `
|
|
6081
|
-
${indentStep}${indent}${line}` : "\n";
|
|
6082
|
-
return `${str}
|
|
6083
|
-
${indent}${end}`;
|
|
6084
|
-
} else {
|
|
6085
|
-
return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
|
|
6086
|
-
}
|
|
6087
|
-
}
|
|
6088
|
-
}
|
|
6089
|
-
function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
|
|
6090
|
-
if (comment && chompKeep)
|
|
6091
|
-
comment = comment.replace(/^\n+/, "");
|
|
6092
|
-
if (comment) {
|
|
6093
|
-
const ic = indentComment(commentString(comment), indent);
|
|
6094
|
-
lines.push(ic.trimStart());
|
|
6095
|
-
}
|
|
6096
|
-
}
|
|
6097
|
-
|
|
6098
|
-
// ../../node_modules/yaml/browser/dist/nodes/YAMLMap.js
|
|
6099
|
-
function findPair(items, key) {
|
|
6100
|
-
const k = isScalar(key) ? key.value : key;
|
|
6101
|
-
for (const it of items) {
|
|
6102
|
-
if (isPair(it)) {
|
|
6103
|
-
if (it.key === key || it.key === k)
|
|
6104
|
-
return it;
|
|
6105
|
-
if (isScalar(it.key) && it.key.value === k)
|
|
6106
|
-
return it;
|
|
6107
|
-
}
|
|
6108
|
-
}
|
|
6109
|
-
return void 0;
|
|
6110
|
-
}
|
|
6111
|
-
var YAMLMap = class extends Collection {
|
|
6112
|
-
static get tagName() {
|
|
6113
|
-
return "tag:yaml.org,2002:map";
|
|
6114
|
-
}
|
|
6115
|
-
constructor(schema4) {
|
|
6116
|
-
super(MAP, schema4);
|
|
6117
|
-
this.items = [];
|
|
6118
|
-
}
|
|
6119
|
-
/**
|
|
6120
|
-
* A generic collection parsing method that can be extended
|
|
6121
|
-
* to other node classes that inherit from YAMLMap
|
|
6122
|
-
*/
|
|
6123
|
-
static from(schema4, obj, ctx) {
|
|
6124
|
-
const { keepUndefined, replacer } = ctx;
|
|
6125
|
-
const map2 = new this(schema4);
|
|
6126
|
-
const add = (key, value) => {
|
|
6127
|
-
if (typeof replacer === "function")
|
|
6128
|
-
value = replacer.call(obj, key, value);
|
|
6129
|
-
else if (Array.isArray(replacer) && !replacer.includes(key))
|
|
6130
|
-
return;
|
|
6131
|
-
if (value !== void 0 || keepUndefined)
|
|
6132
|
-
map2.items.push(createPair(key, value, ctx));
|
|
6133
|
-
};
|
|
6134
|
-
if (obj instanceof Map) {
|
|
6135
|
-
for (const [key, value] of obj)
|
|
6136
|
-
add(key, value);
|
|
6137
|
-
} else if (obj && typeof obj === "object") {
|
|
6138
|
-
for (const key of Object.keys(obj))
|
|
6139
|
-
add(key, obj[key]);
|
|
6140
|
-
}
|
|
6141
|
-
if (typeof schema4.sortMapEntries === "function") {
|
|
6142
|
-
map2.items.sort(schema4.sortMapEntries);
|
|
6143
|
-
}
|
|
6144
|
-
return map2;
|
|
6145
|
-
}
|
|
6146
|
-
/**
|
|
6147
|
-
* Adds a value to the collection.
|
|
6148
|
-
*
|
|
6149
|
-
* @param overwrite - If not set `true`, using a key that is already in the
|
|
6150
|
-
* collection will throw. Otherwise, overwrites the previous value.
|
|
6151
|
-
*/
|
|
6152
|
-
add(pair, overwrite) {
|
|
6153
|
-
let _pair;
|
|
6154
|
-
if (isPair(pair))
|
|
6155
|
-
_pair = pair;
|
|
6156
|
-
else if (!pair || typeof pair !== "object" || !("key" in pair)) {
|
|
6157
|
-
_pair = new Pair(pair, pair?.value);
|
|
6158
|
-
} else
|
|
6159
|
-
_pair = new Pair(pair.key, pair.value);
|
|
6160
|
-
const prev = findPair(this.items, _pair.key);
|
|
6161
|
-
const sortEntries = this.schema?.sortMapEntries;
|
|
6162
|
-
if (prev) {
|
|
6163
|
-
if (!overwrite)
|
|
6164
|
-
throw new Error(`Key ${_pair.key} already set`);
|
|
6165
|
-
if (isScalar(prev.value) && isScalarValue(_pair.value))
|
|
6166
|
-
prev.value.value = _pair.value;
|
|
6167
|
-
else
|
|
6168
|
-
prev.value = _pair.value;
|
|
6169
|
-
} else if (sortEntries) {
|
|
6170
|
-
const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0);
|
|
6171
|
-
if (i === -1)
|
|
6172
|
-
this.items.push(_pair);
|
|
6173
|
-
else
|
|
6174
|
-
this.items.splice(i, 0, _pair);
|
|
6175
|
-
} else {
|
|
6176
|
-
this.items.push(_pair);
|
|
6177
|
-
}
|
|
6178
|
-
}
|
|
6179
|
-
delete(key) {
|
|
6180
|
-
const it = findPair(this.items, key);
|
|
6181
|
-
if (!it)
|
|
6182
|
-
return false;
|
|
6183
|
-
const del = this.items.splice(this.items.indexOf(it), 1);
|
|
6184
|
-
return del.length > 0;
|
|
6185
|
-
}
|
|
6186
|
-
get(key, keepScalar) {
|
|
6187
|
-
const it = findPair(this.items, key);
|
|
6188
|
-
const node = it?.value;
|
|
6189
|
-
return (!keepScalar && isScalar(node) ? node.value : node) ?? void 0;
|
|
6190
|
-
}
|
|
6191
|
-
has(key) {
|
|
6192
|
-
return !!findPair(this.items, key);
|
|
6193
|
-
}
|
|
6194
|
-
set(key, value) {
|
|
6195
|
-
this.add(new Pair(key, value), true);
|
|
6196
|
-
}
|
|
6197
|
-
/**
|
|
6198
|
-
* @param ctx - Conversion context, originally set in Document#toJS()
|
|
6199
|
-
* @param {Class} Type - If set, forces the returned collection type
|
|
6200
|
-
* @returns Instance of Type, Map, or Object
|
|
6201
|
-
*/
|
|
6202
|
-
toJSON(_, ctx, Type) {
|
|
6203
|
-
const map2 = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
6204
|
-
if (ctx?.onCreate)
|
|
6205
|
-
ctx.onCreate(map2);
|
|
6206
|
-
for (const item of this.items)
|
|
6207
|
-
addPairToJSMap(ctx, map2, item);
|
|
6208
|
-
return map2;
|
|
6209
|
-
}
|
|
6210
|
-
toString(ctx, onComment, onChompKeep) {
|
|
6211
|
-
if (!ctx)
|
|
6212
|
-
return JSON.stringify(this);
|
|
6213
|
-
for (const item of this.items) {
|
|
6214
|
-
if (!isPair(item))
|
|
6215
|
-
throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
|
|
6216
|
-
}
|
|
6217
|
-
if (!ctx.allNullValues && this.hasAllNullValues(false))
|
|
6218
|
-
ctx = Object.assign({}, ctx, { allNullValues: true });
|
|
6219
|
-
return stringifyCollection(this, ctx, {
|
|
6220
|
-
blockItemPrefix: "",
|
|
6221
|
-
flowChars: { start: "{", end: "}" },
|
|
6222
|
-
itemIndent: ctx.indent || "",
|
|
6223
|
-
onChompKeep,
|
|
6224
|
-
onComment
|
|
6225
|
-
});
|
|
6226
|
-
}
|
|
6227
|
-
};
|
|
6228
|
-
|
|
6229
|
-
// ../../node_modules/yaml/browser/dist/schema/common/map.js
|
|
6230
|
-
var map = {
|
|
6231
|
-
collection: "map",
|
|
6232
|
-
default: true,
|
|
6233
|
-
nodeClass: YAMLMap,
|
|
6234
|
-
tag: "tag:yaml.org,2002:map",
|
|
6235
|
-
resolve(map2, onError) {
|
|
6236
|
-
if (!isMap(map2))
|
|
6237
|
-
onError("Expected a mapping for this tag");
|
|
6238
|
-
return map2;
|
|
6239
|
-
},
|
|
6240
|
-
createNode: (schema4, obj, ctx) => YAMLMap.from(schema4, obj, ctx)
|
|
6241
|
-
};
|
|
6242
|
-
|
|
6243
|
-
// ../../node_modules/yaml/browser/dist/nodes/YAMLSeq.js
|
|
6244
|
-
var YAMLSeq = class extends Collection {
|
|
6245
|
-
static get tagName() {
|
|
6246
|
-
return "tag:yaml.org,2002:seq";
|
|
6247
|
-
}
|
|
6248
|
-
constructor(schema4) {
|
|
6249
|
-
super(SEQ, schema4);
|
|
6250
|
-
this.items = [];
|
|
6251
|
-
}
|
|
6252
|
-
add(value) {
|
|
6253
|
-
this.items.push(value);
|
|
6254
|
-
}
|
|
6255
|
-
/**
|
|
6256
|
-
* Removes a value from the collection.
|
|
6257
|
-
*
|
|
6258
|
-
* `key` must contain a representation of an integer for this to succeed.
|
|
6259
|
-
* It may be wrapped in a `Scalar`.
|
|
6260
|
-
*
|
|
6261
|
-
* @returns `true` if the item was found and removed.
|
|
6262
|
-
*/
|
|
6263
|
-
delete(key) {
|
|
6264
|
-
const idx = asItemIndex(key);
|
|
6265
|
-
if (typeof idx !== "number")
|
|
6266
|
-
return false;
|
|
6267
|
-
const del = this.items.splice(idx, 1);
|
|
6268
|
-
return del.length > 0;
|
|
6269
|
-
}
|
|
6270
|
-
get(key, keepScalar) {
|
|
6271
|
-
const idx = asItemIndex(key);
|
|
6272
|
-
if (typeof idx !== "number")
|
|
6273
|
-
return void 0;
|
|
6274
|
-
const it = this.items[idx];
|
|
6275
|
-
return !keepScalar && isScalar(it) ? it.value : it;
|
|
6276
|
-
}
|
|
6277
|
-
/**
|
|
6278
|
-
* Checks if the collection includes a value with the key `key`.
|
|
6279
|
-
*
|
|
6280
|
-
* `key` must contain a representation of an integer for this to succeed.
|
|
6281
|
-
* It may be wrapped in a `Scalar`.
|
|
6282
|
-
*/
|
|
6283
|
-
has(key) {
|
|
6284
|
-
const idx = asItemIndex(key);
|
|
6285
|
-
return typeof idx === "number" && idx < this.items.length;
|
|
6286
|
-
}
|
|
6287
|
-
/**
|
|
6288
|
-
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
6289
|
-
* boolean to add/remove the item from the set.
|
|
6290
|
-
*
|
|
6291
|
-
* If `key` does not contain a representation of an integer, this will throw.
|
|
6292
|
-
* It may be wrapped in a `Scalar`.
|
|
6293
|
-
*/
|
|
6294
|
-
set(key, value) {
|
|
6295
|
-
const idx = asItemIndex(key);
|
|
6296
|
-
if (typeof idx !== "number")
|
|
6297
|
-
throw new Error(`Expected a valid index, not ${key}.`);
|
|
6298
|
-
const prev = this.items[idx];
|
|
6299
|
-
if (isScalar(prev) && isScalarValue(value))
|
|
6300
|
-
prev.value = value;
|
|
6301
|
-
else
|
|
6302
|
-
this.items[idx] = value;
|
|
6303
|
-
}
|
|
6304
|
-
toJSON(_, ctx) {
|
|
6305
|
-
const seq2 = [];
|
|
6306
|
-
if (ctx?.onCreate)
|
|
6307
|
-
ctx.onCreate(seq2);
|
|
6308
|
-
let i = 0;
|
|
6309
|
-
for (const item of this.items)
|
|
6310
|
-
seq2.push(toJS(item, String(i++), ctx));
|
|
6311
|
-
return seq2;
|
|
6312
|
-
}
|
|
6313
|
-
toString(ctx, onComment, onChompKeep) {
|
|
6314
|
-
if (!ctx)
|
|
6315
|
-
return JSON.stringify(this);
|
|
6316
|
-
return stringifyCollection(this, ctx, {
|
|
6317
|
-
blockItemPrefix: "- ",
|
|
6318
|
-
flowChars: { start: "[", end: "]" },
|
|
6319
|
-
itemIndent: (ctx.indent || "") + " ",
|
|
6320
|
-
onChompKeep,
|
|
6321
|
-
onComment
|
|
6322
|
-
});
|
|
6323
|
-
}
|
|
6324
|
-
static from(schema4, obj, ctx) {
|
|
6325
|
-
const { replacer } = ctx;
|
|
6326
|
-
const seq2 = new this(schema4);
|
|
6327
|
-
if (obj && Symbol.iterator in Object(obj)) {
|
|
6328
|
-
let i = 0;
|
|
6329
|
-
for (let it of obj) {
|
|
6330
|
-
if (typeof replacer === "function") {
|
|
6331
|
-
const key = obj instanceof Set ? it : String(i++);
|
|
6332
|
-
it = replacer.call(obj, key, it);
|
|
6333
|
-
}
|
|
6334
|
-
seq2.items.push(createNode(it, void 0, ctx));
|
|
6335
|
-
}
|
|
6336
|
-
}
|
|
6337
|
-
return seq2;
|
|
6338
|
-
}
|
|
6339
|
-
};
|
|
6340
|
-
function asItemIndex(key) {
|
|
6341
|
-
let idx = isScalar(key) ? key.value : key;
|
|
6342
|
-
if (idx && typeof idx === "string")
|
|
6343
|
-
idx = Number(idx);
|
|
6344
|
-
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
|
|
6345
|
-
}
|
|
6346
|
-
|
|
6347
|
-
// ../../node_modules/yaml/browser/dist/schema/common/seq.js
|
|
6348
|
-
var seq = {
|
|
6349
|
-
collection: "seq",
|
|
6350
|
-
default: true,
|
|
6351
|
-
nodeClass: YAMLSeq,
|
|
6352
|
-
tag: "tag:yaml.org,2002:seq",
|
|
6353
|
-
resolve(seq2, onError) {
|
|
6354
|
-
if (!isSeq(seq2))
|
|
6355
|
-
onError("Expected a sequence for this tag");
|
|
6356
|
-
return seq2;
|
|
6357
|
-
},
|
|
6358
|
-
createNode: (schema4, obj, ctx) => YAMLSeq.from(schema4, obj, ctx)
|
|
6359
|
-
};
|
|
6360
|
-
|
|
6361
|
-
// ../../node_modules/yaml/browser/dist/schema/json/schema.js
|
|
6362
|
-
function intIdentify(value) {
|
|
6363
|
-
return typeof value === "bigint" || Number.isInteger(value);
|
|
6364
|
-
}
|
|
6365
|
-
var stringifyJSON = ({ value }) => JSON.stringify(value);
|
|
6366
|
-
var jsonScalars = [
|
|
6367
|
-
{
|
|
6368
|
-
identify: (value) => typeof value === "string",
|
|
6369
|
-
default: true,
|
|
6370
|
-
tag: "tag:yaml.org,2002:str",
|
|
6371
|
-
resolve: (str) => str,
|
|
6372
|
-
stringify: stringifyJSON
|
|
6373
|
-
},
|
|
6374
|
-
{
|
|
6375
|
-
identify: (value) => value == null,
|
|
6376
|
-
createNode: () => new Scalar(null),
|
|
6377
|
-
default: true,
|
|
6378
|
-
tag: "tag:yaml.org,2002:null",
|
|
6379
|
-
test: /^null$/,
|
|
6380
|
-
resolve: () => null,
|
|
6381
|
-
stringify: stringifyJSON
|
|
6382
|
-
},
|
|
6383
|
-
{
|
|
6384
|
-
identify: (value) => typeof value === "boolean",
|
|
6385
|
-
default: true,
|
|
6386
|
-
tag: "tag:yaml.org,2002:bool",
|
|
6387
|
-
test: /^true$|^false$/,
|
|
6388
|
-
resolve: (str) => str === "true",
|
|
6389
|
-
stringify: stringifyJSON
|
|
6390
|
-
},
|
|
6391
|
-
{
|
|
6392
|
-
identify: intIdentify,
|
|
6393
|
-
default: true,
|
|
6394
|
-
tag: "tag:yaml.org,2002:int",
|
|
6395
|
-
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
6396
|
-
resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
|
|
6397
|
-
stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
|
|
6398
|
-
},
|
|
6399
|
-
{
|
|
6400
|
-
identify: (value) => typeof value === "number",
|
|
6401
|
-
default: true,
|
|
6402
|
-
tag: "tag:yaml.org,2002:float",
|
|
6403
|
-
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
6404
|
-
resolve: (str) => parseFloat(str),
|
|
6405
|
-
stringify: stringifyJSON
|
|
6406
|
-
}
|
|
6407
|
-
];
|
|
6408
|
-
var jsonError = {
|
|
6409
|
-
default: true,
|
|
6410
|
-
tag: "",
|
|
6411
|
-
test: /^/,
|
|
6412
|
-
resolve(str, onError) {
|
|
6413
|
-
onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
|
|
6414
|
-
return str;
|
|
6415
|
-
}
|
|
6416
|
-
};
|
|
6417
|
-
var schema = [map, seq].concat(jsonScalars, jsonError);
|
|
6418
|
-
|
|
6419
|
-
// ../../node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
|
|
6420
|
-
function createPairs(schema4, iterable, ctx) {
|
|
6421
|
-
const { replacer } = ctx;
|
|
6422
|
-
const pairs2 = new YAMLSeq(schema4);
|
|
6423
|
-
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
6424
|
-
let i = 0;
|
|
6425
|
-
if (iterable && Symbol.iterator in Object(iterable))
|
|
6426
|
-
for (let it of iterable) {
|
|
6427
|
-
if (typeof replacer === "function")
|
|
6428
|
-
it = replacer.call(iterable, String(i++), it);
|
|
6429
|
-
let key, value;
|
|
6430
|
-
if (Array.isArray(it)) {
|
|
6431
|
-
if (it.length === 2) {
|
|
6432
|
-
key = it[0];
|
|
6433
|
-
value = it[1];
|
|
6434
|
-
} else
|
|
6435
|
-
throw new TypeError(`Expected [key, value] tuple: ${it}`);
|
|
6436
|
-
} else if (it && it instanceof Object) {
|
|
6437
|
-
const keys = Object.keys(it);
|
|
6438
|
-
if (keys.length === 1) {
|
|
6439
|
-
key = keys[0];
|
|
6440
|
-
value = it[key];
|
|
6441
|
-
} else {
|
|
6442
|
-
throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
|
|
6443
|
-
}
|
|
6444
|
-
} else {
|
|
6445
|
-
key = it;
|
|
6446
|
-
}
|
|
6447
|
-
pairs2.items.push(createPair(key, value, ctx));
|
|
6448
|
-
}
|
|
6449
|
-
return pairs2;
|
|
6450
|
-
}
|
|
6451
|
-
|
|
6452
|
-
// ../../node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js
|
|
6453
|
-
var YAMLOMap = class _YAMLOMap extends YAMLSeq {
|
|
6454
|
-
constructor() {
|
|
6455
|
-
super();
|
|
6456
|
-
this.add = YAMLMap.prototype.add.bind(this);
|
|
6457
|
-
this.delete = YAMLMap.prototype.delete.bind(this);
|
|
6458
|
-
this.get = YAMLMap.prototype.get.bind(this);
|
|
6459
|
-
this.has = YAMLMap.prototype.has.bind(this);
|
|
6460
|
-
this.set = YAMLMap.prototype.set.bind(this);
|
|
6461
|
-
this.tag = _YAMLOMap.tag;
|
|
6462
|
-
}
|
|
6463
|
-
/**
|
|
6464
|
-
* If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
|
|
6465
|
-
* but TypeScript won't allow widening the signature of a child method.
|
|
6466
|
-
*/
|
|
6467
|
-
toJSON(_, ctx) {
|
|
6468
|
-
if (!ctx)
|
|
6469
|
-
return super.toJSON(_);
|
|
6470
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
6471
|
-
if (ctx?.onCreate)
|
|
6472
|
-
ctx.onCreate(map2);
|
|
6473
|
-
for (const pair of this.items) {
|
|
6474
|
-
let key, value;
|
|
6475
|
-
if (isPair(pair)) {
|
|
6476
|
-
key = toJS(pair.key, "", ctx);
|
|
6477
|
-
value = toJS(pair.value, key, ctx);
|
|
6478
|
-
} else {
|
|
6479
|
-
key = toJS(pair, "", ctx);
|
|
6480
|
-
}
|
|
6481
|
-
if (map2.has(key))
|
|
6482
|
-
throw new Error("Ordered maps must not include duplicate keys");
|
|
6483
|
-
map2.set(key, value);
|
|
6484
|
-
}
|
|
6485
|
-
return map2;
|
|
6486
|
-
}
|
|
6487
|
-
static from(schema4, iterable, ctx) {
|
|
6488
|
-
const pairs2 = createPairs(schema4, iterable, ctx);
|
|
6489
|
-
const omap2 = new this();
|
|
6490
|
-
omap2.items = pairs2.items;
|
|
6491
|
-
return omap2;
|
|
6492
|
-
}
|
|
6493
|
-
};
|
|
6494
|
-
YAMLOMap.tag = "tag:yaml.org,2002:omap";
|
|
6495
|
-
|
|
6496
|
-
// ../../node_modules/yaml/browser/dist/schema/yaml-1.1/set.js
|
|
6497
|
-
var YAMLSet = class _YAMLSet extends YAMLMap {
|
|
6498
|
-
constructor(schema4) {
|
|
6499
|
-
super(schema4);
|
|
6500
|
-
this.tag = _YAMLSet.tag;
|
|
6501
|
-
}
|
|
6502
|
-
add(key) {
|
|
6503
|
-
let pair;
|
|
6504
|
-
if (isPair(key))
|
|
6505
|
-
pair = key;
|
|
6506
|
-
else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
|
|
6507
|
-
pair = new Pair(key.key, null);
|
|
6508
|
-
else
|
|
6509
|
-
pair = new Pair(key, null);
|
|
6510
|
-
const prev = findPair(this.items, pair.key);
|
|
6511
|
-
if (!prev)
|
|
6512
|
-
this.items.push(pair);
|
|
6513
|
-
}
|
|
6514
|
-
/**
|
|
6515
|
-
* If `keepPair` is `true`, returns the Pair matching `key`.
|
|
6516
|
-
* Otherwise, returns the value of that Pair's key.
|
|
6517
|
-
*/
|
|
6518
|
-
get(key, keepPair) {
|
|
6519
|
-
const pair = findPair(this.items, key);
|
|
6520
|
-
return !keepPair && isPair(pair) ? isScalar(pair.key) ? pair.key.value : pair.key : pair;
|
|
6521
|
-
}
|
|
6522
|
-
set(key, value) {
|
|
6523
|
-
if (typeof value !== "boolean")
|
|
6524
|
-
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
|
|
6525
|
-
const prev = findPair(this.items, key);
|
|
6526
|
-
if (prev && !value) {
|
|
6527
|
-
this.items.splice(this.items.indexOf(prev), 1);
|
|
6528
|
-
} else if (!prev && value) {
|
|
6529
|
-
this.items.push(new Pair(key));
|
|
6530
|
-
}
|
|
6531
|
-
}
|
|
6532
|
-
toJSON(_, ctx) {
|
|
6533
|
-
return super.toJSON(_, ctx, Set);
|
|
6534
|
-
}
|
|
6535
|
-
toString(ctx, onComment, onChompKeep) {
|
|
6536
|
-
if (!ctx)
|
|
6537
|
-
return JSON.stringify(this);
|
|
6538
|
-
if (this.hasAllNullValues(true))
|
|
6539
|
-
return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);
|
|
6540
|
-
else
|
|
6541
|
-
throw new Error("Set items must all have null values");
|
|
6542
|
-
}
|
|
6543
|
-
static from(schema4, iterable, ctx) {
|
|
6544
|
-
const { replacer } = ctx;
|
|
6545
|
-
const set2 = new this(schema4);
|
|
6546
|
-
if (iterable && Symbol.iterator in Object(iterable))
|
|
6547
|
-
for (let value of iterable) {
|
|
6548
|
-
if (typeof replacer === "function")
|
|
6549
|
-
value = replacer.call(iterable, value, value);
|
|
6550
|
-
set2.items.push(createPair(value, null, ctx));
|
|
6551
|
-
}
|
|
6552
|
-
return set2;
|
|
6553
|
-
}
|
|
6554
|
-
};
|
|
6555
|
-
YAMLSet.tag = "tag:yaml.org,2002:set";
|
|
6556
|
-
|
|
6557
|
-
// ../../node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
|
|
6558
|
-
function parseSexagesimal(str, asBigInt) {
|
|
6559
|
-
const sign = str[0];
|
|
6560
|
-
const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
|
|
6561
|
-
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
6562
|
-
const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
|
|
6563
|
-
return sign === "-" ? num(-1) * res : res;
|
|
6564
|
-
}
|
|
6565
|
-
var timestamp = {
|
|
6566
|
-
identify: (value) => value instanceof Date,
|
|
6567
|
-
default: true,
|
|
6568
|
-
tag: "tag:yaml.org,2002:timestamp",
|
|
6569
|
-
// If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
|
|
6570
|
-
// may be omitted altogether, resulting in a date format. In such a case, the time part is
|
|
6571
|
-
// assumed to be 00:00:00Z (start of day, UTC).
|
|
6572
|
-
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
|
|
6573
|
-
resolve(str) {
|
|
6574
|
-
const match = str.match(timestamp.test);
|
|
6575
|
-
if (!match)
|
|
6576
|
-
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
6577
|
-
const [, year, month, day, hour, minute, second] = match.map(Number);
|
|
6578
|
-
const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
|
|
6579
|
-
let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
|
|
6580
|
-
const tz = match[8];
|
|
6581
|
-
if (tz && tz !== "Z") {
|
|
6582
|
-
let d = parseSexagesimal(tz, false);
|
|
6583
|
-
if (Math.abs(d) < 30)
|
|
6584
|
-
d *= 60;
|
|
6585
|
-
date -= 6e4 * d;
|
|
6586
|
-
}
|
|
6587
|
-
return new Date(date);
|
|
6588
|
-
},
|
|
6589
|
-
stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
|
|
6590
|
-
};
|
|
6591
|
-
|
|
6592
|
-
// ../../node_modules/yaml/browser/dist/parse/cst-visit.js
|
|
6593
|
-
var BREAK2 = Symbol("break visit");
|
|
6594
|
-
var SKIP2 = Symbol("skip children");
|
|
6595
|
-
var REMOVE2 = Symbol("remove item");
|
|
6596
|
-
function visit2(cst, visitor) {
|
|
6597
|
-
if ("type" in cst && cst.type === "document")
|
|
6598
|
-
cst = { start: cst.start, value: cst.value };
|
|
6599
|
-
_visit(Object.freeze([]), cst, visitor);
|
|
6600
|
-
}
|
|
6601
|
-
visit2.BREAK = BREAK2;
|
|
6602
|
-
visit2.SKIP = SKIP2;
|
|
6603
|
-
visit2.REMOVE = REMOVE2;
|
|
6604
|
-
visit2.itemAtPath = (cst, path14) => {
|
|
6605
|
-
let item = cst;
|
|
6606
|
-
for (const [field, index] of path14) {
|
|
6607
|
-
const tok = item?.[field];
|
|
6608
|
-
if (tok && "items" in tok) {
|
|
6609
|
-
item = tok.items[index];
|
|
6610
|
-
} else
|
|
6611
|
-
return void 0;
|
|
6612
|
-
}
|
|
6613
|
-
return item;
|
|
6614
|
-
};
|
|
6615
|
-
visit2.parentCollection = (cst, path14) => {
|
|
6616
|
-
const parent = visit2.itemAtPath(cst, path14.slice(0, -1));
|
|
6617
|
-
const field = path14[path14.length - 1][0];
|
|
6618
|
-
const coll = parent?.[field];
|
|
6619
|
-
if (coll && "items" in coll)
|
|
6620
|
-
return coll;
|
|
6621
|
-
throw new Error("Parent collection not found");
|
|
6622
|
-
};
|
|
6623
|
-
function _visit(path14, item, visitor) {
|
|
6624
|
-
let ctrl = visitor(item, path14);
|
|
6625
|
-
if (typeof ctrl === "symbol")
|
|
6626
|
-
return ctrl;
|
|
6627
|
-
for (const field of ["key", "value"]) {
|
|
6628
|
-
const token = item[field];
|
|
6629
|
-
if (token && "items" in token) {
|
|
6630
|
-
for (let i = 0; i < token.items.length; ++i) {
|
|
6631
|
-
const ci = _visit(Object.freeze(path14.concat([[field, i]])), token.items[i], visitor);
|
|
6632
|
-
if (typeof ci === "number")
|
|
6633
|
-
i = ci - 1;
|
|
6634
|
-
else if (ci === BREAK2)
|
|
6635
|
-
return BREAK2;
|
|
6636
|
-
else if (ci === REMOVE2) {
|
|
6637
|
-
token.items.splice(i, 1);
|
|
6638
|
-
i -= 1;
|
|
6639
|
-
}
|
|
6640
|
-
}
|
|
6641
|
-
if (typeof ctrl === "function" && field === "key")
|
|
6642
|
-
ctrl = ctrl(item, path14);
|
|
6643
|
-
}
|
|
6644
|
-
}
|
|
6645
|
-
return typeof ctrl === "function" ? ctrl(item, path14) : ctrl;
|
|
6646
|
-
}
|
|
6647
|
-
|
|
6648
|
-
// ../../node_modules/yaml/browser/dist/parse/lexer.js
|
|
6649
|
-
var hexDigits = new Set("0123456789ABCDEFabcdef");
|
|
6650
|
-
var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
|
|
6651
|
-
var flowIndicatorChars = new Set(",[]{}");
|
|
6652
|
-
var invalidAnchorChars = new Set(" ,[]{}\n\r ");
|
|
6653
|
-
|
|
6654
4389
|
// cli/commands/nodeRepoFileReader.ts
|
|
6655
4390
|
var import_node_fs13 = require("node:fs");
|
|
6656
4391
|
|
|
@@ -12133,8 +9868,8 @@ var device = {
|
|
|
12133
9868
|
pointerId: 999,
|
|
12134
9869
|
afterMs: input.pressAfterMs,
|
|
12135
9870
|
eventAfterMs: 0,
|
|
12136
|
-
async deliver(
|
|
12137
|
-
const hit = await interact.touchDown(hold.x, hold.y, 999,
|
|
9871
|
+
async deliver(timestamp) {
|
|
9872
|
+
const hit = await interact.touchDown(hold.x, hold.y, 999, timestamp);
|
|
12138
9873
|
if (!hit)
|
|
12139
9874
|
throw new Error(`peach motion hold missed at ${hold.x},${hold.y}`);
|
|
12140
9875
|
}
|
|
@@ -12147,8 +9882,8 @@ var device = {
|
|
|
12147
9882
|
pointerId: 999,
|
|
12148
9883
|
afterMs: move.afterMs,
|
|
12149
9884
|
eventAfterMs: move.eventAfterMs,
|
|
12150
|
-
async deliver(
|
|
12151
|
-
await interact.touchMove(move.x, move.y, 999,
|
|
9885
|
+
async deliver(timestamp) {
|
|
9886
|
+
await interact.touchMove(move.x, move.y, 999, timestamp);
|
|
12152
9887
|
}
|
|
12153
9888
|
})
|
|
12154
9889
|
),
|
|
@@ -12159,8 +9894,8 @@ var device = {
|
|
|
12159
9894
|
pointerId: 999,
|
|
12160
9895
|
afterMs: hold.durationMs,
|
|
12161
9896
|
eventAfterMs: hold.eventDurationMs,
|
|
12162
|
-
async deliver(
|
|
12163
|
-
await interact.touchUp(release.x, release.y, 999,
|
|
9897
|
+
async deliver(timestamp) {
|
|
9898
|
+
await interact.touchUp(release.x, release.y, 999, timestamp);
|
|
12164
9899
|
}
|
|
12165
9900
|
},
|
|
12166
9901
|
...(hold.taps ?? []).flatMap((tap) => [
|
|
@@ -12170,8 +9905,8 @@ var device = {
|
|
|
12170
9905
|
y: tap.y,
|
|
12171
9906
|
pointerId: 999,
|
|
12172
9907
|
afterMs: tap.afterMs,
|
|
12173
|
-
async deliver(
|
|
12174
|
-
if (!await interact.touchDown(tap.x, tap.y, 999,
|
|
9908
|
+
async deliver(timestamp) {
|
|
9909
|
+
if (!await interact.touchDown(tap.x, tap.y, 999, timestamp))
|
|
12175
9910
|
throw new Error(`peach motion tap missed at ${tap.x},${tap.y}`);
|
|
12176
9911
|
}
|
|
12177
9912
|
},
|
|
@@ -12181,8 +9916,8 @@ var device = {
|
|
|
12181
9916
|
y: tap.y,
|
|
12182
9917
|
pointerId: 999,
|
|
12183
9918
|
afterMs: tap.afterMs + tap.durationMs,
|
|
12184
|
-
async deliver(
|
|
12185
|
-
await interact.touchUp(tap.x, tap.y, 999,
|
|
9919
|
+
async deliver(timestamp) {
|
|
9920
|
+
await interact.touchUp(tap.x, tap.y, 999, timestamp);
|
|
12186
9921
|
}
|
|
12187
9922
|
}
|
|
12188
9923
|
])
|