@voidzero-dev/vite-plus-core 0.2.7 → 0.2.9

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 (75) hide show
  1. package/LICENSE +65 -1
  2. package/dist/rolldown/cli.mjs +17 -14
  3. package/dist/rolldown/config.d.mts +1 -1
  4. package/dist/rolldown/config.mjs +2 -2
  5. package/dist/rolldown/experimental-default-runtime.mjs +116 -0
  6. package/dist/rolldown/experimental-index.d.mts +10 -4
  7. package/dist/rolldown/experimental-index.mjs +32 -16
  8. package/dist/rolldown/experimental-runtime-base.mjs +95 -0
  9. package/dist/rolldown/experimental-runtime.d.ts +177 -0
  10. package/dist/rolldown/experimental-runtime.mjs +257 -0
  11. package/dist/rolldown/filter-index.d.mts +1 -1
  12. package/dist/rolldown/filter-index.mjs +1 -3
  13. package/dist/rolldown/index.d.mts +3 -3
  14. package/dist/rolldown/index.mjs +4 -4
  15. package/dist/rolldown/parallel-plugin-worker.mjs +3 -3
  16. package/dist/rolldown/parallel-plugin.d.mts +1 -1
  17. package/dist/rolldown/parse-ast-index.d.mts +1 -1
  18. package/dist/rolldown/parse-ast-index.mjs +2 -2
  19. package/dist/rolldown/plugins-index.d.mts +3 -3
  20. package/dist/rolldown/plugins-index.mjs +2 -2
  21. package/dist/rolldown/shared/binding-CKyeQZen.mjs +673 -0
  22. package/dist/rolldown/shared/{binding-Dbbi0RbO.d.mts → binding-CVtkJvyl.d.mts} +11 -0
  23. package/dist/rolldown/shared/{bindingify-input-options-DVQ4K-zY.mjs → bindingify-input-options-44iPAymO.mjs} +449 -273
  24. package/dist/rolldown/shared/{constructors-CuGa75s-.mjs → constructors-6Zc-JFd7.mjs} +10 -6
  25. package/dist/rolldown/shared/{constructors-CSWbNgBZ.d.mts → constructors-XaIbWpwJ.d.mts} +2 -2
  26. package/dist/rolldown/shared/{rolldown-build-BGXNOfvH.mjs → create-bundler-option-e1FU0w0P.mjs} +72 -179
  27. package/dist/rolldown/shared/{define-config-B-IDOhDz.d.mts → define-config-DVsXPNaU.d.mts} +85 -26
  28. package/dist/rolldown/shared/{error-DFGNOCle.mjs → error-BzLGqhSQ.mjs} +1 -1
  29. package/dist/rolldown/shared/{load-config-R0z2olkB.mjs → load-config-C6QXSnoS.mjs} +2 -2
  30. package/dist/rolldown/shared/{logs-ZGEh6uhb.mjs → logs-DmYCAKcW.mjs} +8 -1
  31. package/dist/rolldown/shared/{misc-CoQm4NHO.mjs → misc-DOSKtd97.mjs} +9 -1
  32. package/dist/rolldown/shared/{normalize-string-or-regex-SiXbePVH.mjs → normalize-string-or-regex-DYjJ67tj.mjs} +2 -2
  33. package/dist/rolldown/shared/{parse-D5dkElpf.mjs → parse-uDDyc1el.mjs} +2 -2
  34. package/dist/rolldown/shared/{prompt-pZFoa1TT.mjs → prompt-uaCPq0_A.mjs} +2 -6
  35. package/dist/rolldown/shared/{resolve-tsconfig-2TXRF_zr.mjs → resolve-tsconfig-Bcd82vVT.mjs} +2 -2
  36. package/dist/rolldown/shared/rolldown-CCbQNGZt.mjs +178 -0
  37. package/dist/rolldown/shared/{transform-Cs2bUDRH.d.mts → transform-WmU_cI8e.d.mts} +1 -1
  38. package/dist/rolldown/shared/{watch-DVucf-VG.mjs → watch-vuOCmvFs.mjs} +17 -14
  39. package/dist/rolldown/utils-index.d.mts +3 -3
  40. package/dist/rolldown/utils-index.mjs +15 -13
  41. package/dist/tsdown/{build-D_enfyvD-DX5mX46j.js → build-D_enfyvD-Dg1eKRD4.js} +22 -19
  42. package/dist/tsdown/{debug-CKcBYQLP-GQrJ--dM.js → debug-CKcBYQLP-C3NhYhrk.js} +4 -6
  43. package/dist/tsdown/{detect-DGhJGEqb-Cz6qOZuP.js → detect-DGhJGEqb-6CTf16BW.js} +1 -1
  44. package/dist/tsdown/{dist-DCMiHFrJ.js → dist-CMKwGGNp.js} +1 -3
  45. package/dist/tsdown/{dist-CWolxbYK.js → dist-DyXLnzyh.js} +43 -10
  46. package/dist/tsdown/index-types.d.ts +6 -6
  47. package/dist/tsdown/index.js +4 -4
  48. package/dist/tsdown/internal-DKworeK4.js +3 -0
  49. package/dist/tsdown/{main-DI8qthUB.js → main-DiierkER.js} +211 -197
  50. package/dist/tsdown/npm_entry_picomatch.cjs +11 -7
  51. package/dist/tsdown/npm_entry_tree-kill.cjs +15 -15
  52. package/dist/tsdown/{resolver-cwLsPb2o-DvUqSYux.js → resolver-cwLsPb2o-Dk4xdAGE.js} +3 -3
  53. package/dist/tsdown/run.js +6 -6
  54. package/dist/tsdown/{src-CPDzmpAq.js → src-drVPfX63.js} +5 -5
  55. package/dist/tsdown/{target-Bab3CUeB-Di6tCARH.js → target-Bab3CUeB-DQ0pKhCv.js} +6 -6
  56. package/dist/tsdown/{tsc-BQoNcjeB.js → tsc-JnMl2z7d.js} +4 -5
  57. package/dist/tsdown/tsdown-css.js +7 -9
  58. package/dist/tsdown/tsdown-exe.js +4 -4
  59. package/dist/vite/client/bundledDevClient.mjs +1781 -0
  60. package/dist/vite/client/client.mjs +67 -92
  61. package/dist/vite/node/chunks/build.js +98 -88
  62. package/dist/vite/node/chunks/dist.js +62 -114
  63. package/dist/vite/node/chunks/dist2.js +198 -159
  64. package/dist/vite/node/chunks/node.js +3690 -3135
  65. package/dist/vite/node/chunks/postcss-import.js +20 -19
  66. package/dist/vite/node/index.d.ts +73 -17
  67. package/dist/vite/node/module-runner.js +42 -26
  68. package/dist/vite/types/customEvent.d.ts +3 -1
  69. package/dist/vite/types/hmrPayload.d.ts +20 -6
  70. package/package.json +36 -16
  71. package/dist/rolldown/shared/binding-Dby9rwGk.mjs +0 -588
  72. package/dist/rolldown/shared/rolldown-BnV7isAX.mjs +0 -40
  73. package/dist/tsdown/internal-DAh_SWnB.js +0 -3
  74. package/dist/tsdown/load-tsc-BKULZsrs-Bha6Vsu1.js +0 -18
  75. package/dist/tsdown/tsc-context-BhMGQ9Qr.js +0 -23
