pairit 0.3.10 → 0.3.11

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.
Files changed (2) hide show
  1. package/dist/index.js +222 -176
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1868,7 +1868,7 @@ var require_commander = __commonJS((exports) => {
1868
1868
  exports.InvalidOptionArgumentError = InvalidArgumentError;
1869
1869
  });
1870
1870
 
1871
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js
1871
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js
1872
1872
  var require_identity = __commonJS((exports) => {
1873
1873
  var ALIAS = Symbol.for("yaml.alias");
1874
1874
  var DOC = Symbol.for("yaml.document");
@@ -1922,7 +1922,7 @@ var require_identity = __commonJS((exports) => {
1922
1922
  exports.isSeq = isSeq;
1923
1923
  });
1924
1924
 
1925
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/visit.js
1925
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/visit.js
1926
1926
  var require_visit = __commonJS((exports) => {
1927
1927
  var identity = require_identity();
1928
1928
  var BREAK = Symbol("break visit");
@@ -2077,7 +2077,7 @@ var require_visit = __commonJS((exports) => {
2077
2077
  exports.visitAsync = visitAsync;
2078
2078
  });
2079
2079
 
2080
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/doc/directives.js
2080
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/directives.js
2081
2081
  var require_directives = __commonJS((exports) => {
2082
2082
  var identity = require_identity();
2083
2083
  var visit = require_visit();
@@ -2229,7 +2229,7 @@ var require_directives = __commonJS((exports) => {
2229
2229
  exports.Directives = Directives;
2230
2230
  });
2231
2231
 
2232
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.js
2232
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js
2233
2233
  var require_anchors = __commonJS((exports) => {
2234
2234
  var identity = require_identity();
2235
2235
  var visit = require_visit();
@@ -2291,7 +2291,7 @@ var require_anchors = __commonJS((exports) => {
2291
2291
  exports.findNewAnchor = findNewAnchor;
2292
2292
  });
2293
2293
 
2294
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.js
2294
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js
2295
2295
  var require_applyReviver = __commonJS((exports) => {
2296
2296
  function applyReviver(reviver, obj, key, val) {
2297
2297
  if (val && typeof val === "object") {
@@ -2338,7 +2338,7 @@ var require_applyReviver = __commonJS((exports) => {
2338
2338
  exports.applyReviver = applyReviver;
2339
2339
  });
2340
2340
 
2341
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.js
2341
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js
2342
2342
  var require_toJS = __commonJS((exports) => {
2343
2343
  var identity = require_identity();
2344
2344
  function toJS(value, arg, ctx) {
@@ -2365,7 +2365,7 @@ var require_toJS = __commonJS((exports) => {
2365
2365
  exports.toJS = toJS;
2366
2366
  });
2367
2367
 
2368
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.js
2368
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js
2369
2369
  var require_Node = __commonJS((exports) => {
2370
2370
  var applyReviver = require_applyReviver();
2371
2371
  var identity = require_identity();
@@ -2402,7 +2402,7 @@ var require_Node = __commonJS((exports) => {
2402
2402
  exports.NodeBase = NodeBase;
2403
2403
  });
2404
2404
 
2405
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.js
2405
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js
2406
2406
  var require_Alias = __commonJS((exports) => {
2407
2407
  var anchors = require_anchors();
2408
2408
  var visit = require_visit();
@@ -2421,6 +2421,8 @@ var require_Alias = __commonJS((exports) => {
2421
2421
  });
2422
2422
  }
2423
2423
  resolve(doc, ctx) {
2424
+ if (ctx?.maxAliasCount === 0)
2425
+ throw new ReferenceError("Alias resolution is disabled");
2424
2426
  let nodes;
2425
2427
  if (ctx?.aliasResolveCache) {
2426
2428
  nodes = ctx.aliasResolveCache;
@@ -2442,36 +2444,38 @@ var require_Alias = __commonJS((exports) => {
2442
2444
  if (node.anchor === this.source)
2443
2445
  found = node;
2444
2446
  }
2447
+ if (found && ctx) {
2448
+ const { anchors: anchors2, doc: doc2, maxAliasCount } = ctx;
2449
+ let data = anchors2.get(found);
2450
+ if (!data) {
2451
+ toJS.toJS(found, null, ctx);
2452
+ data = anchors2.get(found);
2453
+ }
2454
+ if (data?.res === undefined) {
2455
+ const msg = "This should not happen: Alias anchor was not resolved?";
2456
+ throw new ReferenceError(msg);
2457
+ }
2458
+ if (maxAliasCount >= 0) {
2459
+ data.count += 1;
2460
+ if (data.aliasCount === 0)
2461
+ data.aliasCount = getAliasCount(doc2, found, anchors2);
2462
+ if (data.count * data.aliasCount > maxAliasCount) {
2463
+ const msg = "Excessive alias count indicates a resource exhaustion attack";
2464
+ throw new ReferenceError(msg);
2465
+ }
2466
+ }
2467
+ }
2445
2468
  return found;
2446
2469
  }
2447
2470
  toJSON(_arg, ctx) {
2448
2471
  if (!ctx)
2449
2472
  return { source: this.source };
2450
- const { anchors: anchors2, doc, maxAliasCount } = ctx;
2451
- const source = this.resolve(doc, ctx);
2473
+ const source = this.resolve(ctx.doc, ctx);
2452
2474
  if (!source) {
2453
2475
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
2454
2476
  throw new ReferenceError(msg);
2455
2477
  }
2456
- let data = anchors2.get(source);
2457
- if (!data) {
2458
- toJS.toJS(source, null, ctx);
2459
- data = anchors2.get(source);
2460
- }
2461
- if (data?.res === undefined) {
2462
- const msg = "This should not happen: Alias anchor was not resolved?";
2463
- throw new ReferenceError(msg);
2464
- }
2465
- if (maxAliasCount >= 0) {
2466
- data.count += 1;
2467
- if (data.aliasCount === 0)
2468
- data.aliasCount = getAliasCount(doc, source, anchors2);
2469
- if (data.count * data.aliasCount > maxAliasCount) {
2470
- const msg = "Excessive alias count indicates a resource exhaustion attack";
2471
- throw new ReferenceError(msg);
2472
- }
2473
- }
2474
- return data.res;
2478
+ return ctx.anchors.get(source).res;
2475
2479
  }
2476
2480
  toString(ctx, _onComment, _onChompKeep) {
2477
2481
  const src = `*${this.source}`;
@@ -2510,7 +2514,7 @@ var require_Alias = __commonJS((exports) => {
2510
2514
  exports.Alias = Alias;
2511
2515
  });
2512
2516
 
2513
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.js
2517
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js
2514
2518
  var require_Scalar = __commonJS((exports) => {
2515
2519
  var identity = require_identity();
2516
2520
  var Node = require_Node();
@@ -2538,7 +2542,7 @@ var require_Scalar = __commonJS((exports) => {
2538
2542
  exports.isScalarValue = isScalarValue;
2539
2543
  });
2540
2544
 
2541
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.js
2545
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js
2542
2546
  var require_createNode = __commonJS((exports) => {
2543
2547
  var Alias = require_Alias();
2544
2548
  var identity = require_identity();
@@ -2610,7 +2614,7 @@ var require_createNode = __commonJS((exports) => {
2610
2614
  exports.createNode = createNode;
2611
2615
  });
2612
2616
 
2613
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.js
2617
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js
2614
2618
  var require_Collection = __commonJS((exports) => {
2615
2619
  var createNode = require_createNode();
2616
2620
  var identity = require_identity();
@@ -2725,7 +2729,7 @@ var require_Collection = __commonJS((exports) => {
2725
2729
  exports.isEmptyPath = isEmptyPath;
2726
2730
  });
2727
2731
 
2728
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.js
2732
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js
2729
2733
  var require_stringifyComment = __commonJS((exports) => {
2730
2734
  var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
2731
2735
  function indentComment(comment, indent) {
@@ -2742,7 +2746,7 @@ var require_stringifyComment = __commonJS((exports) => {
2742
2746
  exports.stringifyComment = stringifyComment;
2743
2747
  });
2744
2748
 
2745
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.js
2749
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/foldFlowLines.js
2746
2750
  var require_foldFlowLines = __commonJS((exports) => {
2747
2751
  var FOLD_FLOW = "flow";
2748
2752
  var FOLD_BLOCK = "block";
@@ -2879,7 +2883,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
2879
2883
  exports.foldFlowLines = foldFlowLines;
2880
2884
  });
2881
2885
 
2882
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.js
2886
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js
2883
2887
  var require_stringifyString = __commonJS((exports) => {
2884
2888
  var Scalar = require_Scalar();
2885
2889
  var foldFlowLines = require_foldFlowLines();
@@ -3177,7 +3181,7 @@ ${indent}`);
3177
3181
  exports.stringifyString = stringifyString;
3178
3182
  });
3179
3183
 
3180
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.js
3184
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js
3181
3185
  var require_stringify = __commonJS((exports) => {
3182
3186
  var anchors = require_anchors();
3183
3187
  var identity = require_identity();
@@ -3200,6 +3204,7 @@ var require_stringify = __commonJS((exports) => {
3200
3204
  nullStr: "null",
3201
3205
  simpleKeys: false,
3202
3206
  singleQuote: null,
3207
+ trailingComma: false,
3203
3208
  trueStr: "true",
3204
3209
  verifyAliasOrder: true
3205
3210
  }, doc.schema.toStringOptions, options);
@@ -3297,7 +3302,7 @@ ${ctx.indent}${str}`;
3297
3302
  exports.stringify = stringify;
3298
3303
  });
3299
3304
 
3300
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.js
3305
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyPair.js
3301
3306
  var require_stringifyPair = __commonJS((exports) => {
3302
3307
  var identity = require_identity();
3303
3308
  var Scalar = require_Scalar();
@@ -3433,7 +3438,7 @@ ${ctx.indent}`;
3433
3438
  exports.stringifyPair = stringifyPair;
3434
3439
  });
3435
3440
 
3436
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/log.js
3441
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/log.js
3437
3442
  var require_log = __commonJS((exports) => {
3438
3443
  var node_process = __require("process");
3439
3444
  function debug(logLevel, ...messages) {
@@ -3452,7 +3457,7 @@ var require_log = __commonJS((exports) => {
3452
3457
  exports.warn = warn;
3453
3458
  });
3454
3459
 
3455
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.js
3460
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js
3456
3461
  var require_merge = __commonJS((exports) => {
3457
3462
  var identity = require_identity();
3458
3463
  var Scalar = require_Scalar();
@@ -3469,18 +3474,18 @@ var require_merge = __commonJS((exports) => {
3469
3474
  };
3470
3475
  var isMergeKey = (ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default);
3471
3476
  function addMergeToJSMap(ctx, map, value) {
3472
- value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
3473
- if (identity.isSeq(value))
3474
- for (const it of value.items)
3477
+ const source = resolveAliasValue(ctx, value);
3478
+ if (identity.isSeq(source))
3479
+ for (const it of source.items)
3475
3480
  mergeValue(ctx, map, it);
3476
- else if (Array.isArray(value))
3477
- for (const it of value)
3481
+ else if (Array.isArray(source))
3482
+ for (const it of source)
3478
3483
  mergeValue(ctx, map, it);
3479
3484
  else
3480
- mergeValue(ctx, map, value);
3485
+ mergeValue(ctx, map, source);
3481
3486
  }
3482
3487
  function mergeValue(ctx, map, value) {
3483
- const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
3488
+ const source = resolveAliasValue(ctx, value);
3484
3489
  if (!identity.isMap(source))
3485
3490
  throw new Error("Merge sources must be maps or map aliases");
3486
3491
  const srcMap = source.toJSON(null, ctx, Map);
@@ -3501,12 +3506,15 @@ var require_merge = __commonJS((exports) => {
3501
3506
  }
3502
3507
  return map;
3503
3508
  }
3509
+ function resolveAliasValue(ctx, value) {
3510
+ return ctx && identity.isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
3511
+ }
3504
3512
  exports.addMergeToJSMap = addMergeToJSMap;
3505
3513
  exports.isMergeKey = isMergeKey;
3506
3514
  exports.merge = merge;
3507
3515
  });
3508
3516
 
3509
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.js
3517
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/addPairToJSMap.js
3510
3518
  var require_addPairToJSMap = __commonJS((exports) => {
3511
3519
  var log = require_log();
3512
3520
  var merge = require_merge();
@@ -3567,7 +3575,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
3567
3575
  exports.addPairToJSMap = addPairToJSMap;
3568
3576
  });
3569
3577
 
3570
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.js
3578
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js
3571
3579
  var require_Pair = __commonJS((exports) => {
3572
3580
  var createNode = require_createNode();
3573
3581
  var stringifyPair = require_stringifyPair();
@@ -3605,7 +3613,7 @@ var require_Pair = __commonJS((exports) => {
3605
3613
  exports.createPair = createPair;
3606
3614
  });
3607
3615
 
3608
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.js
3616
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyCollection.js
3609
3617
  var require_stringifyCollection = __commonJS((exports) => {
3610
3618
  var identity = require_identity();
3611
3619
  var stringify = require_stringify();
@@ -3708,13 +3716,20 @@ ${indent}${line}` : `
3708
3716
  if (comment)
3709
3717
  reqNewline = true;
3710
3718
  let str = stringify.stringify(item, itemCtx, () => comment = null);
3711
- if (i < items.length - 1)
3719
+ reqNewline || (reqNewline = lines.length > linesAtValue || str.includes(`
3720
+ `));
3721
+ if (i < items.length - 1) {
3712
3722
  str += ",";
3723
+ } else if (ctx.options.trailingComma) {
3724
+ if (ctx.options.lineWidth > 0) {
3725
+ reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
3726
+ }
3727
+ if (reqNewline) {
3728
+ str += ",";
3729
+ }
3730
+ }
3713
3731
  if (comment)
3714
3732
  str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
3715
- if (!reqNewline && (lines.length > linesAtValue || str.includes(`
3716
- `)))
3717
- reqNewline = true;
3718
3733
  lines.push(str);
3719
3734
  linesAtValue = lines.length;
3720
3735
  }
@@ -3750,7 +3765,7 @@ ${indent}${end}`;
3750
3765
  exports.stringifyCollection = stringifyCollection;
3751
3766
  });
3752
3767
 
3753
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.js
3768
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js
3754
3769
  var require_YAMLMap = __commonJS((exports) => {
3755
3770
  var stringifyCollection = require_stringifyCollection();
3756
3771
  var addPairToJSMap = require_addPairToJSMap();
@@ -3877,7 +3892,7 @@ var require_YAMLMap = __commonJS((exports) => {
3877
3892
  exports.findPair = findPair;
3878
3893
  });
3879
3894
 
3880
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.js
3895
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js
3881
3896
  var require_map = __commonJS((exports) => {
3882
3897
  var identity = require_identity();
3883
3898
  var YAMLMap = require_YAMLMap();
@@ -3896,7 +3911,7 @@ var require_map = __commonJS((exports) => {
3896
3911
  exports.map = map;
3897
3912
  });
3898
3913
 
3899
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.js
3914
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js
3900
3915
  var require_YAMLSeq = __commonJS((exports) => {
3901
3916
  var createNode = require_createNode();
3902
3917
  var stringifyCollection = require_stringifyCollection();
@@ -3989,7 +4004,7 @@ var require_YAMLSeq = __commonJS((exports) => {
3989
4004
  exports.YAMLSeq = YAMLSeq;
3990
4005
  });
3991
4006
 
3992
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.js
4007
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js
3993
4008
  var require_seq = __commonJS((exports) => {
3994
4009
  var identity = require_identity();
3995
4010
  var YAMLSeq = require_YAMLSeq();
@@ -4008,7 +4023,7 @@ var require_seq = __commonJS((exports) => {
4008
4023
  exports.seq = seq;
4009
4024
  });
4010
4025
 
4011
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.js
4026
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js
4012
4027
  var require_string = __commonJS((exports) => {
4013
4028
  var stringifyString = require_stringifyString();
4014
4029
  var string = {
@@ -4024,7 +4039,7 @@ var require_string = __commonJS((exports) => {
4024
4039
  exports.string = string;
4025
4040
  });
4026
4041
 
4027
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.js
4042
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js
4028
4043
  var require_null = __commonJS((exports) => {
4029
4044
  var Scalar = require_Scalar();
4030
4045
  var nullTag = {
@@ -4039,7 +4054,7 @@ var require_null = __commonJS((exports) => {
4039
4054
  exports.nullTag = nullTag;
4040
4055
  });
4041
4056
 
4042
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.js
4057
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/bool.js
4043
4058
  var require_bool = __commonJS((exports) => {
4044
4059
  var Scalar = require_Scalar();
4045
4060
  var boolTag = {
@@ -4060,7 +4075,7 @@ var require_bool = __commonJS((exports) => {
4060
4075
  exports.boolTag = boolTag;
4061
4076
  });
4062
4077
 
4063
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.js
4078
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js
4064
4079
  var require_stringifyNumber = __commonJS((exports) => {
4065
4080
  function stringifyNumber({ format, minFractionDigits, tag, value }) {
4066
4081
  if (typeof value === "bigint")
@@ -4069,7 +4084,7 @@ var require_stringifyNumber = __commonJS((exports) => {
4069
4084
  if (!isFinite(num))
4070
4085
  return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
4071
4086
  let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
4072
- if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) {
4087
+ if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) {
4073
4088
  let i = n.indexOf(".");
4074
4089
  if (i < 0) {
4075
4090
  i = n.length;
@@ -4084,7 +4099,7 @@ var require_stringifyNumber = __commonJS((exports) => {
4084
4099
  exports.stringifyNumber = stringifyNumber;
4085
4100
  });
4086
4101
 
4087
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.js
4102
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/float.js
4088
4103
  var require_float = __commonJS((exports) => {
4089
4104
  var Scalar = require_Scalar();
4090
4105
  var stringifyNumber = require_stringifyNumber();
@@ -4127,7 +4142,7 @@ var require_float = __commonJS((exports) => {
4127
4142
  exports.floatNaN = floatNaN;
4128
4143
  });
4129
4144
 
4130
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.js
4145
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/int.js
4131
4146
  var require_int = __commonJS((exports) => {
4132
4147
  var stringifyNumber = require_stringifyNumber();
4133
4148
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -4169,7 +4184,7 @@ var require_int = __commonJS((exports) => {
4169
4184
  exports.intOct = intOct;
4170
4185
  });
4171
4186
 
4172
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.js
4187
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/schema.js
4173
4188
  var require_schema = __commonJS((exports) => {
4174
4189
  var map = require_map();
4175
4190
  var _null = require_null();
@@ -4194,7 +4209,7 @@ var require_schema = __commonJS((exports) => {
4194
4209
  exports.schema = schema;
4195
4210
  });
4196
4211
 
4197
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.js
4212
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/json/schema.js
4198
4213
  var require_schema2 = __commonJS((exports) => {
4199
4214
  var Scalar = require_Scalar();
4200
4215
  var map = require_map();
@@ -4258,7 +4273,7 @@ var require_schema2 = __commonJS((exports) => {
4258
4273
  exports.schema = schema;
4259
4274
  });
4260
4275
 
4261
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.js
4276
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js
4262
4277
  var require_binary = __commonJS((exports) => {
4263
4278
  var node_buffer = __require("buffer");
4264
4279
  var Scalar = require_Scalar();
@@ -4313,7 +4328,7 @@ var require_binary = __commonJS((exports) => {
4313
4328
  exports.binary = binary;
4314
4329
  });
4315
4330
 
4316
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
4331
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
4317
4332
  var require_pairs = __commonJS((exports) => {
4318
4333
  var identity = require_identity();
4319
4334
  var Pair = require_Pair();
@@ -4388,7 +4403,7 @@ ${cn.comment}` : item.comment;
4388
4403
  exports.resolvePairs = resolvePairs;
4389
4404
  });
4390
4405
 
4391
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.js
4406
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js
4392
4407
  var require_omap = __commonJS((exports) => {
4393
4408
  var identity = require_identity();
4394
4409
  var toJS = require_toJS();
@@ -4460,7 +4475,7 @@ var require_omap = __commonJS((exports) => {
4460
4475
  exports.omap = omap;
4461
4476
  });
4462
4477
 
4463
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.js
4478
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js
4464
4479
  var require_bool2 = __commonJS((exports) => {
4465
4480
  var Scalar = require_Scalar();
4466
4481
  function boolStringify({ value, source }, ctx) {
@@ -4489,7 +4504,7 @@ var require_bool2 = __commonJS((exports) => {
4489
4504
  exports.trueTag = trueTag;
4490
4505
  });
4491
4506
 
4492
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.js
4507
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/float.js
4493
4508
  var require_float2 = __commonJS((exports) => {
4494
4509
  var Scalar = require_Scalar();
4495
4510
  var stringifyNumber = require_stringifyNumber();
@@ -4535,7 +4550,7 @@ var require_float2 = __commonJS((exports) => {
4535
4550
  exports.floatNaN = floatNaN;
4536
4551
  });
4537
4552
 
4538
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.js
4553
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/int.js
4539
4554
  var require_int2 = __commonJS((exports) => {
4540
4555
  var stringifyNumber = require_stringifyNumber();
4541
4556
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -4611,7 +4626,7 @@ var require_int2 = __commonJS((exports) => {
4611
4626
  exports.intOct = intOct;
4612
4627
  });
4613
4628
 
4614
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.js
4629
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/set.js
4615
4630
  var require_set = __commonJS((exports) => {
4616
4631
  var identity = require_identity();
4617
4632
  var Pair = require_Pair();
@@ -4694,7 +4709,7 @@ var require_set = __commonJS((exports) => {
4694
4709
  exports.set = set;
4695
4710
  });
4696
4711
 
4697
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
4712
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
4698
4713
  var require_timestamp = __commonJS((exports) => {
4699
4714
  var stringifyNumber = require_stringifyNumber();
4700
4715
  function parseSexagesimal(str, asBigInt) {
@@ -4776,7 +4791,7 @@ var require_timestamp = __commonJS((exports) => {
4776
4791
  exports.timestamp = timestamp;
4777
4792
  });
4778
4793
 
4779
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.js
4794
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js
4780
4795
  var require_schema3 = __commonJS((exports) => {
4781
4796
  var map = require_map();
4782
4797
  var _null = require_null();
@@ -4817,7 +4832,7 @@ var require_schema3 = __commonJS((exports) => {
4817
4832
  exports.schema = schema;
4818
4833
  });
4819
4834
 
4820
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/tags.js
4835
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/tags.js
4821
4836
  var require_tags = __commonJS((exports) => {
4822
4837
  var map = require_map();
4823
4838
  var _null = require_null();
@@ -4908,7 +4923,7 @@ var require_tags = __commonJS((exports) => {
4908
4923
  exports.getTags = getTags;
4909
4924
  });
4910
4925
 
4911
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.js
4926
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/Schema.js
4912
4927
  var require_Schema = __commonJS((exports) => {
4913
4928
  var identity = require_identity();
4914
4929
  var map = require_map();
@@ -4938,7 +4953,7 @@ var require_Schema = __commonJS((exports) => {
4938
4953
  exports.Schema = Schema;
4939
4954
  });
4940
4955
 
4941
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.js
4956
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyDocument.js
4942
4957
  var require_stringifyDocument = __commonJS((exports) => {
4943
4958
  var identity = require_identity();
4944
4959
  var stringify = require_stringify();
@@ -5018,7 +5033,7 @@ var require_stringifyDocument = __commonJS((exports) => {
5018
5033
  exports.stringifyDocument = stringifyDocument;
5019
5034
  });
5020
5035
 
5021
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/doc/Document.js
5036
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js
5022
5037
  var require_Document = __commonJS((exports) => {
5023
5038
  var Alias = require_Alias();
5024
5039
  var Collection = require_Collection();
@@ -5253,7 +5268,7 @@ var require_Document = __commonJS((exports) => {
5253
5268
  exports.Document = Document;
5254
5269
  });
5255
5270
 
5256
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/errors.js
5271
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/errors.js
5257
5272
  var require_errors = __commonJS((exports) => {
5258
5273
  class YAMLError extends Error {
5259
5274
  constructor(name, pos, code, message) {
@@ -5318,7 +5333,7 @@ ${pointer}
5318
5333
  exports.prettifyError = prettifyError;
5319
5334
  });
5320
5335
 
5321
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.js
5336
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js
5322
5337
  var require_resolve_props = __commonJS((exports) => {
5323
5338
  function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
5324
5339
  let spaceBefore = false;
@@ -5448,7 +5463,7 @@ var require_resolve_props = __commonJS((exports) => {
5448
5463
  exports.resolveProps = resolveProps;
5449
5464
  });
5450
5465
 
5451
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.js
5466
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js
5452
5467
  var require_util_contains_newline = __commonJS((exports) => {
5453
5468
  function containsNewline(key) {
5454
5469
  if (!key)
@@ -5488,7 +5503,7 @@ var require_util_contains_newline = __commonJS((exports) => {
5488
5503
  exports.containsNewline = containsNewline;
5489
5504
  });
5490
5505
 
5491
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.js
5506
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-flow-indent-check.js
5492
5507
  var require_util_flow_indent_check = __commonJS((exports) => {
5493
5508
  var utilContainsNewline = require_util_contains_newline();
5494
5509
  function flowIndentCheck(indent, fc, onError) {
@@ -5503,7 +5518,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
5503
5518
  exports.flowIndentCheck = flowIndentCheck;
5504
5519
  });
5505
5520
 
5506
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.js
5521
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-map-includes.js
5507
5522
  var require_util_map_includes = __commonJS((exports) => {
5508
5523
  var identity = require_identity();
5509
5524
  function mapIncludes(ctx, items, search) {
@@ -5516,7 +5531,7 @@ var require_util_map_includes = __commonJS((exports) => {
5516
5531
  exports.mapIncludes = mapIncludes;
5517
5532
  });
5518
5533
 
5519
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.js
5534
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-map.js
5520
5535
  var require_resolve_block_map = __commonJS((exports) => {
5521
5536
  var Pair = require_Pair();
5522
5537
  var YAMLMap = require_YAMLMap();
@@ -5623,7 +5638,7 @@ var require_resolve_block_map = __commonJS((exports) => {
5623
5638
  exports.resolveBlockMap = resolveBlockMap;
5624
5639
  });
5625
5640
 
5626
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.js
5641
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-seq.js
5627
5642
  var require_resolve_block_seq = __commonJS((exports) => {
5628
5643
  var YAMLSeq = require_YAMLSeq();
5629
5644
  var resolveProps = require_resolve_props();
@@ -5671,7 +5686,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
5671
5686
  exports.resolveBlockSeq = resolveBlockSeq;
5672
5687
  });
5673
5688
 
5674
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.js
5689
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js
5675
5690
  var require_resolve_end = __commonJS((exports) => {
5676
5691
  function resolveEnd(end, offset, reqSpace, onError) {
5677
5692
  let comment = "";
@@ -5711,7 +5726,7 @@ var require_resolve_end = __commonJS((exports) => {
5711
5726
  exports.resolveEnd = resolveEnd;
5712
5727
  });
5713
5728
 
5714
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.js
5729
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-collection.js
5715
5730
  var require_resolve_flow_collection = __commonJS((exports) => {
5716
5731
  var identity = require_identity();
5717
5732
  var Pair = require_Pair();
@@ -5902,7 +5917,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
5902
5917
  exports.resolveFlowCollection = resolveFlowCollection;
5903
5918
  });
5904
5919
 
5905
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.js
5920
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-collection.js
5906
5921
  var require_compose_collection = __commonJS((exports) => {
5907
5922
  var identity = require_identity();
5908
5923
  var Scalar = require_Scalar();
@@ -5964,7 +5979,7 @@ var require_compose_collection = __commonJS((exports) => {
5964
5979
  exports.composeCollection = composeCollection;
5965
5980
  });
5966
5981
 
5967
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.js
5982
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-scalar.js
5968
5983
  var require_resolve_block_scalar = __commonJS((exports) => {
5969
5984
  var Scalar = require_Scalar();
5970
5985
  function resolveBlockScalar(ctx, scalar, onError) {
@@ -6157,7 +6172,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
6157
6172
  exports.resolveBlockScalar = resolveBlockScalar;
6158
6173
  });
6159
6174
 
6160
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.js
6175
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js
6161
6176
  var require_resolve_flow_scalar = __commonJS((exports) => {
6162
6177
  var Scalar = require_Scalar();
6163
6178
  var resolveEnd = require_resolve_end();
@@ -6222,33 +6237,32 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
6222
6237
  }
6223
6238
  if (badChar)
6224
6239
  onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
6225
- return foldLines(source);
6240
+ return unfoldLines(source);
6226
6241
  }
6227
6242
  function singleQuotedValue(source, onError) {
6228
6243
  if (source[source.length - 1] !== "'" || source.length === 1)
6229
6244
  onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
6230
- return foldLines(source.slice(1, -1)).replace(/''/g, "'");
6245
+ return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
6231
6246
  }
6232
- function foldLines(source) {
6233
- let first, line;
6247
+ function unfoldLines(source) {
6248
+ const line = /(.*?)\r?\n/sy;
6249
+ let match = line.exec(source);
6250
+ if (!match)
6251
+ return source;
6252
+ let trimEnd, trimBoth;
6234
6253
  try {
6235
- first = new RegExp(`(.*?)(?<![ ])[ ]*\r?
6236
- `, "sy");
6237
- line = new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
6238
- `, "sy");
6254
+ trimEnd = new RegExp("(?<![ \t])[ \t]+$");
6255
+ trimBoth = new RegExp("^[ \t]+|(?<![ \t])[ \t]+$", "g");
6239
6256
  } catch {
6240
- first = /(.*?)[ \t]*\r?\n/sy;
6241
- line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
6257
+ trimEnd = /[ \t]+$/;
6258
+ trimBoth = /^[ \t]+|[ \t]+$/g;
6242
6259
  }
6243
- let match = first.exec(source);
6244
- if (!match)
6245
- return source;
6246
- let res = match[1];
6260
+ let res = match[1].replace(trimEnd, "");
6247
6261
  let sep = " ";
6248
- let pos = first.lastIndex;
6249
- line.lastIndex = pos;
6262
+ let pos = line.lastIndex;
6250
6263
  while (match = line.exec(source)) {
6251
- if (match[1] === "") {
6264
+ const lm = match[1].replace(trimBoth, "");
6265
+ if (lm === "") {
6252
6266
  if (sep === `
6253
6267
  `)
6254
6268
  res += sep;
@@ -6256,7 +6270,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
6256
6270
  sep = `
6257
6271
  `;
6258
6272
  } else {
6259
- res += sep + match[1];
6273
+ res += sep + lm;
6260
6274
  sep = " ";
6261
6275
  }
6262
6276
  pos = line.lastIndex;
@@ -6294,7 +6308,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
6294
6308
  while (next === " " || next === "\t")
6295
6309
  next = source[++i + 1];
6296
6310
  } else if (next === "x" || next === "u" || next === "U") {
6297
- const length = { x: 2, u: 4, U: 8 }[next];
6311
+ const length = next === "x" ? 2 : next === "u" ? 4 : 8;
6298
6312
  res += parseCharCode(source, i + 1, length, onError);
6299
6313
  i += length;
6300
6314
  } else {
@@ -6363,17 +6377,18 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
6363
6377
  const cc = source.substr(offset, length);
6364
6378
  const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
6365
6379
  const code = ok ? parseInt(cc, 16) : NaN;
6366
- if (isNaN(code)) {
6380
+ try {
6381
+ return String.fromCodePoint(code);
6382
+ } catch {
6367
6383
  const raw = source.substr(offset - 2, length + 2);
6368
6384
  onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
6369
6385
  return raw;
6370
6386
  }
6371
- return String.fromCodePoint(code);
6372
6387
  }
6373
6388
  exports.resolveFlowScalar = resolveFlowScalar;
6374
6389
  });
6375
6390
 
6376
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.js
6391
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-scalar.js
6377
6392
  var require_compose_scalar = __commonJS((exports) => {
6378
6393
  var identity = require_identity();
6379
6394
  var Scalar = require_Scalar();
@@ -6451,7 +6466,7 @@ var require_compose_scalar = __commonJS((exports) => {
6451
6466
  exports.composeScalar = composeScalar;
6452
6467
  });
6453
6468
 
6454
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.js
6469
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js
6455
6470
  var require_util_empty_scalar_position = __commonJS((exports) => {
6456
6471
  function emptyScalarPosition(offset, before, pos) {
6457
6472
  if (before) {
@@ -6478,7 +6493,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
6478
6493
  exports.emptyScalarPosition = emptyScalarPosition;
6479
6494
  });
6480
6495
 
6481
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.js
6496
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-node.js
6482
6497
  var require_compose_node = __commonJS((exports) => {
6483
6498
  var Alias = require_Alias();
6484
6499
  var identity = require_identity();
@@ -6509,17 +6524,22 @@ var require_compose_node = __commonJS((exports) => {
6509
6524
  case "block-map":
6510
6525
  case "block-seq":
6511
6526
  case "flow-collection":
6512
- node = composeCollection.composeCollection(CN, ctx, token, props, onError);
6513
- if (anchor)
6514
- node.anchor = anchor.source.substring(1);
6527
+ try {
6528
+ node = composeCollection.composeCollection(CN, ctx, token, props, onError);
6529
+ if (anchor)
6530
+ node.anchor = anchor.source.substring(1);
6531
+ } catch (error) {
6532
+ const message = error instanceof Error ? error.message : String(error);
6533
+ onError(token, "RESOURCE_EXHAUSTION", message);
6534
+ }
6515
6535
  break;
6516
6536
  default: {
6517
6537
  const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
6518
6538
  onError(token, "UNEXPECTED_TOKEN", message);
6519
- node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
6520
6539
  isSrcToken = false;
6521
6540
  }
6522
6541
  }
6542
+ node ?? (node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError));
6523
6543
  if (anchor && node.anchor === "")
6524
6544
  onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
6525
6545
  if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
@@ -6576,7 +6596,7 @@ var require_compose_node = __commonJS((exports) => {
6576
6596
  exports.composeNode = composeNode;
6577
6597
  });
6578
6598
 
6579
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.js
6599
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-doc.js
6580
6600
  var require_compose_doc = __commonJS((exports) => {
6581
6601
  var Document = require_Document();
6582
6602
  var composeNode = require_compose_node();
@@ -6616,7 +6636,7 @@ var require_compose_doc = __commonJS((exports) => {
6616
6636
  exports.composeDoc = composeDoc;
6617
6637
  });
6618
6638
 
6619
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/compose/composer.js
6639
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js
6620
6640
  var require_composer = __commonJS((exports) => {
6621
6641
  var node_process = __require("process");
6622
6642
  var directives = require_directives();
@@ -6702,8 +6722,10 @@ ${cb}` : comment;
6702
6722
  }
6703
6723
  }
6704
6724
  if (afterDoc) {
6705
- Array.prototype.push.apply(doc.errors, this.errors);
6706
- Array.prototype.push.apply(doc.warnings, this.warnings);
6725
+ for (let i = 0;i < this.errors.length; ++i)
6726
+ doc.errors.push(this.errors[i]);
6727
+ for (let i = 0;i < this.warnings.length; ++i)
6728
+ doc.warnings.push(this.warnings[i]);
6707
6729
  } else {
6708
6730
  doc.errors = this.errors;
6709
6731
  doc.warnings = this.warnings;
@@ -6805,7 +6827,7 @@ ${end.comment}` : end.comment;
6805
6827
  exports.Composer = Composer;
6806
6828
  });
6807
6829
 
6808
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.js
6830
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst-scalar.js
6809
6831
  var require_cst_scalar = __commonJS((exports) => {
6810
6832
  var resolveBlockScalar = require_resolve_block_scalar();
6811
6833
  var resolveFlowScalar = require_resolve_flow_scalar();
@@ -6995,7 +7017,7 @@ var require_cst_scalar = __commonJS((exports) => {
6995
7017
  exports.setScalarValue = setScalarValue;
6996
7018
  });
6997
7019
 
6998
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.js
7020
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst-stringify.js
6999
7021
  var require_cst_stringify = __commonJS((exports) => {
7000
7022
  var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
7001
7023
  function stringifyToken(token) {
@@ -7053,7 +7075,7 @@ var require_cst_stringify = __commonJS((exports) => {
7053
7075
  exports.stringify = stringify;
7054
7076
  });
7055
7077
 
7056
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.js
7078
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst-visit.js
7057
7079
  var require_cst_visit = __commonJS((exports) => {
7058
7080
  var BREAK = Symbol("break visit");
7059
7081
  var SKIP = Symbol("skip children");
@@ -7112,7 +7134,7 @@ var require_cst_visit = __commonJS((exports) => {
7112
7134
  exports.visit = visit;
7113
7135
  });
7114
7136
 
7115
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/parse/cst.js
7137
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js
7116
7138
  var require_cst = __commonJS((exports) => {
7117
7139
  var cstScalar = require_cst_scalar();
7118
7140
  var cstStringify = require_cst_stringify();
@@ -7213,7 +7235,7 @@ var require_cst = __commonJS((exports) => {
7213
7235
  exports.tokenType = tokenType;
7214
7236
  });
7215
7237
 
7216
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.js
7238
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/lexer.js
7217
7239
  var require_lexer = __commonJS((exports) => {
7218
7240
  var cst = require_cst();
7219
7241
  function isEmpty(ch) {
@@ -7415,7 +7437,7 @@ var require_lexer = __commonJS((exports) => {
7415
7437
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
7416
7438
  this.indentNext = this.indentValue + 1;
7417
7439
  this.indentValue += n;
7418
- return yield* this.parseBlockStart();
7440
+ return "block-start";
7419
7441
  }
7420
7442
  return "doc";
7421
7443
  }
@@ -7722,26 +7744,37 @@ var require_lexer = __commonJS((exports) => {
7722
7744
  return 0;
7723
7745
  }
7724
7746
  *pushIndicators() {
7725
- switch (this.charAt(0)) {
7726
- case "!":
7727
- return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
7728
- case "&":
7729
- return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
7730
- case "-":
7731
- case "?":
7732
- case ":": {
7733
- const inFlow = this.flowLevel > 0;
7734
- const ch1 = this.charAt(1);
7735
- if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
7736
- if (!inFlow)
7737
- this.indentNext = this.indentValue + 1;
7738
- else if (this.flowKey)
7739
- this.flowKey = false;
7740
- return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
7747
+ let n = 0;
7748
+ loop:
7749
+ while (true) {
7750
+ switch (this.charAt(0)) {
7751
+ case "!":
7752
+ n += yield* this.pushTag();
7753
+ n += yield* this.pushSpaces(true);
7754
+ continue loop;
7755
+ case "&":
7756
+ n += yield* this.pushUntil(isNotAnchorChar);
7757
+ n += yield* this.pushSpaces(true);
7758
+ continue loop;
7759
+ case "-":
7760
+ case "?":
7761
+ case ":": {
7762
+ const inFlow = this.flowLevel > 0;
7763
+ const ch1 = this.charAt(1);
7764
+ if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
7765
+ if (!inFlow)
7766
+ this.indentNext = this.indentValue + 1;
7767
+ else if (this.flowKey)
7768
+ this.flowKey = false;
7769
+ n += yield* this.pushCount(1);
7770
+ n += yield* this.pushSpaces(true);
7771
+ continue loop;
7772
+ }
7773
+ }
7741
7774
  }
7775
+ break loop;
7742
7776
  }
7743
- }
7744
- return 0;
7777
+ return n;
7745
7778
  }
7746
7779
  *pushTag() {
7747
7780
  if (this.charAt(1) === "<") {
@@ -7799,7 +7832,7 @@ var require_lexer = __commonJS((exports) => {
7799
7832
  exports.Lexer = Lexer;
7800
7833
  });
7801
7834
 
7802
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.js
7835
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js
7803
7836
  var require_line_counter = __commonJS((exports) => {
7804
7837
  class LineCounter {
7805
7838
  constructor() {
@@ -7827,7 +7860,7 @@ var require_line_counter = __commonJS((exports) => {
7827
7860
  exports.LineCounter = LineCounter;
7828
7861
  });
7829
7862
 
7830
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/parse/parser.js
7863
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/parser.js
7831
7864
  var require_parser = __commonJS((exports) => {
7832
7865
  var node_process = __require("process");
7833
7866
  var cst = require_cst();
@@ -7895,6 +7928,13 @@ var require_parser = __commonJS((exports) => {
7895
7928
  while (prev[++i]?.type === "space") {}
7896
7929
  return prev.splice(i, prev.length);
7897
7930
  }
7931
+ function arrayPushArray(target, source) {
7932
+ if (source.length < 1e5)
7933
+ Array.prototype.push.apply(target, source);
7934
+ else
7935
+ for (let i = 0;i < source.length; ++i)
7936
+ target.push(source[i]);
7937
+ }
7898
7938
  function fixFlowSeqItems(fc) {
7899
7939
  if (fc.start.type === "flow-seq-start") {
7900
7940
  for (const it of fc.items) {
@@ -7904,11 +7944,11 @@ var require_parser = __commonJS((exports) => {
7904
7944
  delete it.key;
7905
7945
  if (isFlowToken(it.value)) {
7906
7946
  if (it.value.end)
7907
- Array.prototype.push.apply(it.value.end, it.sep);
7947
+ arrayPushArray(it.value.end, it.sep);
7908
7948
  else
7909
7949
  it.value.end = it.sep;
7910
7950
  } else
7911
- Array.prototype.push.apply(it.start, it.sep);
7951
+ arrayPushArray(it.start, it.sep);
7912
7952
  delete it.sep;
7913
7953
  }
7914
7954
  }
@@ -8248,7 +8288,7 @@ var require_parser = __commonJS((exports) => {
8248
8288
  const prev = map.items[map.items.length - 2];
8249
8289
  const end = prev?.value?.end;
8250
8290
  if (Array.isArray(end)) {
8251
- Array.prototype.push.apply(end, it.start);
8291
+ arrayPushArray(end, it.start);
8252
8292
  end.push(this.sourceToken);
8253
8293
  map.items.pop();
8254
8294
  return;
@@ -8436,7 +8476,7 @@ var require_parser = __commonJS((exports) => {
8436
8476
  const prev = seq.items[seq.items.length - 2];
8437
8477
  const end = prev?.value?.end;
8438
8478
  if (Array.isArray(end)) {
8439
- Array.prototype.push.apply(end, it.start);
8479
+ arrayPushArray(end, it.start);
8440
8480
  end.push(this.sourceToken);
8441
8481
  seq.items.pop();
8442
8482
  return;
@@ -8676,7 +8716,7 @@ var require_parser = __commonJS((exports) => {
8676
8716
  exports.Parser = Parser;
8677
8717
  });
8678
8718
 
8679
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/public-api.js
8719
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/public-api.js
8680
8720
  var require_public_api = __commonJS((exports) => {
8681
8721
  var composer = require_composer();
8682
8722
  var Document = require_Document();
@@ -8770,7 +8810,7 @@ var require_public_api = __commonJS((exports) => {
8770
8810
  exports.stringify = stringify;
8771
8811
  });
8772
8812
 
8773
- // ../../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/index.js
8813
+ // ../../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/index.js
8774
8814
  var require_dist = __commonJS((exports) => {
8775
8815
  var composer = require_composer();
8776
8816
  var Document = require_Document();
@@ -9797,7 +9837,7 @@ function getCredentialsFile() {
9797
9837
  }
9798
9838
  var CREDENTIALS_BACKEND = process.env.PAIRIT_CREDENTIALS_BACKEND || "keychain";
9799
9839
  var KEYCHAIN_SERVICE = "pairit-cli";
9800
- var KEYTAR_MODULE_SPECIFIER = "keytar";
9840
+ var KEYRING_MODULE_SPECIFIER = "@napi-rs/keyring";
9801
9841
  async function serverSupportsPkce() {
9802
9842
  try {
9803
9843
  const response = await fetch(`${getApiUrl()}/api/cli/login-info`, {
@@ -9929,10 +9969,12 @@ async function getAuthHeaders() {
9929
9969
  }
9930
9970
  async function saveCredentials(creds) {
9931
9971
  if (CREDENTIALS_BACKEND !== "file") {
9932
- const keytar = await loadKeytar();
9933
- if (keytar) {
9934
- await keytar.setPassword(KEYCHAIN_SERVICE, getCredentialKey(), JSON.stringify(creds));
9935
- return;
9972
+ const entry = await loadKeyringEntry();
9973
+ if (entry) {
9974
+ try {
9975
+ await entry.setPassword(JSON.stringify(creds));
9976
+ return;
9977
+ } catch {}
9936
9978
  }
9937
9979
  }
9938
9980
  await writeCredentialsFile(CONFIG_DIR, getCredentialsFile(), JSON.stringify(creds, null, 2));
@@ -9945,16 +9987,18 @@ async function writeCredentialsFile(dir, file, contents) {
9945
9987
  }
9946
9988
  async function getCredentials() {
9947
9989
  if (CREDENTIALS_BACKEND !== "file") {
9948
- const keytar = await loadKeytar();
9949
- if (keytar) {
9950
- const stored = await keytar.getPassword(KEYCHAIN_SERVICE, getCredentialKey());
9951
- if (stored) {
9952
- try {
9953
- return JSON.parse(stored);
9954
- } catch {
9955
- return null;
9990
+ const entry = await loadKeyringEntry();
9991
+ if (entry) {
9992
+ try {
9993
+ const stored = await entry.getPassword();
9994
+ if (stored) {
9995
+ try {
9996
+ return JSON.parse(stored);
9997
+ } catch {
9998
+ return null;
9999
+ }
9956
10000
  }
9957
- }
10001
+ } catch {}
9958
10002
  }
9959
10003
  }
9960
10004
  try {
@@ -9988,14 +10032,16 @@ function canAttemptBrowserLogin() {
9988
10032
  }
9989
10033
  return process.platform === "darwin" || process.platform === "win32" || Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
9990
10034
  }
9991
- async function loadKeytar() {
10035
+ async function loadKeyringEntry() {
9992
10036
  try {
9993
10037
  const runtimeImport = new Function("s", "return import(s)");
9994
- const mod = await runtimeImport(KEYTAR_MODULE_SPECIFIER);
9995
- if (mod && typeof mod === "object" && "default" in mod) {
9996
- return mod.default;
9997
- }
9998
- return mod;
10038
+ const mod = await runtimeImport(KEYRING_MODULE_SPECIFIER);
10039
+ const AsyncEntry = mod?.AsyncEntry ?? mod?.default?.AsyncEntry;
10040
+ if (!AsyncEntry)
10041
+ return null;
10042
+ return new AsyncEntry(KEYCHAIN_SERVICE, getCredentialKey(), {
10043
+ linux: { store: "secret-service" }
10044
+ });
9999
10045
  } catch {
10000
10046
  return null;
10001
10047
  }
@@ -10444,7 +10490,7 @@ function lintEndRedirectUrls(config) {
10444
10490
 
10445
10491
  // src/index.ts
10446
10492
  var program2 = new Command;
10447
- program2.name("pairit").description("CLI for Pairit experiment configs").version("0.3.10").option("--env <name>", "Target environment: staging or production", (value) => {
10493
+ program2.name("pairit").description("CLI for Pairit experiment configs").version("0.3.11").option("--env <name>", "Target environment: staging or production", (value) => {
10448
10494
  try {
10449
10495
  return parseEnvName(value);
10450
10496
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pairit",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "CLI for the Pairit behavioral science experiment platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "homepage": "https://docs.pairium.ai/pairit/",
29
29
  "license": "MIT",
30
30
  "optionalDependencies": {
31
- "keytar": "^7.9.0"
31
+ "@napi-rs/keyring": "^2.1.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/bun": "^1.1.13",