@polka-codes/cli-shared 0.9.78 → 0.9.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +266 -228
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1919,13 +1919,13 @@ var require_identity = __commonJS((exports) => {
|
|
|
1919
1919
|
|
|
1920
1920
|
// ../../node_modules/yaml/dist/visit.js
|
|
1921
1921
|
var require_visit = __commonJS((exports) => {
|
|
1922
|
-
var
|
|
1922
|
+
var identity = require_identity();
|
|
1923
1923
|
var BREAK = Symbol("break visit");
|
|
1924
1924
|
var SKIP = Symbol("skip children");
|
|
1925
1925
|
var REMOVE = Symbol("remove node");
|
|
1926
1926
|
function visit(node, visitor) {
|
|
1927
1927
|
const visitor_ = initVisitor(visitor);
|
|
1928
|
-
if (
|
|
1928
|
+
if (identity.isDocument(node)) {
|
|
1929
1929
|
const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
|
|
1930
1930
|
if (cd === REMOVE)
|
|
1931
1931
|
node.contents = null;
|
|
@@ -1937,12 +1937,12 @@ var require_visit = __commonJS((exports) => {
|
|
|
1937
1937
|
visit.REMOVE = REMOVE;
|
|
1938
1938
|
function visit_(key, node, visitor, path) {
|
|
1939
1939
|
const ctrl = callVisitor(key, node, visitor, path);
|
|
1940
|
-
if (
|
|
1940
|
+
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
1941
1941
|
replaceNode(key, path, ctrl);
|
|
1942
1942
|
return visit_(key, ctrl, visitor, path);
|
|
1943
1943
|
}
|
|
1944
1944
|
if (typeof ctrl !== "symbol") {
|
|
1945
|
-
if (
|
|
1945
|
+
if (identity.isCollection(node)) {
|
|
1946
1946
|
path = Object.freeze(path.concat(node));
|
|
1947
1947
|
for (let i = 0;i < node.items.length; ++i) {
|
|
1948
1948
|
const ci = visit_(i, node.items[i], visitor, path);
|
|
@@ -1955,7 +1955,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
1955
1955
|
i -= 1;
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
|
-
} else if (
|
|
1958
|
+
} else if (identity.isPair(node)) {
|
|
1959
1959
|
path = Object.freeze(path.concat(node));
|
|
1960
1960
|
const ck = visit_("key", node.key, visitor, path);
|
|
1961
1961
|
if (ck === BREAK)
|
|
@@ -1973,7 +1973,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
1973
1973
|
}
|
|
1974
1974
|
async function visitAsync(node, visitor) {
|
|
1975
1975
|
const visitor_ = initVisitor(visitor);
|
|
1976
|
-
if (
|
|
1976
|
+
if (identity.isDocument(node)) {
|
|
1977
1977
|
const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
|
|
1978
1978
|
if (cd === REMOVE)
|
|
1979
1979
|
node.contents = null;
|
|
@@ -1985,12 +1985,12 @@ var require_visit = __commonJS((exports) => {
|
|
|
1985
1985
|
visitAsync.REMOVE = REMOVE;
|
|
1986
1986
|
async function visitAsync_(key, node, visitor, path) {
|
|
1987
1987
|
const ctrl = await callVisitor(key, node, visitor, path);
|
|
1988
|
-
if (
|
|
1988
|
+
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
1989
1989
|
replaceNode(key, path, ctrl);
|
|
1990
1990
|
return visitAsync_(key, ctrl, visitor, path);
|
|
1991
1991
|
}
|
|
1992
1992
|
if (typeof ctrl !== "symbol") {
|
|
1993
|
-
if (
|
|
1993
|
+
if (identity.isCollection(node)) {
|
|
1994
1994
|
path = Object.freeze(path.concat(node));
|
|
1995
1995
|
for (let i = 0;i < node.items.length; ++i) {
|
|
1996
1996
|
const ci = await visitAsync_(i, node.items[i], visitor, path);
|
|
@@ -2003,7 +2003,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
2003
2003
|
i -= 1;
|
|
2004
2004
|
}
|
|
2005
2005
|
}
|
|
2006
|
-
} else if (
|
|
2006
|
+
} else if (identity.isPair(node)) {
|
|
2007
2007
|
path = Object.freeze(path.concat(node));
|
|
2008
2008
|
const ck = await visitAsync_("key", node.key, visitor, path);
|
|
2009
2009
|
if (ck === BREAK)
|
|
@@ -2040,31 +2040,31 @@ var require_visit = __commonJS((exports) => {
|
|
|
2040
2040
|
function callVisitor(key, node, visitor, path) {
|
|
2041
2041
|
if (typeof visitor === "function")
|
|
2042
2042
|
return visitor(key, node, path);
|
|
2043
|
-
if (
|
|
2043
|
+
if (identity.isMap(node))
|
|
2044
2044
|
return visitor.Map?.(key, node, path);
|
|
2045
|
-
if (
|
|
2045
|
+
if (identity.isSeq(node))
|
|
2046
2046
|
return visitor.Seq?.(key, node, path);
|
|
2047
|
-
if (
|
|
2047
|
+
if (identity.isPair(node))
|
|
2048
2048
|
return visitor.Pair?.(key, node, path);
|
|
2049
|
-
if (
|
|
2049
|
+
if (identity.isScalar(node))
|
|
2050
2050
|
return visitor.Scalar?.(key, node, path);
|
|
2051
|
-
if (
|
|
2051
|
+
if (identity.isAlias(node))
|
|
2052
2052
|
return visitor.Alias?.(key, node, path);
|
|
2053
2053
|
return;
|
|
2054
2054
|
}
|
|
2055
2055
|
function replaceNode(key, path, node) {
|
|
2056
2056
|
const parent = path[path.length - 1];
|
|
2057
|
-
if (
|
|
2057
|
+
if (identity.isCollection(parent)) {
|
|
2058
2058
|
parent.items[key] = node;
|
|
2059
|
-
} else if (
|
|
2059
|
+
} else if (identity.isPair(parent)) {
|
|
2060
2060
|
if (key === "key")
|
|
2061
2061
|
parent.key = node;
|
|
2062
2062
|
else
|
|
2063
2063
|
parent.value = node;
|
|
2064
|
-
} else if (
|
|
2064
|
+
} else if (identity.isDocument(parent)) {
|
|
2065
2065
|
parent.contents = node;
|
|
2066
2066
|
} else {
|
|
2067
|
-
const pt =
|
|
2067
|
+
const pt = identity.isAlias(parent) ? "alias" : "scalar";
|
|
2068
2068
|
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
2069
2069
|
}
|
|
2070
2070
|
}
|
|
@@ -2074,7 +2074,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
2074
2074
|
|
|
2075
2075
|
// ../../node_modules/yaml/dist/doc/directives.js
|
|
2076
2076
|
var require_directives = __commonJS((exports) => {
|
|
2077
|
-
var
|
|
2077
|
+
var identity = require_identity();
|
|
2078
2078
|
var visit = require_visit();
|
|
2079
2079
|
var escapeChars = {
|
|
2080
2080
|
"!": "%21",
|
|
@@ -2200,10 +2200,10 @@ var require_directives = __commonJS((exports) => {
|
|
|
2200
2200
|
const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
|
|
2201
2201
|
const tagEntries = Object.entries(this.tags);
|
|
2202
2202
|
let tagNames;
|
|
2203
|
-
if (doc2 && tagEntries.length > 0 &&
|
|
2203
|
+
if (doc2 && tagEntries.length > 0 && identity.isNode(doc2.contents)) {
|
|
2204
2204
|
const tags = {};
|
|
2205
2205
|
visit.visit(doc2.contents, (_key, node) => {
|
|
2206
|
-
if (
|
|
2206
|
+
if (identity.isNode(node) && node.tag)
|
|
2207
2207
|
tags[node.tag] = true;
|
|
2208
2208
|
});
|
|
2209
2209
|
tagNames = Object.keys(tags);
|
|
@@ -2226,7 +2226,7 @@ var require_directives = __commonJS((exports) => {
|
|
|
2226
2226
|
|
|
2227
2227
|
// ../../node_modules/yaml/dist/doc/anchors.js
|
|
2228
2228
|
var require_anchors = __commonJS((exports) => {
|
|
2229
|
-
var
|
|
2229
|
+
var identity = require_identity();
|
|
2230
2230
|
var visit = require_visit();
|
|
2231
2231
|
function anchorIsValid(anchor) {
|
|
2232
2232
|
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
|
|
@@ -2236,9 +2236,9 @@ var require_anchors = __commonJS((exports) => {
|
|
|
2236
2236
|
}
|
|
2237
2237
|
return true;
|
|
2238
2238
|
}
|
|
2239
|
-
function anchorNames(
|
|
2239
|
+
function anchorNames(root) {
|
|
2240
2240
|
const anchors = new Set;
|
|
2241
|
-
visit.visit(
|
|
2241
|
+
visit.visit(root, {
|
|
2242
2242
|
Value(_key, node) {
|
|
2243
2243
|
if (node.anchor)
|
|
2244
2244
|
anchors.add(node.anchor);
|
|
@@ -2268,7 +2268,7 @@ var require_anchors = __commonJS((exports) => {
|
|
|
2268
2268
|
setAnchors: () => {
|
|
2269
2269
|
for (const source of aliasObjects) {
|
|
2270
2270
|
const ref = sourceObjects.get(source);
|
|
2271
|
-
if (typeof ref === "object" && ref.anchor && (
|
|
2271
|
+
if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
|
|
2272
2272
|
ref.node.anchor = ref.anchor;
|
|
2273
2273
|
} else {
|
|
2274
2274
|
const error46 = new Error("Failed to resolve repeated object (this should not happen)");
|
|
@@ -2335,12 +2335,12 @@ var require_applyReviver = __commonJS((exports) => {
|
|
|
2335
2335
|
|
|
2336
2336
|
// ../../node_modules/yaml/dist/nodes/toJS.js
|
|
2337
2337
|
var require_toJS = __commonJS((exports) => {
|
|
2338
|
-
var
|
|
2338
|
+
var identity = require_identity();
|
|
2339
2339
|
function toJS(value, arg, ctx) {
|
|
2340
2340
|
if (Array.isArray(value))
|
|
2341
2341
|
return value.map((v, i) => toJS(v, String(i), ctx));
|
|
2342
2342
|
if (value && typeof value.toJSON === "function") {
|
|
2343
|
-
if (!ctx || !
|
|
2343
|
+
if (!ctx || !identity.hasAnchor(value))
|
|
2344
2344
|
return value.toJSON(arg, ctx);
|
|
2345
2345
|
const data = { aliasCount: 0, count: 1, res: undefined };
|
|
2346
2346
|
ctx.anchors.set(value, data);
|
|
@@ -2363,12 +2363,12 @@ var require_toJS = __commonJS((exports) => {
|
|
|
2363
2363
|
// ../../node_modules/yaml/dist/nodes/Node.js
|
|
2364
2364
|
var require_Node = __commonJS((exports) => {
|
|
2365
2365
|
var applyReviver = require_applyReviver();
|
|
2366
|
-
var
|
|
2366
|
+
var identity = require_identity();
|
|
2367
2367
|
var toJS = require_toJS();
|
|
2368
2368
|
|
|
2369
2369
|
class NodeBase {
|
|
2370
2370
|
constructor(type) {
|
|
2371
|
-
Object.defineProperty(this,
|
|
2371
|
+
Object.defineProperty(this, identity.NODE_TYPE, { value: type });
|
|
2372
2372
|
}
|
|
2373
2373
|
clone() {
|
|
2374
2374
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
@@ -2377,7 +2377,7 @@ var require_Node = __commonJS((exports) => {
|
|
|
2377
2377
|
return copy;
|
|
2378
2378
|
}
|
|
2379
2379
|
toJS(doc2, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
|
2380
|
-
if (!
|
|
2380
|
+
if (!identity.isDocument(doc2))
|
|
2381
2381
|
throw new TypeError("A document argument is required");
|
|
2382
2382
|
const ctx = {
|
|
2383
2383
|
anchors: new Map,
|
|
@@ -2401,13 +2401,13 @@ var require_Node = __commonJS((exports) => {
|
|
|
2401
2401
|
var require_Alias = __commonJS((exports) => {
|
|
2402
2402
|
var anchors = require_anchors();
|
|
2403
2403
|
var visit = require_visit();
|
|
2404
|
-
var
|
|
2404
|
+
var identity = require_identity();
|
|
2405
2405
|
var Node = require_Node();
|
|
2406
2406
|
var toJS = require_toJS();
|
|
2407
2407
|
|
|
2408
2408
|
class Alias extends Node.NodeBase {
|
|
2409
2409
|
constructor(source) {
|
|
2410
|
-
super(
|
|
2410
|
+
super(identity.ALIAS);
|
|
2411
2411
|
this.source = source;
|
|
2412
2412
|
Object.defineProperty(this, "tag", {
|
|
2413
2413
|
set() {
|
|
@@ -2423,7 +2423,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
2423
2423
|
nodes = [];
|
|
2424
2424
|
visit.visit(doc2, {
|
|
2425
2425
|
Node: (_key, node) => {
|
|
2426
|
-
if (
|
|
2426
|
+
if (identity.isAlias(node) || identity.hasAnchor(node))
|
|
2427
2427
|
nodes.push(node);
|
|
2428
2428
|
}
|
|
2429
2429
|
});
|
|
@@ -2483,11 +2483,11 @@ var require_Alias = __commonJS((exports) => {
|
|
|
2483
2483
|
}
|
|
2484
2484
|
}
|
|
2485
2485
|
function getAliasCount(doc2, node, anchors2) {
|
|
2486
|
-
if (
|
|
2486
|
+
if (identity.isAlias(node)) {
|
|
2487
2487
|
const source = node.resolve(doc2);
|
|
2488
2488
|
const anchor = anchors2 && source && anchors2.get(source);
|
|
2489
2489
|
return anchor ? anchor.count * anchor.aliasCount : 0;
|
|
2490
|
-
} else if (
|
|
2490
|
+
} else if (identity.isCollection(node)) {
|
|
2491
2491
|
let count = 0;
|
|
2492
2492
|
for (const item of node.items) {
|
|
2493
2493
|
const c = getAliasCount(doc2, item, anchors2);
|
|
@@ -2495,7 +2495,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
2495
2495
|
count = c;
|
|
2496
2496
|
}
|
|
2497
2497
|
return count;
|
|
2498
|
-
} else if (
|
|
2498
|
+
} else if (identity.isPair(node)) {
|
|
2499
2499
|
const kc = getAliasCount(doc2, node.key, anchors2);
|
|
2500
2500
|
const vc = getAliasCount(doc2, node.value, anchors2);
|
|
2501
2501
|
return Math.max(kc, vc);
|
|
@@ -2507,14 +2507,14 @@ var require_Alias = __commonJS((exports) => {
|
|
|
2507
2507
|
|
|
2508
2508
|
// ../../node_modules/yaml/dist/nodes/Scalar.js
|
|
2509
2509
|
var require_Scalar = __commonJS((exports) => {
|
|
2510
|
-
var
|
|
2510
|
+
var identity = require_identity();
|
|
2511
2511
|
var Node = require_Node();
|
|
2512
2512
|
var toJS = require_toJS();
|
|
2513
2513
|
var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
|
|
2514
2514
|
|
|
2515
2515
|
class Scalar extends Node.NodeBase {
|
|
2516
2516
|
constructor(value) {
|
|
2517
|
-
super(
|
|
2517
|
+
super(identity.SCALAR);
|
|
2518
2518
|
this.value = value;
|
|
2519
2519
|
}
|
|
2520
2520
|
toJSON(arg, ctx) {
|
|
@@ -2536,7 +2536,7 @@ var require_Scalar = __commonJS((exports) => {
|
|
|
2536
2536
|
// ../../node_modules/yaml/dist/doc/createNode.js
|
|
2537
2537
|
var require_createNode = __commonJS((exports) => {
|
|
2538
2538
|
var Alias = require_Alias();
|
|
2539
|
-
var
|
|
2539
|
+
var identity = require_identity();
|
|
2540
2540
|
var Scalar = require_Scalar();
|
|
2541
2541
|
var defaultTagPrefix = "tag:yaml.org,2002:";
|
|
2542
2542
|
function findTagObject(value, tagName, tags) {
|
|
@@ -2550,12 +2550,12 @@ var require_createNode = __commonJS((exports) => {
|
|
|
2550
2550
|
return tags.find((t) => t.identify?.(value) && !t.format);
|
|
2551
2551
|
}
|
|
2552
2552
|
function createNode(value, tagName, ctx) {
|
|
2553
|
-
if (
|
|
2553
|
+
if (identity.isDocument(value))
|
|
2554
2554
|
value = value.contents;
|
|
2555
|
-
if (
|
|
2555
|
+
if (identity.isNode(value))
|
|
2556
2556
|
return value;
|
|
2557
|
-
if (
|
|
2558
|
-
const map2 = ctx.schema[
|
|
2557
|
+
if (identity.isPair(value)) {
|
|
2558
|
+
const map2 = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
|
|
2559
2559
|
map2.items.push(value);
|
|
2560
2560
|
return map2;
|
|
2561
2561
|
}
|
|
@@ -2587,7 +2587,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
2587
2587
|
ref.node = node2;
|
|
2588
2588
|
return node2;
|
|
2589
2589
|
}
|
|
2590
|
-
tagObj = value instanceof Map ? schema[
|
|
2590
|
+
tagObj = value instanceof Map ? schema[identity.MAP] : (Symbol.iterator in Object(value)) ? schema[identity.SEQ] : schema[identity.MAP];
|
|
2591
2591
|
}
|
|
2592
2592
|
if (onTagObj) {
|
|
2593
2593
|
onTagObj(tagObj);
|
|
@@ -2608,7 +2608,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
2608
2608
|
// ../../node_modules/yaml/dist/nodes/Collection.js
|
|
2609
2609
|
var require_Collection = __commonJS((exports) => {
|
|
2610
2610
|
var createNode = require_createNode();
|
|
2611
|
-
var
|
|
2611
|
+
var identity = require_identity();
|
|
2612
2612
|
var Node = require_Node();
|
|
2613
2613
|
function collectionFromPath(schema, path, value) {
|
|
2614
2614
|
let v = value;
|
|
@@ -2648,7 +2648,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
2648
2648
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
2649
2649
|
if (schema)
|
|
2650
2650
|
copy.schema = schema;
|
|
2651
|
-
copy.items = copy.items.map((it) =>
|
|
2651
|
+
copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);
|
|
2652
2652
|
if (this.range)
|
|
2653
2653
|
copy.range = this.range.slice();
|
|
2654
2654
|
return copy;
|
|
@@ -2659,7 +2659,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
2659
2659
|
else {
|
|
2660
2660
|
const [key, ...rest] = path;
|
|
2661
2661
|
const node = this.get(key, true);
|
|
2662
|
-
if (
|
|
2662
|
+
if (identity.isCollection(node))
|
|
2663
2663
|
node.addIn(rest, value);
|
|
2664
2664
|
else if (node === undefined && this.schema)
|
|
2665
2665
|
this.set(key, collectionFromPath(this.schema, rest, value));
|
|
@@ -2672,7 +2672,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
2672
2672
|
if (rest.length === 0)
|
|
2673
2673
|
return this.delete(key);
|
|
2674
2674
|
const node = this.get(key, true);
|
|
2675
|
-
if (
|
|
2675
|
+
if (identity.isCollection(node))
|
|
2676
2676
|
return node.deleteIn(rest);
|
|
2677
2677
|
else
|
|
2678
2678
|
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
|
@@ -2681,16 +2681,16 @@ var require_Collection = __commonJS((exports) => {
|
|
|
2681
2681
|
const [key, ...rest] = path;
|
|
2682
2682
|
const node = this.get(key, true);
|
|
2683
2683
|
if (rest.length === 0)
|
|
2684
|
-
return !keepScalar &&
|
|
2684
|
+
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
2685
2685
|
else
|
|
2686
|
-
return
|
|
2686
|
+
return identity.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
|
|
2687
2687
|
}
|
|
2688
2688
|
hasAllNullValues(allowScalar) {
|
|
2689
2689
|
return this.items.every((node) => {
|
|
2690
|
-
if (!
|
|
2690
|
+
if (!identity.isPair(node))
|
|
2691
2691
|
return false;
|
|
2692
2692
|
const n = node.value;
|
|
2693
|
-
return n == null || allowScalar &&
|
|
2693
|
+
return n == null || allowScalar && identity.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
2694
2694
|
});
|
|
2695
2695
|
}
|
|
2696
2696
|
hasIn(path) {
|
|
@@ -2698,7 +2698,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
2698
2698
|
if (rest.length === 0)
|
|
2699
2699
|
return this.has(key);
|
|
2700
2700
|
const node = this.get(key, true);
|
|
2701
|
-
return
|
|
2701
|
+
return identity.isCollection(node) ? node.hasIn(rest) : false;
|
|
2702
2702
|
}
|
|
2703
2703
|
setIn(path, value) {
|
|
2704
2704
|
const [key, ...rest] = path;
|
|
@@ -2706,7 +2706,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
2706
2706
|
this.set(key, value);
|
|
2707
2707
|
} else {
|
|
2708
2708
|
const node = this.get(key, true);
|
|
2709
|
-
if (
|
|
2709
|
+
if (identity.isCollection(node))
|
|
2710
2710
|
node.setIn(rest, value);
|
|
2711
2711
|
else if (node === undefined && this.schema)
|
|
2712
2712
|
this.set(key, collectionFromPath(this.schema, rest, value));
|
|
@@ -3175,7 +3175,7 @@ ${indent}`);
|
|
|
3175
3175
|
// ../../node_modules/yaml/dist/stringify/stringify.js
|
|
3176
3176
|
var require_stringify = __commonJS((exports) => {
|
|
3177
3177
|
var anchors = require_anchors();
|
|
3178
|
-
var
|
|
3178
|
+
var identity = require_identity();
|
|
3179
3179
|
var stringifyComment = require_stringifyComment();
|
|
3180
3180
|
var stringifyString = require_stringifyString();
|
|
3181
3181
|
function createStringifyContext(doc2, options) {
|
|
@@ -3227,7 +3227,7 @@ var require_stringify = __commonJS((exports) => {
|
|
|
3227
3227
|
}
|
|
3228
3228
|
let tagObj = undefined;
|
|
3229
3229
|
let obj;
|
|
3230
|
-
if (
|
|
3230
|
+
if (identity.isScalar(item)) {
|
|
3231
3231
|
obj = item.value;
|
|
3232
3232
|
let match = tags.filter((t) => t.identify?.(obj));
|
|
3233
3233
|
if (match.length > 1) {
|
|
@@ -3250,7 +3250,7 @@ var require_stringify = __commonJS((exports) => {
|
|
|
3250
3250
|
if (!doc2.directives)
|
|
3251
3251
|
return "";
|
|
3252
3252
|
const props = [];
|
|
3253
|
-
const anchor = (
|
|
3253
|
+
const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;
|
|
3254
3254
|
if (anchor && anchors.anchorIsValid(anchor)) {
|
|
3255
3255
|
anchors$1.add(anchor);
|
|
3256
3256
|
props.push(`&${anchor}`);
|
|
@@ -3261,9 +3261,9 @@ var require_stringify = __commonJS((exports) => {
|
|
|
3261
3261
|
return props.join(" ");
|
|
3262
3262
|
}
|
|
3263
3263
|
function stringify(item, ctx, onComment, onChompKeep) {
|
|
3264
|
-
if (
|
|
3264
|
+
if (identity.isPair(item))
|
|
3265
3265
|
return item.toString(ctx, onComment, onChompKeep);
|
|
3266
|
-
if (
|
|
3266
|
+
if (identity.isAlias(item)) {
|
|
3267
3267
|
if (ctx.doc.directives)
|
|
3268
3268
|
return item.toString(ctx);
|
|
3269
3269
|
if (ctx.resolvedAliases?.has(item)) {
|
|
@@ -3277,15 +3277,15 @@ var require_stringify = __commonJS((exports) => {
|
|
|
3277
3277
|
}
|
|
3278
3278
|
}
|
|
3279
3279
|
let tagObj = undefined;
|
|
3280
|
-
const node =
|
|
3280
|
+
const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
|
|
3281
3281
|
tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
|
|
3282
3282
|
const props = stringifyProps(node, tagObj, ctx);
|
|
3283
3283
|
if (props.length > 0)
|
|
3284
3284
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
3285
|
-
const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) :
|
|
3285
|
+
const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
|
|
3286
3286
|
if (!props)
|
|
3287
3287
|
return str;
|
|
3288
|
-
return
|
|
3288
|
+
return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
|
|
3289
3289
|
${ctx.indent}${str}`;
|
|
3290
3290
|
}
|
|
3291
3291
|
exports.createStringifyContext = createStringifyContext;
|
|
@@ -3294,23 +3294,23 @@ ${ctx.indent}${str}`;
|
|
|
3294
3294
|
|
|
3295
3295
|
// ../../node_modules/yaml/dist/stringify/stringifyPair.js
|
|
3296
3296
|
var require_stringifyPair = __commonJS((exports) => {
|
|
3297
|
-
var
|
|
3297
|
+
var identity = require_identity();
|
|
3298
3298
|
var Scalar = require_Scalar();
|
|
3299
3299
|
var stringify = require_stringify();
|
|
3300
3300
|
var stringifyComment = require_stringifyComment();
|
|
3301
3301
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
3302
3302
|
const { allNullValues, doc: doc2, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
3303
|
-
let keyComment =
|
|
3303
|
+
let keyComment = identity.isNode(key) && key.comment || null;
|
|
3304
3304
|
if (simpleKeys) {
|
|
3305
3305
|
if (keyComment) {
|
|
3306
3306
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
3307
3307
|
}
|
|
3308
|
-
if (
|
|
3308
|
+
if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") {
|
|
3309
3309
|
const msg = "With simple keys, collection cannot be used as a key value";
|
|
3310
3310
|
throw new Error(msg);
|
|
3311
3311
|
}
|
|
3312
3312
|
}
|
|
3313
|
-
let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow ||
|
|
3313
|
+
let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object"));
|
|
3314
3314
|
ctx = Object.assign({}, ctx, {
|
|
3315
3315
|
allNullValues: false,
|
|
3316
3316
|
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
|
|
@@ -3351,7 +3351,7 @@ ${indent}:`;
|
|
|
3351
3351
|
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
|
|
3352
3352
|
}
|
|
3353
3353
|
let vsb, vcb, valueComment;
|
|
3354
|
-
if (
|
|
3354
|
+
if (identity.isNode(value)) {
|
|
3355
3355
|
vsb = !!value.spaceBefore;
|
|
3356
3356
|
vcb = value.commentBefore;
|
|
3357
3357
|
valueComment = value.comment;
|
|
@@ -3363,10 +3363,10 @@ ${indent}:`;
|
|
|
3363
3363
|
value = doc2.createNode(value);
|
|
3364
3364
|
}
|
|
3365
3365
|
ctx.implicitKey = false;
|
|
3366
|
-
if (!explicitKey && !keyComment &&
|
|
3366
|
+
if (!explicitKey && !keyComment && identity.isScalar(value))
|
|
3367
3367
|
ctx.indentAtStart = str.length + 1;
|
|
3368
3368
|
chompKeep = false;
|
|
3369
|
-
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey &&
|
|
3369
|
+
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
|
|
3370
3370
|
ctx.indent = ctx.indent.substring(2);
|
|
3371
3371
|
}
|
|
3372
3372
|
let valueCommentDone = false;
|
|
@@ -3390,7 +3390,7 @@ ${stringifyComment.indentComment(cs, ctx.indent)}`;
|
|
|
3390
3390
|
ws += `
|
|
3391
3391
|
${ctx.indent}`;
|
|
3392
3392
|
}
|
|
3393
|
-
} else if (!explicitKey &&
|
|
3393
|
+
} else if (!explicitKey && identity.isCollection(value)) {
|
|
3394
3394
|
const vs0 = valueStr[0];
|
|
3395
3395
|
const nl0 = valueStr.indexOf(`
|
|
3396
3396
|
`);
|
|
@@ -3449,10 +3449,10 @@ var require_log = __commonJS((exports) => {
|
|
|
3449
3449
|
|
|
3450
3450
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
3451
3451
|
var require_merge = __commonJS((exports) => {
|
|
3452
|
-
var
|
|
3452
|
+
var identity = require_identity();
|
|
3453
3453
|
var Scalar = require_Scalar();
|
|
3454
3454
|
var MERGE_KEY = "<<";
|
|
3455
|
-
var
|
|
3455
|
+
var merge2 = {
|
|
3456
3456
|
identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY,
|
|
3457
3457
|
default: "key",
|
|
3458
3458
|
tag: "tag:yaml.org,2002:merge",
|
|
@@ -3462,10 +3462,10 @@ var require_merge = __commonJS((exports) => {
|
|
|
3462
3462
|
}),
|
|
3463
3463
|
stringify: () => MERGE_KEY
|
|
3464
3464
|
};
|
|
3465
|
-
var isMergeKey = (ctx, key) => (
|
|
3465
|
+
var isMergeKey = (ctx, key) => (merge2.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge2.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge2.tag && tag.default);
|
|
3466
3466
|
function addMergeToJSMap(ctx, map2, value) {
|
|
3467
|
-
value = ctx &&
|
|
3468
|
-
if (
|
|
3467
|
+
value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
3468
|
+
if (identity.isSeq(value))
|
|
3469
3469
|
for (const it of value.items)
|
|
3470
3470
|
mergeValue(ctx, map2, it);
|
|
3471
3471
|
else if (Array.isArray(value))
|
|
@@ -3475,8 +3475,8 @@ var require_merge = __commonJS((exports) => {
|
|
|
3475
3475
|
mergeValue(ctx, map2, value);
|
|
3476
3476
|
}
|
|
3477
3477
|
function mergeValue(ctx, map2, value) {
|
|
3478
|
-
const source = ctx &&
|
|
3479
|
-
if (!
|
|
3478
|
+
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
3479
|
+
if (!identity.isMap(source))
|
|
3480
3480
|
throw new Error("Merge sources must be maps or map aliases");
|
|
3481
3481
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
3482
3482
|
for (const [key, value2] of srcMap) {
|
|
@@ -3498,21 +3498,21 @@ var require_merge = __commonJS((exports) => {
|
|
|
3498
3498
|
}
|
|
3499
3499
|
exports.addMergeToJSMap = addMergeToJSMap;
|
|
3500
3500
|
exports.isMergeKey = isMergeKey;
|
|
3501
|
-
exports.merge =
|
|
3501
|
+
exports.merge = merge2;
|
|
3502
3502
|
});
|
|
3503
3503
|
|
|
3504
3504
|
// ../../node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
3505
3505
|
var require_addPairToJSMap = __commonJS((exports) => {
|
|
3506
3506
|
var log = require_log();
|
|
3507
|
-
var
|
|
3507
|
+
var merge2 = require_merge();
|
|
3508
3508
|
var stringify = require_stringify();
|
|
3509
|
-
var
|
|
3509
|
+
var identity = require_identity();
|
|
3510
3510
|
var toJS = require_toJS();
|
|
3511
3511
|
function addPairToJSMap(ctx, map2, { key, value }) {
|
|
3512
|
-
if (
|
|
3512
|
+
if (identity.isNode(key) && key.addToJSMap)
|
|
3513
3513
|
key.addToJSMap(ctx, map2, value);
|
|
3514
|
-
else if (
|
|
3515
|
-
|
|
3514
|
+
else if (merge2.isMergeKey(ctx, key))
|
|
3515
|
+
merge2.addMergeToJSMap(ctx, map2, value);
|
|
3516
3516
|
else {
|
|
3517
3517
|
const jsKey = toJS.toJS(key, "", ctx);
|
|
3518
3518
|
if (map2 instanceof Map) {
|
|
@@ -3540,7 +3540,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
|
3540
3540
|
return "";
|
|
3541
3541
|
if (typeof jsKey !== "object")
|
|
3542
3542
|
return String(jsKey);
|
|
3543
|
-
if (
|
|
3543
|
+
if (identity.isNode(key) && ctx?.doc) {
|
|
3544
3544
|
const strCtx = stringify.createStringifyContext(ctx.doc, {});
|
|
3545
3545
|
strCtx.anchors = new Set;
|
|
3546
3546
|
for (const node of ctx.anchors.keys())
|
|
@@ -3567,7 +3567,7 @@ var require_Pair = __commonJS((exports) => {
|
|
|
3567
3567
|
var createNode = require_createNode();
|
|
3568
3568
|
var stringifyPair = require_stringifyPair();
|
|
3569
3569
|
var addPairToJSMap = require_addPairToJSMap();
|
|
3570
|
-
var
|
|
3570
|
+
var identity = require_identity();
|
|
3571
3571
|
function createPair(key, value, ctx) {
|
|
3572
3572
|
const k = createNode.createNode(key, undefined, ctx);
|
|
3573
3573
|
const v = createNode.createNode(value, undefined, ctx);
|
|
@@ -3576,15 +3576,15 @@ var require_Pair = __commonJS((exports) => {
|
|
|
3576
3576
|
|
|
3577
3577
|
class Pair {
|
|
3578
3578
|
constructor(key, value = null) {
|
|
3579
|
-
Object.defineProperty(this,
|
|
3579
|
+
Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });
|
|
3580
3580
|
this.key = key;
|
|
3581
3581
|
this.value = value;
|
|
3582
3582
|
}
|
|
3583
3583
|
clone(schema) {
|
|
3584
3584
|
let { key, value } = this;
|
|
3585
|
-
if (
|
|
3585
|
+
if (identity.isNode(key))
|
|
3586
3586
|
key = key.clone(schema);
|
|
3587
|
-
if (
|
|
3587
|
+
if (identity.isNode(value))
|
|
3588
3588
|
value = value.clone(schema);
|
|
3589
3589
|
return new Pair(key, value);
|
|
3590
3590
|
}
|
|
@@ -3602,7 +3602,7 @@ var require_Pair = __commonJS((exports) => {
|
|
|
3602
3602
|
|
|
3603
3603
|
// ../../node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
3604
3604
|
var require_stringifyCollection = __commonJS((exports) => {
|
|
3605
|
-
var
|
|
3605
|
+
var identity = require_identity();
|
|
3606
3606
|
var stringify = require_stringify();
|
|
3607
3607
|
var stringifyComment = require_stringifyComment();
|
|
3608
3608
|
function stringifyCollection(collection, ctx, options) {
|
|
@@ -3618,14 +3618,14 @@ var require_stringifyCollection = __commonJS((exports) => {
|
|
|
3618
3618
|
for (let i = 0;i < items.length; ++i) {
|
|
3619
3619
|
const item = items[i];
|
|
3620
3620
|
let comment2 = null;
|
|
3621
|
-
if (
|
|
3621
|
+
if (identity.isNode(item)) {
|
|
3622
3622
|
if (!chompKeep && item.spaceBefore)
|
|
3623
3623
|
lines.push("");
|
|
3624
3624
|
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
|
|
3625
3625
|
if (item.comment)
|
|
3626
3626
|
comment2 = item.comment;
|
|
3627
|
-
} else if (
|
|
3628
|
-
const ik =
|
|
3627
|
+
} else if (identity.isPair(item)) {
|
|
3628
|
+
const ik = identity.isNode(item.key) ? item.key : null;
|
|
3629
3629
|
if (ik) {
|
|
3630
3630
|
if (!chompKeep && ik.spaceBefore)
|
|
3631
3631
|
lines.push("");
|
|
@@ -3675,14 +3675,14 @@ ${indent}${line}` : `
|
|
|
3675
3675
|
for (let i = 0;i < items.length; ++i) {
|
|
3676
3676
|
const item = items[i];
|
|
3677
3677
|
let comment = null;
|
|
3678
|
-
if (
|
|
3678
|
+
if (identity.isNode(item)) {
|
|
3679
3679
|
if (item.spaceBefore)
|
|
3680
3680
|
lines.push("");
|
|
3681
3681
|
addCommentBefore(ctx, lines, item.commentBefore, false);
|
|
3682
3682
|
if (item.comment)
|
|
3683
3683
|
comment = item.comment;
|
|
3684
|
-
} else if (
|
|
3685
|
-
const ik =
|
|
3684
|
+
} else if (identity.isPair(item)) {
|
|
3685
|
+
const ik = identity.isNode(item.key) ? item.key : null;
|
|
3686
3686
|
if (ik) {
|
|
3687
3687
|
if (ik.spaceBefore)
|
|
3688
3688
|
lines.push("");
|
|
@@ -3690,7 +3690,7 @@ ${indent}${line}` : `
|
|
|
3690
3690
|
if (ik.comment)
|
|
3691
3691
|
reqNewline = true;
|
|
3692
3692
|
}
|
|
3693
|
-
const iv =
|
|
3693
|
+
const iv = identity.isNode(item.value) ? item.value : null;
|
|
3694
3694
|
if (iv) {
|
|
3695
3695
|
if (iv.comment)
|
|
3696
3696
|
comment = iv.comment;
|
|
@@ -3750,16 +3750,16 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
3750
3750
|
var stringifyCollection = require_stringifyCollection();
|
|
3751
3751
|
var addPairToJSMap = require_addPairToJSMap();
|
|
3752
3752
|
var Collection = require_Collection();
|
|
3753
|
-
var
|
|
3753
|
+
var identity = require_identity();
|
|
3754
3754
|
var Pair = require_Pair();
|
|
3755
3755
|
var Scalar = require_Scalar();
|
|
3756
3756
|
function findPair(items, key) {
|
|
3757
|
-
const k =
|
|
3757
|
+
const k = identity.isScalar(key) ? key.value : key;
|
|
3758
3758
|
for (const it of items) {
|
|
3759
|
-
if (
|
|
3759
|
+
if (identity.isPair(it)) {
|
|
3760
3760
|
if (it.key === key || it.key === k)
|
|
3761
3761
|
return it;
|
|
3762
|
-
if (
|
|
3762
|
+
if (identity.isScalar(it.key) && it.key.value === k)
|
|
3763
3763
|
return it;
|
|
3764
3764
|
}
|
|
3765
3765
|
}
|
|
@@ -3771,7 +3771,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
3771
3771
|
return "tag:yaml.org,2002:map";
|
|
3772
3772
|
}
|
|
3773
3773
|
constructor(schema) {
|
|
3774
|
-
super(
|
|
3774
|
+
super(identity.MAP, schema);
|
|
3775
3775
|
this.items = [];
|
|
3776
3776
|
}
|
|
3777
3777
|
static from(schema, obj, ctx) {
|
|
@@ -3799,7 +3799,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
3799
3799
|
}
|
|
3800
3800
|
add(pair, overwrite) {
|
|
3801
3801
|
let _pair;
|
|
3802
|
-
if (
|
|
3802
|
+
if (identity.isPair(pair))
|
|
3803
3803
|
_pair = pair;
|
|
3804
3804
|
else if (!pair || typeof pair !== "object" || !("key" in pair)) {
|
|
3805
3805
|
_pair = new Pair.Pair(pair, pair?.value);
|
|
@@ -3810,7 +3810,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
3810
3810
|
if (prev) {
|
|
3811
3811
|
if (!overwrite)
|
|
3812
3812
|
throw new Error(`Key ${_pair.key} already set`);
|
|
3813
|
-
if (
|
|
3813
|
+
if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))
|
|
3814
3814
|
prev.value.value = _pair.value;
|
|
3815
3815
|
else
|
|
3816
3816
|
prev.value = _pair.value;
|
|
@@ -3834,7 +3834,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
3834
3834
|
get(key, keepScalar) {
|
|
3835
3835
|
const it = findPair(this.items, key);
|
|
3836
3836
|
const node = it?.value;
|
|
3837
|
-
return (!keepScalar &&
|
|
3837
|
+
return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? undefined;
|
|
3838
3838
|
}
|
|
3839
3839
|
has(key) {
|
|
3840
3840
|
return !!findPair(this.items, key);
|
|
@@ -3854,7 +3854,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
3854
3854
|
if (!ctx)
|
|
3855
3855
|
return JSON.stringify(this);
|
|
3856
3856
|
for (const item of this.items) {
|
|
3857
|
-
if (!
|
|
3857
|
+
if (!identity.isPair(item))
|
|
3858
3858
|
throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
|
|
3859
3859
|
}
|
|
3860
3860
|
if (!ctx.allNullValues && this.hasAllNullValues(false))
|
|
@@ -3874,7 +3874,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
3874
3874
|
|
|
3875
3875
|
// ../../node_modules/yaml/dist/schema/common/map.js
|
|
3876
3876
|
var require_map = __commonJS((exports) => {
|
|
3877
|
-
var
|
|
3877
|
+
var identity = require_identity();
|
|
3878
3878
|
var YAMLMap = require_YAMLMap();
|
|
3879
3879
|
var map2 = {
|
|
3880
3880
|
collection: "map",
|
|
@@ -3882,7 +3882,7 @@ var require_map = __commonJS((exports) => {
|
|
|
3882
3882
|
nodeClass: YAMLMap.YAMLMap,
|
|
3883
3883
|
tag: "tag:yaml.org,2002:map",
|
|
3884
3884
|
resolve(map3, onError) {
|
|
3885
|
-
if (!
|
|
3885
|
+
if (!identity.isMap(map3))
|
|
3886
3886
|
onError("Expected a mapping for this tag");
|
|
3887
3887
|
return map3;
|
|
3888
3888
|
},
|
|
@@ -3896,7 +3896,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
3896
3896
|
var createNode = require_createNode();
|
|
3897
3897
|
var stringifyCollection = require_stringifyCollection();
|
|
3898
3898
|
var Collection = require_Collection();
|
|
3899
|
-
var
|
|
3899
|
+
var identity = require_identity();
|
|
3900
3900
|
var Scalar = require_Scalar();
|
|
3901
3901
|
var toJS = require_toJS();
|
|
3902
3902
|
|
|
@@ -3905,7 +3905,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
3905
3905
|
return "tag:yaml.org,2002:seq";
|
|
3906
3906
|
}
|
|
3907
3907
|
constructor(schema) {
|
|
3908
|
-
super(
|
|
3908
|
+
super(identity.SEQ, schema);
|
|
3909
3909
|
this.items = [];
|
|
3910
3910
|
}
|
|
3911
3911
|
add(value) {
|
|
@@ -3923,7 +3923,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
3923
3923
|
if (typeof idx !== "number")
|
|
3924
3924
|
return;
|
|
3925
3925
|
const it = this.items[idx];
|
|
3926
|
-
return !keepScalar &&
|
|
3926
|
+
return !keepScalar && identity.isScalar(it) ? it.value : it;
|
|
3927
3927
|
}
|
|
3928
3928
|
has(key) {
|
|
3929
3929
|
const idx = asItemIndex(key);
|
|
@@ -3934,7 +3934,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
3934
3934
|
if (typeof idx !== "number")
|
|
3935
3935
|
throw new Error(`Expected a valid index, not ${key}.`);
|
|
3936
3936
|
const prev = this.items[idx];
|
|
3937
|
-
if (
|
|
3937
|
+
if (identity.isScalar(prev) && Scalar.isScalarValue(value))
|
|
3938
3938
|
prev.value = value;
|
|
3939
3939
|
else
|
|
3940
3940
|
this.items[idx] = value;
|
|
@@ -3976,7 +3976,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
3976
3976
|
}
|
|
3977
3977
|
}
|
|
3978
3978
|
function asItemIndex(key) {
|
|
3979
|
-
let idx =
|
|
3979
|
+
let idx = identity.isScalar(key) ? key.value : key;
|
|
3980
3980
|
if (idx && typeof idx === "string")
|
|
3981
3981
|
idx = Number(idx);
|
|
3982
3982
|
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
|
|
@@ -3986,7 +3986,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
3986
3986
|
|
|
3987
3987
|
// ../../node_modules/yaml/dist/schema/common/seq.js
|
|
3988
3988
|
var require_seq = __commonJS((exports) => {
|
|
3989
|
-
var
|
|
3989
|
+
var identity = require_identity();
|
|
3990
3990
|
var YAMLSeq = require_YAMLSeq();
|
|
3991
3991
|
var seq = {
|
|
3992
3992
|
collection: "seq",
|
|
@@ -3994,7 +3994,7 @@ var require_seq = __commonJS((exports) => {
|
|
|
3994
3994
|
nodeClass: YAMLSeq.YAMLSeq,
|
|
3995
3995
|
tag: "tag:yaml.org,2002:seq",
|
|
3996
3996
|
resolve(seq2, onError) {
|
|
3997
|
-
if (!
|
|
3997
|
+
if (!identity.isSeq(seq2))
|
|
3998
3998
|
onError("Expected a sequence for this tag");
|
|
3999
3999
|
return seq2;
|
|
4000
4000
|
},
|
|
@@ -4022,29 +4022,29 @@ var require_string = __commonJS((exports) => {
|
|
|
4022
4022
|
// ../../node_modules/yaml/dist/schema/common/null.js
|
|
4023
4023
|
var require_null = __commonJS((exports) => {
|
|
4024
4024
|
var Scalar = require_Scalar();
|
|
4025
|
-
var
|
|
4025
|
+
var nullTag = {
|
|
4026
4026
|
identify: (value) => value == null,
|
|
4027
4027
|
createNode: () => new Scalar.Scalar(null),
|
|
4028
4028
|
default: true,
|
|
4029
4029
|
tag: "tag:yaml.org,2002:null",
|
|
4030
4030
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
4031
4031
|
resolve: () => new Scalar.Scalar(null),
|
|
4032
|
-
stringify: ({ source }, ctx) => typeof source === "string" &&
|
|
4032
|
+
stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr
|
|
4033
4033
|
};
|
|
4034
|
-
exports.nullTag =
|
|
4034
|
+
exports.nullTag = nullTag;
|
|
4035
4035
|
});
|
|
4036
4036
|
|
|
4037
4037
|
// ../../node_modules/yaml/dist/schema/core/bool.js
|
|
4038
4038
|
var require_bool = __commonJS((exports) => {
|
|
4039
4039
|
var Scalar = require_Scalar();
|
|
4040
|
-
var
|
|
4040
|
+
var boolTag = {
|
|
4041
4041
|
identify: (value) => typeof value === "boolean",
|
|
4042
4042
|
default: true,
|
|
4043
4043
|
tag: "tag:yaml.org,2002:bool",
|
|
4044
4044
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
4045
4045
|
resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"),
|
|
4046
4046
|
stringify({ source, value }, ctx) {
|
|
4047
|
-
if (source &&
|
|
4047
|
+
if (source && boolTag.test.test(source)) {
|
|
4048
4048
|
const sv = source[0] === "t" || source[0] === "T";
|
|
4049
4049
|
if (value === sv)
|
|
4050
4050
|
return source;
|
|
@@ -4052,7 +4052,7 @@ var require_bool = __commonJS((exports) => {
|
|
|
4052
4052
|
return value ? ctx.options.trueStr : ctx.options.falseStr;
|
|
4053
4053
|
}
|
|
4054
4054
|
};
|
|
4055
|
-
exports.boolTag =
|
|
4055
|
+
exports.boolTag = boolTag;
|
|
4056
4056
|
});
|
|
4057
4057
|
|
|
4058
4058
|
// ../../node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
@@ -4310,17 +4310,17 @@ var require_binary = __commonJS((exports) => {
|
|
|
4310
4310
|
|
|
4311
4311
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
4312
4312
|
var require_pairs = __commonJS((exports) => {
|
|
4313
|
-
var
|
|
4313
|
+
var identity = require_identity();
|
|
4314
4314
|
var Pair = require_Pair();
|
|
4315
4315
|
var Scalar = require_Scalar();
|
|
4316
4316
|
var YAMLSeq = require_YAMLSeq();
|
|
4317
4317
|
function resolvePairs(seq, onError) {
|
|
4318
|
-
if (
|
|
4318
|
+
if (identity.isSeq(seq)) {
|
|
4319
4319
|
for (let i = 0;i < seq.items.length; ++i) {
|
|
4320
4320
|
let item = seq.items[i];
|
|
4321
|
-
if (
|
|
4321
|
+
if (identity.isPair(item))
|
|
4322
4322
|
continue;
|
|
4323
|
-
else if (
|
|
4323
|
+
else if (identity.isMap(item)) {
|
|
4324
4324
|
if (item.items.length > 1)
|
|
4325
4325
|
onError("Each pair must have its own sequence indicator");
|
|
4326
4326
|
const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
|
|
@@ -4334,7 +4334,7 @@ ${cn.comment}` : item.comment;
|
|
|
4334
4334
|
}
|
|
4335
4335
|
item = pair;
|
|
4336
4336
|
}
|
|
4337
|
-
seq.items[i] =
|
|
4337
|
+
seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);
|
|
4338
4338
|
}
|
|
4339
4339
|
} else
|
|
4340
4340
|
onError("Expected a sequence for this tag");
|
|
@@ -4385,7 +4385,7 @@ ${cn.comment}` : item.comment;
|
|
|
4385
4385
|
|
|
4386
4386
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
4387
4387
|
var require_omap = __commonJS((exports) => {
|
|
4388
|
-
var
|
|
4388
|
+
var identity = require_identity();
|
|
4389
4389
|
var toJS = require_toJS();
|
|
4390
4390
|
var YAMLMap = require_YAMLMap();
|
|
4391
4391
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -4409,7 +4409,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
4409
4409
|
ctx.onCreate(map2);
|
|
4410
4410
|
for (const pair of this.items) {
|
|
4411
4411
|
let key, value;
|
|
4412
|
-
if (
|
|
4412
|
+
if (identity.isPair(pair)) {
|
|
4413
4413
|
key = toJS.toJS(pair.key, "", ctx);
|
|
4414
4414
|
value = toJS.toJS(pair.value, key, ctx);
|
|
4415
4415
|
} else {
|
|
@@ -4439,7 +4439,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
4439
4439
|
const pairs$1 = pairs.resolvePairs(seq, onError);
|
|
4440
4440
|
const seenKeys = [];
|
|
4441
4441
|
for (const { key } of pairs$1.items) {
|
|
4442
|
-
if (
|
|
4442
|
+
if (identity.isScalar(key)) {
|
|
4443
4443
|
if (seenKeys.includes(key.value)) {
|
|
4444
4444
|
onError(`Ordered maps must not include duplicate keys: ${key.value}`);
|
|
4445
4445
|
} else {
|
|
@@ -4608,7 +4608,7 @@ var require_int2 = __commonJS((exports) => {
|
|
|
4608
4608
|
|
|
4609
4609
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
4610
4610
|
var require_set = __commonJS((exports) => {
|
|
4611
|
-
var
|
|
4611
|
+
var identity = require_identity();
|
|
4612
4612
|
var Pair = require_Pair();
|
|
4613
4613
|
var YAMLMap = require_YAMLMap();
|
|
4614
4614
|
|
|
@@ -4619,7 +4619,7 @@ var require_set = __commonJS((exports) => {
|
|
|
4619
4619
|
}
|
|
4620
4620
|
add(key) {
|
|
4621
4621
|
let pair;
|
|
4622
|
-
if (
|
|
4622
|
+
if (identity.isPair(key))
|
|
4623
4623
|
pair = key;
|
|
4624
4624
|
else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
|
|
4625
4625
|
pair = new Pair.Pair(key.key, null);
|
|
@@ -4631,7 +4631,7 @@ var require_set = __commonJS((exports) => {
|
|
|
4631
4631
|
}
|
|
4632
4632
|
get(key, keepPair) {
|
|
4633
4633
|
const pair = YAMLMap.findPair(this.items, key);
|
|
4634
|
-
return !keepPair &&
|
|
4634
|
+
return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair;
|
|
4635
4635
|
}
|
|
4636
4636
|
set(key, value) {
|
|
4637
4637
|
if (typeof value !== "boolean")
|
|
@@ -4675,7 +4675,7 @@ var require_set = __commonJS((exports) => {
|
|
|
4675
4675
|
tag: "tag:yaml.org,2002:set",
|
|
4676
4676
|
createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
|
|
4677
4677
|
resolve(map2, onError) {
|
|
4678
|
-
if (
|
|
4678
|
+
if (identity.isMap(map2)) {
|
|
4679
4679
|
if (map2.hasAllNullValues(true))
|
|
4680
4680
|
return Object.assign(new YAMLSet, map2);
|
|
4681
4681
|
else
|
|
@@ -4781,7 +4781,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
4781
4781
|
var bool = require_bool2();
|
|
4782
4782
|
var float = require_float2();
|
|
4783
4783
|
var int2 = require_int2();
|
|
4784
|
-
var
|
|
4784
|
+
var merge2 = require_merge();
|
|
4785
4785
|
var omap = require_omap();
|
|
4786
4786
|
var pairs = require_pairs();
|
|
4787
4787
|
var set2 = require_set();
|
|
@@ -4801,7 +4801,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
4801
4801
|
float.floatExp,
|
|
4802
4802
|
float.float,
|
|
4803
4803
|
binary.binary,
|
|
4804
|
-
|
|
4804
|
+
merge2.merge,
|
|
4805
4805
|
omap.omap,
|
|
4806
4806
|
pairs.pairs,
|
|
4807
4807
|
set2.set,
|
|
@@ -4824,7 +4824,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
4824
4824
|
var schema = require_schema();
|
|
4825
4825
|
var schema$1 = require_schema2();
|
|
4826
4826
|
var binary = require_binary();
|
|
4827
|
-
var
|
|
4827
|
+
var merge2 = require_merge();
|
|
4828
4828
|
var omap = require_omap();
|
|
4829
4829
|
var pairs = require_pairs();
|
|
4830
4830
|
var schema$2 = require_schema3();
|
|
@@ -4849,7 +4849,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
4849
4849
|
intOct: int2.intOct,
|
|
4850
4850
|
intTime: timestamp.intTime,
|
|
4851
4851
|
map: map2.map,
|
|
4852
|
-
merge:
|
|
4852
|
+
merge: merge2.merge,
|
|
4853
4853
|
null: _null4.nullTag,
|
|
4854
4854
|
omap: omap.omap,
|
|
4855
4855
|
pairs: pairs.pairs,
|
|
@@ -4859,7 +4859,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
4859
4859
|
};
|
|
4860
4860
|
var coreKnownTags = {
|
|
4861
4861
|
"tag:yaml.org,2002:binary": binary.binary,
|
|
4862
|
-
"tag:yaml.org,2002:merge":
|
|
4862
|
+
"tag:yaml.org,2002:merge": merge2.merge,
|
|
4863
4863
|
"tag:yaml.org,2002:omap": omap.omap,
|
|
4864
4864
|
"tag:yaml.org,2002:pairs": pairs.pairs,
|
|
4865
4865
|
"tag:yaml.org,2002:set": set2.set,
|
|
@@ -4868,7 +4868,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
4868
4868
|
function getTags(customTags, schemaName, addMergeTag) {
|
|
4869
4869
|
const schemaTags = schemas3.get(schemaName);
|
|
4870
4870
|
if (schemaTags && !customTags) {
|
|
4871
|
-
return addMergeTag && !schemaTags.includes(
|
|
4871
|
+
return addMergeTag && !schemaTags.includes(merge2.merge) ? schemaTags.concat(merge2.merge) : schemaTags.slice();
|
|
4872
4872
|
}
|
|
4873
4873
|
let tags = schemaTags;
|
|
4874
4874
|
if (!tags) {
|
|
@@ -4886,7 +4886,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
4886
4886
|
tags = customTags(tags.slice());
|
|
4887
4887
|
}
|
|
4888
4888
|
if (addMergeTag)
|
|
4889
|
-
tags = tags.concat(
|
|
4889
|
+
tags = tags.concat(merge2.merge);
|
|
4890
4890
|
return tags.reduce((tags2, tag) => {
|
|
4891
4891
|
const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
|
|
4892
4892
|
if (!tagObj) {
|
|
@@ -4905,7 +4905,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
4905
4905
|
|
|
4906
4906
|
// ../../node_modules/yaml/dist/schema/Schema.js
|
|
4907
4907
|
var require_Schema = __commonJS((exports) => {
|
|
4908
|
-
var
|
|
4908
|
+
var identity = require_identity();
|
|
4909
4909
|
var map2 = require_map();
|
|
4910
4910
|
var seq = require_seq();
|
|
4911
4911
|
var string4 = require_string();
|
|
@@ -4913,15 +4913,15 @@ var require_Schema = __commonJS((exports) => {
|
|
|
4913
4913
|
var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
4914
4914
|
|
|
4915
4915
|
class Schema {
|
|
4916
|
-
constructor({ compat: compat2, customTags, merge:
|
|
4916
|
+
constructor({ compat: compat2, customTags, merge: merge2, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
|
|
4917
4917
|
this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
|
|
4918
4918
|
this.name = typeof schema === "string" && schema || "core";
|
|
4919
4919
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
4920
|
-
this.tags = tags.getTags(customTags, this.name,
|
|
4920
|
+
this.tags = tags.getTags(customTags, this.name, merge2);
|
|
4921
4921
|
this.toStringOptions = toStringDefaults ?? null;
|
|
4922
|
-
Object.defineProperty(this,
|
|
4923
|
-
Object.defineProperty(this,
|
|
4924
|
-
Object.defineProperty(this,
|
|
4922
|
+
Object.defineProperty(this, identity.MAP, { value: map2.map });
|
|
4923
|
+
Object.defineProperty(this, identity.SCALAR, { value: string4.string });
|
|
4924
|
+
Object.defineProperty(this, identity.SEQ, { value: seq.seq });
|
|
4925
4925
|
this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;
|
|
4926
4926
|
}
|
|
4927
4927
|
clone() {
|
|
@@ -4935,7 +4935,7 @@ var require_Schema = __commonJS((exports) => {
|
|
|
4935
4935
|
|
|
4936
4936
|
// ../../node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
4937
4937
|
var require_stringifyDocument = __commonJS((exports) => {
|
|
4938
|
-
var
|
|
4938
|
+
var identity = require_identity();
|
|
4939
4939
|
var stringify = require_stringify();
|
|
4940
4940
|
var stringifyComment = require_stringifyComment();
|
|
4941
4941
|
function stringifyDocument(doc2, options) {
|
|
@@ -4962,7 +4962,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
4962
4962
|
let chompKeep = false;
|
|
4963
4963
|
let contentComment = null;
|
|
4964
4964
|
if (doc2.contents) {
|
|
4965
|
-
if (
|
|
4965
|
+
if (identity.isNode(doc2.contents)) {
|
|
4966
4966
|
if (doc2.contents.spaceBefore && hasDirectives)
|
|
4967
4967
|
lines.push("");
|
|
4968
4968
|
if (doc2.contents.commentBefore) {
|
|
@@ -5017,7 +5017,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
5017
5017
|
var require_Document = __commonJS((exports) => {
|
|
5018
5018
|
var Alias = require_Alias();
|
|
5019
5019
|
var Collection = require_Collection();
|
|
5020
|
-
var
|
|
5020
|
+
var identity = require_identity();
|
|
5021
5021
|
var Pair = require_Pair();
|
|
5022
5022
|
var toJS = require_toJS();
|
|
5023
5023
|
var Schema = require_Schema();
|
|
@@ -5033,7 +5033,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
5033
5033
|
this.comment = null;
|
|
5034
5034
|
this.errors = [];
|
|
5035
5035
|
this.warnings = [];
|
|
5036
|
-
Object.defineProperty(this,
|
|
5036
|
+
Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });
|
|
5037
5037
|
let _replacer = null;
|
|
5038
5038
|
if (typeof replacer === "function" || Array.isArray(replacer)) {
|
|
5039
5039
|
_replacer = replacer;
|
|
@@ -5064,7 +5064,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
5064
5064
|
}
|
|
5065
5065
|
clone() {
|
|
5066
5066
|
const copy = Object.create(Document.prototype, {
|
|
5067
|
-
[
|
|
5067
|
+
[identity.NODE_TYPE]: { value: identity.DOC }
|
|
5068
5068
|
});
|
|
5069
5069
|
copy.commentBefore = this.commentBefore;
|
|
5070
5070
|
copy.comment = this.comment;
|
|
@@ -5074,7 +5074,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
5074
5074
|
if (this.directives)
|
|
5075
5075
|
copy.directives = this.directives.clone();
|
|
5076
5076
|
copy.schema = this.schema.clone();
|
|
5077
|
-
copy.contents =
|
|
5077
|
+
copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents;
|
|
5078
5078
|
if (this.range)
|
|
5079
5079
|
copy.range = this.range.slice();
|
|
5080
5080
|
return copy;
|
|
@@ -5121,7 +5121,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
5121
5121
|
sourceObjects
|
|
5122
5122
|
};
|
|
5123
5123
|
const node = createNode.createNode(value, tag, ctx);
|
|
5124
|
-
if (flow &&
|
|
5124
|
+
if (flow && identity.isCollection(node))
|
|
5125
5125
|
node.flow = true;
|
|
5126
5126
|
setAnchors();
|
|
5127
5127
|
return node;
|
|
@@ -5144,20 +5144,20 @@ var require_Document = __commonJS((exports) => {
|
|
|
5144
5144
|
return assertCollection(this.contents) ? this.contents.deleteIn(path) : false;
|
|
5145
5145
|
}
|
|
5146
5146
|
get(key, keepScalar) {
|
|
5147
|
-
return
|
|
5147
|
+
return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : undefined;
|
|
5148
5148
|
}
|
|
5149
5149
|
getIn(path, keepScalar) {
|
|
5150
5150
|
if (Collection.isEmptyPath(path))
|
|
5151
|
-
return !keepScalar &&
|
|
5152
|
-
return
|
|
5151
|
+
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
5152
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : undefined;
|
|
5153
5153
|
}
|
|
5154
5154
|
has(key) {
|
|
5155
|
-
return
|
|
5155
|
+
return identity.isCollection(this.contents) ? this.contents.has(key) : false;
|
|
5156
5156
|
}
|
|
5157
5157
|
hasIn(path) {
|
|
5158
5158
|
if (Collection.isEmptyPath(path))
|
|
5159
5159
|
return this.contents !== undefined;
|
|
5160
|
-
return
|
|
5160
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;
|
|
5161
5161
|
}
|
|
5162
5162
|
set(key, value) {
|
|
5163
5163
|
if (this.contents == null) {
|
|
@@ -5241,7 +5241,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
5241
5241
|
}
|
|
5242
5242
|
}
|
|
5243
5243
|
function assertCollection(contents) {
|
|
5244
|
-
if (
|
|
5244
|
+
if (identity.isCollection(contents))
|
|
5245
5245
|
return true;
|
|
5246
5246
|
throw new Error("Expected a YAML collection as document contents");
|
|
5247
5247
|
}
|
|
@@ -5500,12 +5500,12 @@ var require_util_flow_indent_check = __commonJS((exports) => {
|
|
|
5500
5500
|
|
|
5501
5501
|
// ../../node_modules/yaml/dist/compose/util-map-includes.js
|
|
5502
5502
|
var require_util_map_includes = __commonJS((exports) => {
|
|
5503
|
-
var
|
|
5503
|
+
var identity = require_identity();
|
|
5504
5504
|
function mapIncludes(ctx, items, search) {
|
|
5505
5505
|
const { uniqueKeys } = ctx.options;
|
|
5506
5506
|
if (uniqueKeys === false)
|
|
5507
5507
|
return false;
|
|
5508
|
-
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b ||
|
|
5508
|
+
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
|
|
5509
5509
|
return items.some((pair) => isEqual(pair.key, search));
|
|
5510
5510
|
}
|
|
5511
5511
|
exports.mapIncludes = mapIncludes;
|
|
@@ -5708,7 +5708,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
5708
5708
|
|
|
5709
5709
|
// ../../node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
5710
5710
|
var require_resolve_flow_collection = __commonJS((exports) => {
|
|
5711
|
-
var
|
|
5711
|
+
var identity = require_identity();
|
|
5712
5712
|
var Pair = require_Pair();
|
|
5713
5713
|
var YAMLMap = require_YAMLMap();
|
|
5714
5714
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -5784,7 +5784,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
5784
5784
|
}
|
|
5785
5785
|
if (prevItemComment) {
|
|
5786
5786
|
let prev = coll.items[coll.items.length - 1];
|
|
5787
|
-
if (
|
|
5787
|
+
if (identity.isPair(prev))
|
|
5788
5788
|
prev = prev.value ?? prev.key;
|
|
5789
5789
|
if (prev.comment)
|
|
5790
5790
|
prev.comment += `
|
|
@@ -5899,7 +5899,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
5899
5899
|
|
|
5900
5900
|
// ../../node_modules/yaml/dist/compose/compose-collection.js
|
|
5901
5901
|
var require_compose_collection = __commonJS((exports) => {
|
|
5902
|
-
var
|
|
5902
|
+
var identity = require_identity();
|
|
5903
5903
|
var Scalar = require_Scalar();
|
|
5904
5904
|
var YAMLMap = require_YAMLMap();
|
|
5905
5905
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -5949,7 +5949,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
5949
5949
|
}
|
|
5950
5950
|
const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
|
|
5951
5951
|
const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
|
|
5952
|
-
const node =
|
|
5952
|
+
const node = identity.isNode(res) ? res : new Scalar.Scalar(res);
|
|
5953
5953
|
node.range = coll.range;
|
|
5954
5954
|
node.tag = tagName;
|
|
5955
5955
|
if (tag?.format)
|
|
@@ -6370,7 +6370,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
6370
6370
|
|
|
6371
6371
|
// ../../node_modules/yaml/dist/compose/compose-scalar.js
|
|
6372
6372
|
var require_compose_scalar = __commonJS((exports) => {
|
|
6373
|
-
var
|
|
6373
|
+
var identity = require_identity();
|
|
6374
6374
|
var Scalar = require_Scalar();
|
|
6375
6375
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
6376
6376
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -6379,17 +6379,17 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
6379
6379
|
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
|
|
6380
6380
|
let tag;
|
|
6381
6381
|
if (ctx.options.stringKeys && ctx.atKey) {
|
|
6382
|
-
tag = ctx.schema[
|
|
6382
|
+
tag = ctx.schema[identity.SCALAR];
|
|
6383
6383
|
} else if (tagName)
|
|
6384
6384
|
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
6385
6385
|
else if (token.type === "scalar")
|
|
6386
6386
|
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
6387
6387
|
else
|
|
6388
|
-
tag = ctx.schema[
|
|
6388
|
+
tag = ctx.schema[identity.SCALAR];
|
|
6389
6389
|
let scalar;
|
|
6390
6390
|
try {
|
|
6391
6391
|
const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
|
|
6392
|
-
scalar =
|
|
6392
|
+
scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
|
|
6393
6393
|
} catch (error46) {
|
|
6394
6394
|
const msg = error46 instanceof Error ? error46.message : String(error46);
|
|
6395
6395
|
onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg);
|
|
@@ -6409,7 +6409,7 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
6409
6409
|
}
|
|
6410
6410
|
function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
|
6411
6411
|
if (tagName === "!")
|
|
6412
|
-
return schema[
|
|
6412
|
+
return schema[identity.SCALAR];
|
|
6413
6413
|
const matchWithTest = [];
|
|
6414
6414
|
for (const tag of schema.tags) {
|
|
6415
6415
|
if (!tag.collection && tag.tag === tagName) {
|
|
@@ -6428,12 +6428,12 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
6428
6428
|
return kt;
|
|
6429
6429
|
}
|
|
6430
6430
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
6431
|
-
return schema[
|
|
6431
|
+
return schema[identity.SCALAR];
|
|
6432
6432
|
}
|
|
6433
6433
|
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
6434
|
-
const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[
|
|
6434
|
+
const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR];
|
|
6435
6435
|
if (schema.compat) {
|
|
6436
|
-
const compat2 = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[
|
|
6436
|
+
const compat2 = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
|
|
6437
6437
|
if (tag.tag !== compat2.tag) {
|
|
6438
6438
|
const ts = directives.tagString(tag.tag);
|
|
6439
6439
|
const cs = directives.tagString(compat2.tag);
|
|
@@ -6476,7 +6476,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
|
6476
6476
|
// ../../node_modules/yaml/dist/compose/compose-node.js
|
|
6477
6477
|
var require_compose_node = __commonJS((exports) => {
|
|
6478
6478
|
var Alias = require_Alias();
|
|
6479
|
-
var
|
|
6479
|
+
var identity = require_identity();
|
|
6480
6480
|
var composeCollection = require_compose_collection();
|
|
6481
6481
|
var composeScalar = require_compose_scalar();
|
|
6482
6482
|
var resolveEnd = require_resolve_end();
|
|
@@ -6517,7 +6517,7 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
6517
6517
|
}
|
|
6518
6518
|
if (anchor && node.anchor === "")
|
|
6519
6519
|
onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
6520
|
-
if (atKey && ctx.options.stringKeys && (!
|
|
6520
|
+
if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
|
|
6521
6521
|
const msg = "With stringKeys, all keys must be strings";
|
|
6522
6522
|
onError(tag ?? token, "NON_STRING_KEY", msg);
|
|
6523
6523
|
}
|
|
@@ -6617,7 +6617,7 @@ var require_composer = __commonJS((exports) => {
|
|
|
6617
6617
|
var directives = require_directives();
|
|
6618
6618
|
var Document = require_Document();
|
|
6619
6619
|
var errors3 = require_errors();
|
|
6620
|
-
var
|
|
6620
|
+
var identity = require_identity();
|
|
6621
6621
|
var composeDoc = require_compose_doc();
|
|
6622
6622
|
var resolveEnd = require_resolve_end();
|
|
6623
6623
|
function getErrorPos(src) {
|
|
@@ -6683,9 +6683,9 @@ var require_composer = __commonJS((exports) => {
|
|
|
6683
6683
|
${comment}` : comment;
|
|
6684
6684
|
} else if (afterEmptyLine || doc2.directives.docStart || !dc) {
|
|
6685
6685
|
doc2.commentBefore = comment;
|
|
6686
|
-
} else if (
|
|
6686
|
+
} else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
|
|
6687
6687
|
let it = dc.items[0];
|
|
6688
|
-
if (
|
|
6688
|
+
if (identity.isPair(it))
|
|
6689
6689
|
it = it.key;
|
|
6690
6690
|
const cb = it.commentBefore;
|
|
6691
6691
|
it.commentBefore = cb ? `${comment}
|
|
@@ -8677,7 +8677,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
8677
8677
|
var Document = require_Document();
|
|
8678
8678
|
var errors3 = require_errors();
|
|
8679
8679
|
var log = require_log();
|
|
8680
|
-
var
|
|
8680
|
+
var identity = require_identity();
|
|
8681
8681
|
var lineCounter = require_line_counter();
|
|
8682
8682
|
var parser = require_parser();
|
|
8683
8683
|
function parseOptions(options) {
|
|
@@ -8755,7 +8755,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
8755
8755
|
if (!keepUndefined)
|
|
8756
8756
|
return;
|
|
8757
8757
|
}
|
|
8758
|
-
if (
|
|
8758
|
+
if (identity.isDocument(value) && !_replacer)
|
|
8759
8759
|
return value.toString(options);
|
|
8760
8760
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
8761
8761
|
}
|
|
@@ -58757,6 +58757,90 @@ var uiMessagesSchema = lazyValidator(() => zodSchema(exports_external.array(expo
|
|
|
58757
58757
|
})
|
|
58758
58758
|
])).nonempty("Message must contain at least one part")
|
|
58759
58759
|
})).nonempty("Messages array must not be empty")));
|
|
58760
|
+
// ../../node_modules/yaml/dist/index.js
|
|
58761
|
+
var composer = require_composer();
|
|
58762
|
+
var Document = require_Document();
|
|
58763
|
+
var Schema = require_Schema();
|
|
58764
|
+
var errors3 = require_errors();
|
|
58765
|
+
var Alias = require_Alias();
|
|
58766
|
+
var identity = require_identity();
|
|
58767
|
+
var Pair = require_Pair();
|
|
58768
|
+
var Scalar = require_Scalar();
|
|
58769
|
+
var YAMLMap = require_YAMLMap();
|
|
58770
|
+
var YAMLSeq = require_YAMLSeq();
|
|
58771
|
+
var cst = require_cst();
|
|
58772
|
+
var lexer = require_lexer();
|
|
58773
|
+
var lineCounter = require_line_counter();
|
|
58774
|
+
var parser = require_parser();
|
|
58775
|
+
var publicApi = require_public_api();
|
|
58776
|
+
var visit = require_visit();
|
|
58777
|
+
var $Composer = composer.Composer;
|
|
58778
|
+
var $Document = Document.Document;
|
|
58779
|
+
var $Schema = Schema.Schema;
|
|
58780
|
+
var $YAMLError = errors3.YAMLError;
|
|
58781
|
+
var $YAMLParseError = errors3.YAMLParseError;
|
|
58782
|
+
var $YAMLWarning = errors3.YAMLWarning;
|
|
58783
|
+
var $Alias = Alias.Alias;
|
|
58784
|
+
var $isAlias = identity.isAlias;
|
|
58785
|
+
var $isCollection = identity.isCollection;
|
|
58786
|
+
var $isDocument = identity.isDocument;
|
|
58787
|
+
var $isMap = identity.isMap;
|
|
58788
|
+
var $isNode = identity.isNode;
|
|
58789
|
+
var $isPair = identity.isPair;
|
|
58790
|
+
var $isScalar = identity.isScalar;
|
|
58791
|
+
var $isSeq = identity.isSeq;
|
|
58792
|
+
var $Pair = Pair.Pair;
|
|
58793
|
+
var $Scalar = Scalar.Scalar;
|
|
58794
|
+
var $YAMLMap = YAMLMap.YAMLMap;
|
|
58795
|
+
var $YAMLSeq = YAMLSeq.YAMLSeq;
|
|
58796
|
+
var $Lexer = lexer.Lexer;
|
|
58797
|
+
var $LineCounter = lineCounter.LineCounter;
|
|
58798
|
+
var $Parser = parser.Parser;
|
|
58799
|
+
var $parse = publicApi.parse;
|
|
58800
|
+
var $parseAllDocuments = publicApi.parseAllDocuments;
|
|
58801
|
+
var $parseDocument = publicApi.parseDocument;
|
|
58802
|
+
var $stringify = publicApi.stringify;
|
|
58803
|
+
var $visit = visit.visit;
|
|
58804
|
+
var $visitAsync = visit.visitAsync;
|
|
58805
|
+
|
|
58806
|
+
// ../core/src/workflow/dynamic-types.ts
|
|
58807
|
+
var WorkflowInputDefinitionSchema = exports_external.object({
|
|
58808
|
+
id: exports_external.string(),
|
|
58809
|
+
description: exports_external.string().nullish(),
|
|
58810
|
+
default: exports_external.any().nullish()
|
|
58811
|
+
});
|
|
58812
|
+
var WorkflowStepDefinitionSchema = exports_external.object({
|
|
58813
|
+
id: exports_external.string(),
|
|
58814
|
+
tools: exports_external.array(exports_external.string()).nullish(),
|
|
58815
|
+
task: exports_external.string(),
|
|
58816
|
+
output: exports_external.string().nullish(),
|
|
58817
|
+
expected_outcome: exports_external.string().nullish(),
|
|
58818
|
+
code: exports_external.string().nullish(),
|
|
58819
|
+
outputSchema: exports_external.any().nullish()
|
|
58820
|
+
});
|
|
58821
|
+
var WorkflowDefinitionSchema = exports_external.object({
|
|
58822
|
+
task: exports_external.string(),
|
|
58823
|
+
inputs: exports_external.array(WorkflowInputDefinitionSchema).nullish(),
|
|
58824
|
+
steps: exports_external.array(WorkflowStepDefinitionSchema),
|
|
58825
|
+
output: exports_external.string().nullish()
|
|
58826
|
+
});
|
|
58827
|
+
var WorkflowFileSchema = exports_external.object({
|
|
58828
|
+
workflows: exports_external.record(exports_external.string(), WorkflowDefinitionSchema)
|
|
58829
|
+
});
|
|
58830
|
+
|
|
58831
|
+
// ../core/src/workflow/dynamic.ts
|
|
58832
|
+
var AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
|
|
58833
|
+
// ../core/src/workflow/dynamic-generator.workflow.ts
|
|
58834
|
+
var GenerateWorkflowDefinitionInputSchema = exports_external.object({
|
|
58835
|
+
prompt: exports_external.string(),
|
|
58836
|
+
availableTools: exports_external.array(exports_external.object({
|
|
58837
|
+
name: exports_external.string(),
|
|
58838
|
+
description: exports_external.string()
|
|
58839
|
+
})).optional()
|
|
58840
|
+
});
|
|
58841
|
+
var GenerateWorkflowCodeInputSchema = exports_external.object({
|
|
58842
|
+
workflow: WorkflowFileSchema
|
|
58843
|
+
});
|
|
58760
58844
|
// ../../node_modules/lodash-es/_freeGlobal.js
|
|
58761
58845
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
58762
58846
|
var _freeGlobal_default = freeGlobal;
|
|
@@ -58831,10 +58915,10 @@ function isObject2(value) {
|
|
|
58831
58915
|
var isObject_default = isObject2;
|
|
58832
58916
|
|
|
58833
58917
|
// ../../node_modules/lodash-es/identity.js
|
|
58834
|
-
function
|
|
58918
|
+
function identity2(value) {
|
|
58835
58919
|
return value;
|
|
58836
58920
|
}
|
|
58837
|
-
var identity_default =
|
|
58921
|
+
var identity_default = identity2;
|
|
58838
58922
|
|
|
58839
58923
|
// ../../node_modules/lodash-es/isFunction.js
|
|
58840
58924
|
var asyncTag = "[object AsyncFunction]";
|
|
@@ -59797,52 +59881,6 @@ var merge2 = _createAssigner_default(function(object3, source, srcIndex) {
|
|
|
59797
59881
|
_baseMerge_default(object3, source, srcIndex);
|
|
59798
59882
|
});
|
|
59799
59883
|
var merge_default = merge2;
|
|
59800
|
-
// ../../node_modules/yaml/dist/index.js
|
|
59801
|
-
var composer = require_composer();
|
|
59802
|
-
var Document = require_Document();
|
|
59803
|
-
var Schema = require_Schema();
|
|
59804
|
-
var errors3 = require_errors();
|
|
59805
|
-
var Alias = require_Alias();
|
|
59806
|
-
var identity2 = require_identity();
|
|
59807
|
-
var Pair = require_Pair();
|
|
59808
|
-
var Scalar = require_Scalar();
|
|
59809
|
-
var YAMLMap = require_YAMLMap();
|
|
59810
|
-
var YAMLSeq = require_YAMLSeq();
|
|
59811
|
-
var cst = require_cst();
|
|
59812
|
-
var lexer = require_lexer();
|
|
59813
|
-
var lineCounter = require_line_counter();
|
|
59814
|
-
var parser = require_parser();
|
|
59815
|
-
var publicApi = require_public_api();
|
|
59816
|
-
var visit = require_visit();
|
|
59817
|
-
var $Composer = composer.Composer;
|
|
59818
|
-
var $Document = Document.Document;
|
|
59819
|
-
var $Schema = Schema.Schema;
|
|
59820
|
-
var $YAMLError = errors3.YAMLError;
|
|
59821
|
-
var $YAMLParseError = errors3.YAMLParseError;
|
|
59822
|
-
var $YAMLWarning = errors3.YAMLWarning;
|
|
59823
|
-
var $Alias = Alias.Alias;
|
|
59824
|
-
var $isAlias = identity2.isAlias;
|
|
59825
|
-
var $isCollection = identity2.isCollection;
|
|
59826
|
-
var $isDocument = identity2.isDocument;
|
|
59827
|
-
var $isMap = identity2.isMap;
|
|
59828
|
-
var $isNode = identity2.isNode;
|
|
59829
|
-
var $isPair = identity2.isPair;
|
|
59830
|
-
var $isScalar = identity2.isScalar;
|
|
59831
|
-
var $isSeq = identity2.isSeq;
|
|
59832
|
-
var $Pair = Pair.Pair;
|
|
59833
|
-
var $Scalar = Scalar.Scalar;
|
|
59834
|
-
var $YAMLMap = YAMLMap.YAMLMap;
|
|
59835
|
-
var $YAMLSeq = YAMLSeq.YAMLSeq;
|
|
59836
|
-
var $Lexer = lexer.Lexer;
|
|
59837
|
-
var $LineCounter = lineCounter.LineCounter;
|
|
59838
|
-
var $Parser = parser.Parser;
|
|
59839
|
-
var $parse = publicApi.parse;
|
|
59840
|
-
var $parseAllDocuments = publicApi.parseAllDocuments;
|
|
59841
|
-
var $parseDocument = publicApi.parseDocument;
|
|
59842
|
-
var $stringify = publicApi.stringify;
|
|
59843
|
-
var $visit = visit.visit;
|
|
59844
|
-
var $visitAsync = visit.visitAsync;
|
|
59845
|
-
|
|
59846
59884
|
// src/config.ts
|
|
59847
59885
|
function getGlobalConfigPath(home = homedir()) {
|
|
59848
59886
|
return join(home, ".config", "polkacodes", "config.yml");
|
|
@@ -64558,7 +64596,7 @@ function readMultiline(prompt = "Enter text (Ctrl+D to finish):") {
|
|
|
64558
64596
|
const rl = readline3.createInterface({
|
|
64559
64597
|
input: process.stdin,
|
|
64560
64598
|
output: process.stdout,
|
|
64561
|
-
|
|
64599
|
+
prompt: ""
|
|
64562
64600
|
});
|
|
64563
64601
|
const lines = [];
|
|
64564
64602
|
rl.on("line", (line) => {
|