@@ -227,9 +227,10 @@ var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
227
227
  function replaceNode(key, path, node) {
228
228
  const parent = path[path.length - 1];
229
229
  if (identity.isCollection(parent)) parent.items[key] = node;
230
- else if (identity.isPair(parent)) if (key === "key") parent.key = node;
231
- else parent.value = node;
232
- else if (identity.isDocument(parent)) parent.contents = node;
230
+ else if (identity.isPair(parent)) {
231
+ if (key === "key") parent.key = node;
232
+ else parent.value = node;
233
+ } else if (identity.isDocument(parent)) parent.contents = node;
233
234
  else {
234
235
  const pt = identity.isAlias(parent) ? "alias" : "scalar";
235
236
  throw new Error(`Cannot replace node with ${pt} parent`);
@@ -286,7 +287,6 @@ var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => {
286
287
  version: "1.2"
287
288
  };
288
289
  this.tags = Object.assign({}, Directives.defaultTags);
289
- break;
290
290
  }
291
291
  return res;
292
292
  }
@@ -481,30 +481,32 @@ var require_applyReviver = /* @__PURE__ */ __commonJSMin(((exports) => {
481
481
  * Includes extensions for handling Map and Set objects.
482
482
  */
483
483
  function applyReviver(reviver, obj, key, val) {
484
- if (val && typeof val === "object") if (Array.isArray(val)) for (let i = 0, len = val.length; i < len; ++i) {
485
- const v0 = val[i];
486
- const v1 = applyReviver(reviver, val, String(i), v0);
487
- if (v1 === void 0) delete val[i];
488
- else if (v1 !== v0) val[i] = v1;
489
- }
490
- else if (val instanceof Map) for (const k of Array.from(val.keys())) {
491
- const v0 = val.get(k);
492
- const v1 = applyReviver(reviver, val, k, v0);
493
- if (v1 === void 0) val.delete(k);
494
- else if (v1 !== v0) val.set(k, v1);
495
- }
496
- else if (val instanceof Set) for (const v0 of Array.from(val)) {
497
- const v1 = applyReviver(reviver, val, v0, v0);
498
- if (v1 === void 0) val.delete(v0);
499
- else if (v1 !== v0) {
500
- val.delete(v0);
501
- val.add(v1);
502
- }
503
- }
504
- else for (const [k, v0] of Object.entries(val)) {
505
- const v1 = applyReviver(reviver, val, k, v0);
506
- if (v1 === void 0) delete val[k];
507
- else if (v1 !== v0) val[k] = v1;
484
+ if (val && typeof val === "object") {
485
+ if (Array.isArray(val)) for (let i = 0, len = val.length; i < len; ++i) {
486
+ const v0 = val[i];
487
+ const v1 = applyReviver(reviver, val, String(i), v0);
488
+ if (v1 === void 0) delete val[i];
489
+ else if (v1 !== v0) val[i] = v1;
490
+ }
491
+ else if (val instanceof Map) for (const k of Array.from(val.keys())) {
492
+ const v0 = val.get(k);
493
+ const v1 = applyReviver(reviver, val, k, v0);
494
+ if (v1 === void 0) val.delete(k);
495
+ else if (v1 !== v0) val.set(k, v1);
496
+ }
497
+ else if (val instanceof Set) for (const v0 of Array.from(val)) {
498
+ const v1 = applyReviver(reviver, val, v0, v0);
499
+ if (v1 === void 0) val.delete(v0);
500
+ else if (v1 !== v0) {
501
+ val.delete(v0);
502
+ val.add(v1);
503
+ }
504
+ }
505
+ else for (const [k, v0] of Object.entries(val)) {
506
+ const v1 = applyReviver(reviver, val, k, v0);
507
+ if (v1 === void 0) delete val[k];
508
+ else if (v1 !== v0) val[k] = v1;
509
+ }
508
510
  }
509
511
  return reviver.call(obj, key, val);
510
512
  }
@@ -925,8 +927,10 @@ var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
925
927
  const folds = [];
926
928
  const escapedFolds = {};
927
929
  let end = lineWidth - indent.length;
928
- if (typeof indentAtStart === "number") if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);
929
- else end = lineWidth - indentAtStart;
930
+ if (typeof indentAtStart === "number") {
931
+ if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);
932
+ else end = lineWidth - indentAtStart;
933
+ }
930
934
  let split = void 0;
931
935
  let prev = void 0;
932
936
  let overflow = false;
@@ -963,23 +967,25 @@ var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
963
967
  const next = text[i + 1];
964
968
  if (next && next !== " " && next !== "\n" && next !== " ") split = i;
965
969
  }
966
- if (i >= end) if (split) {
967
- folds.push(split);
968
- end = split + endStep;
969
- split = void 0;
970
- } else if (mode === FOLD_QUOTED) {
971
- while (prev === " " || prev === " ") {
972
- prev = ch;
973
- ch = text[i += 1];
974
- overflow = true;
975
- }
976
- const j = i > escEnd + 1 ? i - 2 : escStart - 1;
977
- if (escapedFolds[j]) return text;
978
- folds.push(j);
979
- escapedFolds[j] = true;
980
- end = j + endStep;
981
- split = void 0;
982
- } else overflow = true;
970
+ if (i >= end) {
971
+ if (split) {
972
+ folds.push(split);
973
+ end = split + endStep;
974
+ split = void 0;
975
+ } else if (mode === FOLD_QUOTED) {
976
+ while (prev === " " || prev === " ") {
977
+ prev = ch;
978
+ ch = text[i += 1];
979
+ overflow = true;
980
+ }
981
+ const j = i > escEnd + 1 ? i - 2 : escStart - 1;
982
+ if (escapedFolds[j]) return text;
983
+ folds.push(j);
984
+ escapedFolds[j] = true;
985
+ end = j + endStep;
986
+ split = void 0;
987
+ } else overflow = true;
988
+ }
983
989
  }
984
990
  prev = ch;
985
991
  }
@@ -1138,7 +1144,7 @@ var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => {
1138
1144
  }
1139
1145
  let blockEndNewlines;
1140
1146
  try {
1141
- blockEndNewlines = /* @__PURE__ */ new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
1147
+ blockEndNewlines = new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
1142
1148
  } catch {
1143
1149
  blockEndNewlines = /\n+(?!\n|$)/g;
1144
1150
  }
@@ -1455,8 +1461,10 @@ var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
1455
1461
  if (logLevel === "debug") console.log(...messages);
1456
1462
  }
1457
1463
  function warn(logLevel, warning) {
1458
- if (logLevel === "debug" || logLevel === "warn") if (typeof node_process$2.emitWarning === "function") node_process$2.emitWarning(warning);
1459
- else console.warn(warning);
1464
+ if (logLevel === "debug" || logLevel === "warn") {
1465
+ if (typeof node_process$2.emitWarning === "function") node_process$2.emitWarning(warning);
1466
+ else console.warn(warning);
1467
+ }
1460
1468
  }
1461
1469
  exports.debug = debug;
1462
1470
  exports.warn = warn;
@@ -2281,11 +2289,12 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => {
2281
2289
  if (iterable && Symbol.iterator in Object(iterable)) for (let it of iterable) {
2282
2290
  if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it);
2283
2291
  let key, value;
2284
- if (Array.isArray(it)) if (it.length === 2) {
2285
- key = it[0];
2286
- value = it[1];
2287
- } else throw new TypeError(`Expected [key, value] tuple: ${it}`);
2288
- else if (it && it instanceof Object) {
2292
+ if (Array.isArray(it)) {
2293
+ if (it.length === 2) {
2294
+ key = it[0];
2295
+ value = it[1];
2296
+ } else throw new TypeError(`Expected [key, value] tuple: ${it}`);
2297
+ } else if (it && it instanceof Object) {
2289
2298
  const keys = Object.keys(it);
2290
2299
  if (keys.length === 1) {
2291
2300
  key = keys[0];
@@ -2361,8 +2370,10 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => {
2361
2370
  resolve(seq, onError) {
2362
2371
  const pairs$1 = pairs.resolvePairs(seq, onError);
2363
2372
  const seenKeys = [];
2364
- for (const { key } of pairs$1.items) if (identity.isScalar(key)) if (seenKeys.includes(key.value)) onError(`Ordered maps must not include duplicate keys: ${key.value}`);
2365
- else seenKeys.push(key.value);
2373
+ for (const { key } of pairs$1.items) if (identity.isScalar(key)) {
2374
+ if (seenKeys.includes(key.value)) onError(`Ordered maps must not include duplicate keys: ${key.value}`);
2375
+ else seenKeys.push(key.value);
2376
+ }
2366
2377
  return Object.assign(new YAMLOMap(), pairs$1);
2367
2378
  },
2368
2379
  createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
@@ -2458,9 +2469,7 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports) => {
2458
2469
  case 8:
2459
2470
  str = `0o${str}`;
2460
2471
  break;
2461
- case 16:
2462
- str = `0x${str}`;
2463
- break;
2472
+ case 16: str = `0x${str}`;
2464
2473
  }
2465
2474
  const n = BigInt(str);
2466
2475
  return sign === "-" ? BigInt(-1) * n : n;
@@ -2575,9 +2584,10 @@ var require_set = /* @__PURE__ */ __commonJSMin(((exports) => {
2575
2584
  tag: "tag:yaml.org,2002:set",
2576
2585
  createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
2577
2586
  resolve(map, onError) {
2578
- if (identity.isMap(map)) if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map);
2579
- else onError("Set items must all have null values");
2580
- else onError("Expected a mapping for this tag");
2587
+ if (identity.isMap(map)) {
2588
+ if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map);
2589
+ else onError("Set items must all have null values");
2590
+ } else onError("Expected a mapping for this tag");
2581
2591
  return map;
2582
2592
  }
2583
2593
  };
@@ -2769,10 +2779,12 @@ var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
2769
2779
  const schemaTags = schemas.get(schemaName);
2770
2780
  if (schemaTags && !customTags) return addMergeTag && !schemaTags.includes(merge.merge) ? schemaTags.concat(merge.merge) : schemaTags.slice();
2771
2781
  let tags = schemaTags;
2772
- if (!tags) if (Array.isArray(customTags)) tags = [];
2773
- else {
2774
- const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
2775
- throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
2782
+ if (!tags) {
2783
+ if (Array.isArray(customTags)) tags = [];
2784
+ else {
2785
+ const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
2786
+ throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
2787
+ }
2776
2788
  }
2777
2789
  if (Array.isArray(customTags)) for (const tag of customTags) tags = tags.concat(tag);
2778
2790
  else if (typeof customTags === "function") tags = customTags(tags.slice());
@@ -2860,14 +2872,15 @@ var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
2860
2872
  if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") lines[lines.length - 1] = `--- ${body}`;
2861
2873
  else lines.push(body);
2862
2874
  } else lines.push(stringify.stringify(doc.contents, ctx));
2863
- if (doc.directives?.docEnd) if (doc.comment) {
2864
- const cs = commentString(doc.comment);
2865
- if (cs.includes("\n")) {
2866
- lines.push("...");
2867
- lines.push(stringifyComment.indentComment(cs, ""));
2868
- } else lines.push(`... ${cs}`);
2869
- } else lines.push("...");
2870
- else {
2875
+ if (doc.directives?.docEnd) {
2876
+ if (doc.comment) {
2877
+ const cs = commentString(doc.comment);
2878
+ if (cs.includes("\n")) {
2879
+ lines.push("...");
2880
+ lines.push(stringifyComment.indentComment(cs, ""));
2881
+ } else lines.push(`... ${cs}`);
2882
+ } else lines.push("...");
2883
+ } else {
2871
2884
  let dc = doc.comment;
2872
2885
  if (dc && chompKeep) dc = dc.replace(/^\n+/, "");
2873
2886
  if (dc) {
@@ -3406,8 +3419,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
3406
3419
  }
3407
3420
  if (!keyProps.anchor && !keyProps.tag && !sep) {
3408
3421
  commentEnd = keyProps.end;
3409
- if (keyProps.comment) if (map.comment) map.comment += "\n" + keyProps.comment;
3410
- else map.comment = keyProps.comment;
3422
+ if (keyProps.comment) {
3423
+ if (map.comment) map.comment += "\n" + keyProps.comment;
3424
+ else map.comment = keyProps.comment;
3425
+ }
3411
3426
  continue;
3412
3427
  }
3413
3428
  if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
@@ -3440,8 +3455,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
3440
3455
  map.items.push(pair);
3441
3456
  } else {
3442
3457
  if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
3443
- if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3444
- else keyNode.comment = valueProps.comment;
3458
+ if (valueProps.comment) {
3459
+ if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3460
+ else keyNode.comment = valueProps.comment;
3461
+ }
3445
3462
  const pair = new Pair.Pair(keyNode);
3446
3463
  if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
3447
3464
  map.items.push(pair);
@@ -3478,12 +3495,15 @@ var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
3478
3495
  parentIndent: bs.indent,
3479
3496
  startOnNewline: true
3480
3497
  });
3481
- if (!props.found) if (props.anchor || props.tag || value) if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
3482
- else onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
3483
- else {
3484
- commentEnd = props.end;
3485
- if (props.comment) seq.comment = props.comment;
3486
- continue;
3498
+ if (!props.found) {
3499
+ if (props.anchor || props.tag || value) {
3500
+ if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
3501
+ else onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
3502
+ } else {
3503
+ commentEnd = props.end;
3504
+ if (props.comment) seq.comment = props.comment;
3505
+ continue;
3506
+ }
3487
3507
  }
3488
3508
  const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
3489
3509
  if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
@@ -3575,8 +3595,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
3575
3595
  if (!props.anchor && !props.tag && !sep && !value) {
3576
3596
  if (i === 0 && props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
3577
3597
  else if (i < fc.items.length - 1) onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`);
3578
- if (props.comment) if (coll.comment) coll.comment += "\n" + props.comment;
3579
- else coll.comment = props.comment;
3598
+ if (props.comment) {
3599
+ if (coll.comment) coll.comment += "\n" + props.comment;
3600
+ else coll.comment = props.comment;
3601
+ }
3580
3602
  offset = props.end;
3581
3603
  continue;
3582
3604
  }
@@ -3636,13 +3658,17 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
3636
3658
  }
3637
3659
  if (props.start < valueProps.found.offset - 1024) onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
3638
3660
  }
3639
- } else if (value) if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
3640
- else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
3661
+ } else if (value) {
3662
+ if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
3663
+ else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
3664
+ }
3641
3665
  const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null;
3642
3666
  if (valueNode) {
3643
3667
  if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
3644
- } else if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3645
- else keyNode.comment = valueProps.comment;
3668
+ } else if (valueProps.comment) {
3669
+ if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3670
+ else keyNode.comment = valueProps.comment;
3671
+ }
3646
3672
  const pair = new Pair.Pair(keyNode, valueNode);
3647
3673
  if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
3648
3674
  if (isMap) {
@@ -3676,8 +3702,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
3676
3702
  }
3677
3703
  if (ee.length > 0) {
3678
3704
  const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
3679
- if (end.comment) if (coll.comment) coll.comment += "\n" + end.comment;
3680
- else coll.comment = end.comment;
3705
+ if (end.comment) {
3706
+ if (coll.comment) coll.comment += "\n" + end.comment;
3707
+ else coll.comment = end.comment;
3708
+ }
3681
3709
  coll.range = [
3682
3710
  fc.offset,
3683
3711
  cePos,
@@ -3825,9 +3853,10 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
3825
3853
  value += sep + indent.slice(trimIndent) + content;
3826
3854
  sep = "\n";
3827
3855
  prevMoreIndented = true;
3828
- } else if (content === "") if (sep === "\n") value += "\n";
3829
- else sep = "\n";
3830
- else {
3856
+ } else if (content === "") {
3857
+ if (sep === "\n") value += "\n";
3858
+ else sep = "\n";
3859
+ } else {
3831
3860
  value += sep + content;
3832
3861
  sep = " ";
3833
3862
  prevMoreIndented = false;
@@ -3988,9 +4017,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
3988
4017
  badChar = `block scalar indicator ${source[0]}`;
3989
4018
  break;
3990
4019
  case "@":
3991
- case "`":
3992
- badChar = `reserved character ${source[0]}`;
3993
- break;
4020
+ case "`": badChar = `reserved character ${source[0]}`;
3994
4021
  }
3995
4022
  if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
3996
4023
  return foldLines(source);
@@ -4009,8 +4036,8 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
4009
4036
  */
4010
4037
  let first, line;
4011
4038
  try {
4012
- first = /* @__PURE__ */ new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
4013
- line = /* @__PURE__ */ new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
4039
+ first = new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
4040
+ line = new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
4014
4041
  } catch {
4015
4042
  first = /(.*?)[ \t]*\r?\n/sy;
4016
4043
  line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
@@ -4022,9 +4049,10 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
4022
4049
  let pos = first.lastIndex;
4023
4050
  line.lastIndex = pos;
4024
4051
  while (match = line.exec(source)) {
4025
- if (match[1] === "") if (sep === "\n") res += sep;
4026
- else sep = "\n";
4027
- else {
4052
+ if (match[1] === "") {
4053
+ if (sep === "\n") res += sep;
4054
+ else sep = "\n";
4055
+ } else {
4028
4056
  res += sep + match[1];
4029
4057
  sep = " ";
4030
4058
  }
@@ -4160,8 +4188,10 @@ var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
4160
4188
  function findScalarTagByName(schema, value, tagName, tagToken, onError) {
4161
4189
  if (tagName === "!") return schema[identity.SCALAR];
4162
4190
  const matchWithTest = [];
4163
- for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) if (tag.default && tag.test) matchWithTest.push(tag);
4164
- else return tag;
4191
+ for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) {
4192
+ if (tag.default && tag.test) matchWithTest.push(tag);
4193
+ else return tag;
4194
+ }
4165
4195
  for (const tag of matchWithTest) if (tag.test?.test(value)) return tag;
4166
4196
  const kt = schema.knownTags[tagName];
4167
4197
  if (kt && !kt.collection) {
@@ -4259,8 +4289,10 @@ var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => {
4259
4289
  if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
4260
4290
  if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) onError(tag ?? token, "NON_STRING_KEY", "With stringKeys, all keys must be strings");
4261
4291
  if (spaceBefore) node.spaceBefore = true;
4262
- if (comment) if (token.type === "scalar" && token.source === "") node.comment = comment;
4263
- else node.commentBefore = comment;
4292
+ if (comment) {
4293
+ if (token.type === "scalar" && token.source === "") node.comment = comment;
4294
+ else node.commentBefore = comment;
4295
+ }
4264
4296
  if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token;
4265
4297
  return node;
4266
4298
  }
@@ -5449,11 +5481,13 @@ var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => {
5449
5481
  end = i;
5450
5482
  } else if (isEmpty(ch)) {
5451
5483
  let next = this.buffer[i + 1];
5452
- if (ch === "\r") if (next === "\n") {
5453
- i += 1;
5454
- ch = "\n";
5455
- next = this.buffer[i + 1];
5456
- } else end = i;
5484
+ if (ch === "\r") {
5485
+ if (next === "\n") {
5486
+ i += 1;
5487
+ ch = "\n";
5488
+ next = this.buffer[i + 1];
5489
+ } else end = i;
5490
+ }
5457
5491
  if (next === "#" || inFlow && flowIndicatorChars.has(next)) break;
5458
5492
  if (ch === "\n") {
5459
5493
  const cs = this.continueScalar(i + 1);
@@ -5670,9 +5704,10 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
5670
5704
  for (const it of fc.items) if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) {
5671
5705
  if (it.key) it.value = it.key;
5672
5706
  delete it.key;
5673
- if (isFlowToken(it.value)) if (it.value.end) arrayPushArray(it.value.end, it.sep);
5674
- else it.value.end = it.sep;
5675
- else arrayPushArray(it.start, it.sep);
5707
+ if (isFlowToken(it.value)) {
5708
+ if (it.value.end) arrayPushArray(it.value.end, it.sep);
5709
+ else it.value.end = it.sep;
5710
+ } else arrayPushArray(it.start, it.sep);
5676
5711
  delete it.sep;
5677
5712
  }
5678
5713
  }
@@ -6107,58 +6142,60 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
6107
6142
  this.onKeyLine = true;
6108
6143
  return;
6109
6144
  case "map-value-ind":
6110
- if (it.explicitKey) if (!it.sep) if (includesToken(it.start, "newline")) Object.assign(it, {
6111
- key: null,
6112
- sep: [this.sourceToken]
6113
- });
6114
- else {
6115
- const start = getFirstKeyStartProps(it.start);
6116
- this.stack.push({
6117
- type: "block-map",
6118
- offset: this.offset,
6119
- indent: this.indent,
6120
- items: [{
6121
- start,
6145
+ if (it.explicitKey) {
6146
+ if (!it.sep) {
6147
+ if (includesToken(it.start, "newline")) Object.assign(it, {
6122
6148
  key: null,
6123
6149
  sep: [this.sourceToken]
6124
- }]
6125
- });
6126
- }
6127
- else if (it.value) map.items.push({
6128
- start: [],
6129
- key: null,
6130
- sep: [this.sourceToken]
6131
- });
6132
- else if (includesToken(it.sep, "map-value-ind")) this.stack.push({
6133
- type: "block-map",
6134
- offset: this.offset,
6135
- indent: this.indent,
6136
- items: [{
6137
- start,
6150
+ });
6151
+ else {
6152
+ const start = getFirstKeyStartProps(it.start);
6153
+ this.stack.push({
6154
+ type: "block-map",
6155
+ offset: this.offset,
6156
+ indent: this.indent,
6157
+ items: [{
6158
+ start,
6159
+ key: null,
6160
+ sep: [this.sourceToken]
6161
+ }]
6162
+ });
6163
+ }
6164
+ } else if (it.value) map.items.push({
6165
+ start: [],
6138
6166
  key: null,
6139
6167
  sep: [this.sourceToken]
6140
- }]
6141
- });
6142
- else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
6143
- const start = getFirstKeyStartProps(it.start);
6144
- const key = it.key;
6145
- const sep = it.sep;
6146
- sep.push(this.sourceToken);
6147
- delete it.key;
6148
- delete it.sep;
6149
- this.stack.push({
6168
+ });
6169
+ else if (includesToken(it.sep, "map-value-ind")) this.stack.push({
6150
6170
  type: "block-map",
6151
6171
  offset: this.offset,
6152
6172
  indent: this.indent,
6153
6173
  items: [{
6154
6174
  start,
6155
- key,
6156
- sep
6175
+ key: null,
6176
+ sep: [this.sourceToken]
6157
6177
  }]
6158
6178
  });
6159
- } else if (start.length > 0) it.sep = it.sep.concat(start, this.sourceToken);
6160
- else it.sep.push(this.sourceToken);
6161
- else if (!it.sep) Object.assign(it, {
6179
+ else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
6180
+ const start = getFirstKeyStartProps(it.start);
6181
+ const key = it.key;
6182
+ const sep = it.sep;
6183
+ sep.push(this.sourceToken);
6184
+ delete it.key;
6185
+ delete it.sep;
6186
+ this.stack.push({
6187
+ type: "block-map",
6188
+ offset: this.offset,
6189
+ indent: this.indent,
6190
+ items: [{
6191
+ start,
6192
+ key,
6193
+ sep
6194
+ }]
6195
+ });
6196
+ } else if (start.length > 0) it.sep = it.sep.concat(start, this.sourceToken);
6197
+ else it.sep.push(this.sourceToken);
6198
+ } else if (!it.sep) Object.assign(it, {
6162
6199
  key: null,
6163
6200
  sep: [this.sourceToken]
6164
6201
  });
@@ -6531,8 +6568,10 @@ var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => {
6531
6568
  const doc = parseDocument(src, options);
6532
6569
  if (!doc) return null;
6533
6570
  doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
6534
- if (doc.errors.length > 0) if (doc.options.logLevel !== "silent") throw doc.errors[0];
6535
- else doc.errors = [];
6571
+ if (doc.errors.length > 0) {
6572
+ if (doc.options.logLevel !== "silent") throw doc.errors[0];
6573
+ else doc.errors = [];
6574
+ }
6536
6575
  return doc.toJS(Object.assign({ reviver: _reviver }, options));
6537
6576
  }
6538
6577
  function stringify(value, replacer, options) {