@cloudflare/workers-utils 0.4.0 → 0.5.0

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.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { PATH_TO_DEPLOY_CONFIG } from './chunk-73TUG5Z7.mjs';
2
- export { ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, PATH_TO_DEPLOY_CONFIG, SERVICE_TAG_PREFIX, assertNever, constructWranglerConfig, formatCompatibilityDate, mapWorkerMetadataBindings } from './chunk-73TUG5Z7.mjs';
3
- import { __commonJS, __name, __require, __export, __toESM, __reExport } from './chunk-DCOBXSFB.mjs';
4
- import fs, { readFileSync as readFileSync$1, existsSync, statSync, writeFileSync } from 'node:fs';
5
- import path7, { resolve } from 'node:path';
6
- import { fileURLToPath } from 'node:url';
7
- import process2 from 'node:process';
1
+ export { assertNever, constructWranglerConfig, formatCompatibilityDate, mapWorkerMetadataBindings } from './chunk-H6ZOCMLW.mjs';
2
+ import { UserError, isRedirectedRawConfig, dedent, configFileName, formatConfigSnippet, FatalError, readFileSync, parseTOML, modify, applyEdits, format, dist_default, parseJSONC } from './chunk-WHXYFHDX.mjs';
3
+ export { APIError, CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, ParseError, UserError, configFileName, configFormat, createFatalError, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, indexLocation, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation } from './chunk-WHXYFHDX.mjs';
4
+ import { __commonJS, __name, __require, __export, __toESM, __reExport } from './chunk-UB4QLUTD.mjs';
5
+ export { ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, PATH_TO_DEPLOY_CONFIG, SERVICE_TAG_PREFIX } from './chunk-UB4QLUTD.mjs';
6
+ import fs, { statSync, existsSync, writeFileSync } from 'node:fs';
8
7
  import assert from 'node:assert';
8
+ import path4 from 'node:path';
9
9
  import os from 'node:os';
10
10
 
11
11
  // ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js
@@ -30,7 +30,7 @@ var require_XDGAppPaths = __commonJS({
30
30
  }
31
31
  __name(typeOf, "typeOf");
32
32
  function Adapt(adapter_) {
33
- var meta = adapter_.meta, path8 = adapter_.path, xdg = adapter_.xdg;
33
+ var meta = adapter_.meta, path5 = adapter_.path, xdg = adapter_.xdg;
34
34
  var XDGAppPaths_ = /* @__PURE__ */ function() {
35
35
  function XDGAppPaths_2(options_) {
36
36
  if (options_ === void 0) {
@@ -53,7 +53,7 @@ var require_XDGAppPaths = __commonJS({
53
53
  meta.mainFilename()
54
54
  ];
55
55
  var nameFallback = "$eval";
56
- var name = path8.parse(((_c = namePriorityList.find(function(e) {
56
+ var name = path5.parse(((_c = namePriorityList.find(function(e) {
57
57
  return isString2(e);
58
58
  })) !== null && _c !== void 0 ? _c : nameFallback) + suffix).name;
59
59
  XDGAppPaths.$name = /* @__PURE__ */ __name(function $name() {
@@ -74,28 +74,28 @@ var require_XDGAppPaths = __commonJS({
74
74
  }
75
75
  __name(finalPathSegment, "finalPathSegment");
76
76
  XDGAppPaths.cache = /* @__PURE__ */ __name(function cache(dirOptions) {
77
- return path8.join(xdg.cache(), finalPathSegment(dirOptions));
77
+ return path5.join(xdg.cache(), finalPathSegment(dirOptions));
78
78
  }, "cache");
79
79
  XDGAppPaths.config = /* @__PURE__ */ __name(function config(dirOptions) {
80
- return path8.join(xdg.config(), finalPathSegment(dirOptions));
80
+ return path5.join(xdg.config(), finalPathSegment(dirOptions));
81
81
  }, "config");
82
82
  XDGAppPaths.data = /* @__PURE__ */ __name(function data(dirOptions) {
83
- return path8.join(xdg.data(), finalPathSegment(dirOptions));
83
+ return path5.join(xdg.data(), finalPathSegment(dirOptions));
84
84
  }, "data");
85
85
  XDGAppPaths.runtime = /* @__PURE__ */ __name(function runtime(dirOptions) {
86
- return xdg.runtime() ? path8.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0;
86
+ return xdg.runtime() ? path5.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0;
87
87
  }, "runtime");
88
88
  XDGAppPaths.state = /* @__PURE__ */ __name(function state(dirOptions) {
89
- return path8.join(xdg.state(), finalPathSegment(dirOptions));
89
+ return path5.join(xdg.state(), finalPathSegment(dirOptions));
90
90
  }, "state");
91
91
  XDGAppPaths.configDirs = /* @__PURE__ */ __name(function configDirs(dirOptions) {
92
92
  return xdg.configDirs().map(function(s) {
93
- return path8.join(s, finalPathSegment(dirOptions));
93
+ return path5.join(s, finalPathSegment(dirOptions));
94
94
  });
95
95
  }, "configDirs");
96
96
  XDGAppPaths.dataDirs = /* @__PURE__ */ __name(function dataDirs(dirOptions) {
97
97
  return xdg.dataDirs().map(function(s) {
98
- return path8.join(s, finalPathSegment(dirOptions));
98
+ return path5.join(s, finalPathSegment(dirOptions));
99
99
  });
100
100
  }, "dataDirs");
101
101
  return XDGAppPaths;
@@ -121,7 +121,7 @@ var require_XDG = __commonJS({
121
121
  exports.__esModule = true;
122
122
  exports.Adapt = void 0;
123
123
  function Adapt(adapter_) {
124
- var env = adapter_.env, osPaths = adapter_.osPaths, path8 = adapter_.path;
124
+ var env = adapter_.env, osPaths = adapter_.osPaths, path5 = adapter_.path;
125
125
  var isMacOS = /^darwin$/i.test(adapter_.process.platform);
126
126
  var isWinOS = /^win/i.test(adapter_.process.platform);
127
127
  function baseDir() {
@@ -129,7 +129,7 @@ var require_XDG = __commonJS({
129
129
  }
130
130
  __name(baseDir, "baseDir");
131
131
  function valOrPath(val, pathSegments) {
132
- return val || path8.join.apply(path8, pathSegments);
132
+ return val || path5.join.apply(path5, pathSegments);
133
133
  }
134
134
  __name(valOrPath, "valOrPath");
135
135
  var linux = /* @__PURE__ */ __name(function() {
@@ -208,11 +208,11 @@ var require_XDG = __commonJS({
208
208
  XDG.state = extension.state;
209
209
  XDG.configDirs = /* @__PURE__ */ __name(function configDirs() {
210
210
  var pathList = env.get("XDG_CONFIG_DIRS");
211
- return __spreadArray([extension.config()], pathList ? pathList.split(path8.delimiter) : []);
211
+ return __spreadArray([extension.config()], pathList ? pathList.split(path5.delimiter) : []);
212
212
  }, "configDirs");
213
213
  XDG.dataDirs = /* @__PURE__ */ __name(function dataDirs() {
214
214
  var pathList = env.get("XDG_DATA_DIRS");
215
- return __spreadArray([extension.data()], pathList ? pathList.split(path8.delimiter) : []);
215
+ return __spreadArray([extension.data()], pathList ? pathList.split(path5.delimiter) : []);
216
216
  }, "dataDirs");
217
217
  return XDG;
218
218
  }
@@ -241,7 +241,7 @@ var require_OSPaths = __commonJS({
241
241
  }
242
242
  __name(isEmpty, "isEmpty");
243
243
  function Adapt(adapter_) {
244
- var env = adapter_.env, os2 = adapter_.os, path8 = adapter_.path;
244
+ var env = adapter_.env, os2 = adapter_.os, path5 = adapter_.path;
245
245
  var isWinOS = /^win/i.test(adapter_.process.platform);
246
246
  function normalizePath(path_) {
247
247
  return path_ ? adapter_.path.normalize(adapter_.path.join(path_, ".")) : void 0;
@@ -256,7 +256,7 @@ var require_OSPaths = __commonJS({
256
256
  typeof os2.homedir === "function" ? os2.homedir() : void 0,
257
257
  env.get("USERPROFILE"),
258
258
  env.get("HOME"),
259
- env.get("HOMEDRIVE") || env.get("HOMEPATH") ? path8.join(env.get("HOMEDRIVE") || "", env.get("HOMEPATH") || "") : void 0
259
+ env.get("HOMEDRIVE") || env.get("HOMEPATH") ? path5.join(env.get("HOMEDRIVE") || "", env.get("HOMEPATH") || "") : void 0
260
260
  ];
261
261
  return normalizePath(priorityList.find(function(v) {
262
262
  return !isEmpty(v);
@@ -267,7 +267,7 @@ var require_OSPaths = __commonJS({
267
267
  __name(home, "home");
268
268
  function temp() {
269
269
  function joinPathToBase(base, segments) {
270
- return base ? path8.join.apply(path8, __spreadArray([base], segments)) : void 0;
270
+ return base ? path5.join.apply(path5, __spreadArray([base], segments)) : void 0;
271
271
  }
272
272
  __name(joinPathToBase, "joinPathToBase");
273
273
  function posix() {
@@ -372,7 +372,7 @@ var require_node = __commonJS({
372
372
  exports.__esModule = true;
373
373
  exports.adapter = void 0;
374
374
  var os2 = __importStar(__require("os"));
375
- var path8 = __importStar(__require("path"));
375
+ var path5 = __importStar(__require("path"));
376
376
  exports.adapter = {
377
377
  atImportPermissions: { env: true },
378
378
  env: {
@@ -381,7 +381,7 @@ var require_node = __commonJS({
381
381
  }, "get")
382
382
  },
383
383
  os: os2,
384
- path: path8,
384
+ path: path5,
385
385
  process
386
386
  };
387
387
  }
@@ -427,7 +427,7 @@ var require_node2 = __commonJS({
427
427
  };
428
428
  exports.__esModule = true;
429
429
  exports.adapter = void 0;
430
- var path8 = __importStar(__require("path"));
430
+ var path5 = __importStar(__require("path"));
431
431
  var os_paths_1 = __importDefault(require_mod_cjs());
432
432
  exports.adapter = {
433
433
  atImportPermissions: { env: true },
@@ -437,7 +437,7 @@ var require_node2 = __commonJS({
437
437
  }, "get")
438
438
  },
439
439
  osPaths: os_paths_1["default"],
440
- path: path8,
440
+ path: path5,
441
441
  process
442
442
  };
443
443
  }
@@ -483,7 +483,7 @@ var require_node3 = __commonJS({
483
483
  };
484
484
  exports.__esModule = true;
485
485
  exports.adapter = void 0;
486
- var path8 = __importStar(__require("path"));
486
+ var path5 = __importStar(__require("path"));
487
487
  var xdg_portable_1 = __importDefault(require_mod_cjs2());
488
488
  exports.adapter = {
489
489
  atImportPermissions: { env: true, read: true },
@@ -498,7 +498,7 @@ var require_node3 = __commonJS({
498
498
  return process.pkg ? process.execPath : void 0;
499
499
  }, "pkgMainFilename")
500
500
  },
501
- path: path8,
501
+ path: path5,
502
502
  process,
503
503
  xdg: xdg_portable_1["default"]
504
504
  };
@@ -627,2916 +627,6 @@ var defaultWranglerConfig = {
627
627
  pipelines: [],
628
628
  vpc_services: []
629
629
  };
630
-
631
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/error.js
632
- function getLineColFromPtr(string, ptr) {
633
- let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
634
- return [lines.length, lines.pop().length + 1];
635
- }
636
- __name(getLineColFromPtr, "getLineColFromPtr");
637
- function makeCodeBlock(string, line, column) {
638
- let lines = string.split(/\r\n|\n|\r/g);
639
- let codeblock = "";
640
- let numberLen = (Math.log10(line + 1) | 0) + 1;
641
- for (let i = line - 1; i <= line + 1; i++) {
642
- let l = lines[i - 1];
643
- if (!l)
644
- continue;
645
- codeblock += i.toString().padEnd(numberLen, " ");
646
- codeblock += ": ";
647
- codeblock += l;
648
- codeblock += "\n";
649
- if (i === line) {
650
- codeblock += " ".repeat(numberLen + column + 2);
651
- codeblock += "^\n";
652
- }
653
- }
654
- return codeblock;
655
- }
656
- __name(makeCodeBlock, "makeCodeBlock");
657
- var TomlError = class extends Error {
658
- static {
659
- __name(this, "TomlError");
660
- }
661
- line;
662
- column;
663
- codeblock;
664
- constructor(message, options) {
665
- const [line, column] = getLineColFromPtr(options.toml, options.ptr);
666
- const codeblock = makeCodeBlock(options.toml, line, column);
667
- super(`Invalid TOML document: ${message}
668
-
669
- ${codeblock}`, options);
670
- this.line = line;
671
- this.column = column;
672
- this.codeblock = codeblock;
673
- }
674
- };
675
-
676
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/util.js
677
- function isEscaped(str, ptr) {
678
- let i = 0;
679
- while (str[ptr - ++i] === "\\")
680
- ;
681
- return --i && i % 2;
682
- }
683
- __name(isEscaped, "isEscaped");
684
- function indexOfNewline(str, start = 0, end = str.length) {
685
- let idx = str.indexOf("\n", start);
686
- if (str[idx - 1] === "\r")
687
- idx--;
688
- return idx <= end ? idx : -1;
689
- }
690
- __name(indexOfNewline, "indexOfNewline");
691
- function skipComment(str, ptr) {
692
- for (let i = ptr; i < str.length; i++) {
693
- let c = str[i];
694
- if (c === "\n")
695
- return i;
696
- if (c === "\r" && str[i + 1] === "\n")
697
- return i + 1;
698
- if (c < " " && c !== " " || c === "\x7F") {
699
- throw new TomlError("control characters are not allowed in comments", {
700
- toml: str,
701
- ptr
702
- });
703
- }
704
- }
705
- return str.length;
706
- }
707
- __name(skipComment, "skipComment");
708
- function skipVoid(str, ptr, banNewLines, banComments) {
709
- let c;
710
- while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n"))
711
- ptr++;
712
- return banComments || c !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines);
713
- }
714
- __name(skipVoid, "skipVoid");
715
- function skipUntil(str, ptr, sep, end, banNewLines = false) {
716
- if (!end) {
717
- ptr = indexOfNewline(str, ptr);
718
- return ptr < 0 ? str.length : ptr;
719
- }
720
- for (let i = ptr; i < str.length; i++) {
721
- let c = str[i];
722
- if (c === "#") {
723
- i = indexOfNewline(str, i);
724
- } else if (c === sep) {
725
- return i + 1;
726
- } else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) {
727
- return i;
728
- }
729
- }
730
- throw new TomlError("cannot find end of structure", {
731
- toml: str,
732
- ptr
733
- });
734
- }
735
- __name(skipUntil, "skipUntil");
736
- function getStringEnd(str, seek) {
737
- let first = str[seek];
738
- let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
739
- seek += target.length - 1;
740
- do
741
- seek = str.indexOf(target, ++seek);
742
- while (seek > -1 && first !== "'" && isEscaped(str, seek));
743
- if (seek > -1) {
744
- seek += target.length;
745
- if (target.length > 1) {
746
- if (str[seek] === first)
747
- seek++;
748
- if (str[seek] === first)
749
- seek++;
750
- }
751
- }
752
- return seek;
753
- }
754
- __name(getStringEnd, "getStringEnd");
755
-
756
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/date.js
757
- var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
758
- var TomlDate = class _TomlDate extends Date {
759
- static {
760
- __name(this, "TomlDate");
761
- }
762
- #hasDate = false;
763
- #hasTime = false;
764
- #offset = null;
765
- constructor(date) {
766
- let hasDate = true;
767
- let hasTime = true;
768
- let offset = "Z";
769
- if (typeof date === "string") {
770
- let match = date.match(DATE_TIME_RE);
771
- if (match) {
772
- if (!match[1]) {
773
- hasDate = false;
774
- date = `0000-01-01T${date}`;
775
- }
776
- hasTime = !!match[2];
777
- hasTime && date[10] === " " && (date = date.replace(" ", "T"));
778
- if (match[2] && +match[2] > 23) {
779
- date = "";
780
- } else {
781
- offset = match[3] || null;
782
- date = date.toUpperCase();
783
- if (!offset && hasTime)
784
- date += "Z";
785
- }
786
- } else {
787
- date = "";
788
- }
789
- }
790
- super(date);
791
- if (!isNaN(this.getTime())) {
792
- this.#hasDate = hasDate;
793
- this.#hasTime = hasTime;
794
- this.#offset = offset;
795
- }
796
- }
797
- isDateTime() {
798
- return this.#hasDate && this.#hasTime;
799
- }
800
- isLocal() {
801
- return !this.#hasDate || !this.#hasTime || !this.#offset;
802
- }
803
- isDate() {
804
- return this.#hasDate && !this.#hasTime;
805
- }
806
- isTime() {
807
- return this.#hasTime && !this.#hasDate;
808
- }
809
- isValid() {
810
- return this.#hasDate || this.#hasTime;
811
- }
812
- toISOString() {
813
- let iso = super.toISOString();
814
- if (this.isDate())
815
- return iso.slice(0, 10);
816
- if (this.isTime())
817
- return iso.slice(11, 23);
818
- if (this.#offset === null)
819
- return iso.slice(0, -1);
820
- if (this.#offset === "Z")
821
- return iso;
822
- let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
823
- offset = this.#offset[0] === "-" ? offset : -offset;
824
- let offsetDate = new Date(this.getTime() - offset * 6e4);
825
- return offsetDate.toISOString().slice(0, -1) + this.#offset;
826
- }
827
- static wrapAsOffsetDateTime(jsDate, offset = "Z") {
828
- let date = new _TomlDate(jsDate);
829
- date.#offset = offset;
830
- return date;
831
- }
832
- static wrapAsLocalDateTime(jsDate) {
833
- let date = new _TomlDate(jsDate);
834
- date.#offset = null;
835
- return date;
836
- }
837
- static wrapAsLocalDate(jsDate) {
838
- let date = new _TomlDate(jsDate);
839
- date.#hasTime = false;
840
- date.#offset = null;
841
- return date;
842
- }
843
- static wrapAsLocalTime(jsDate) {
844
- let date = new _TomlDate(jsDate);
845
- date.#hasDate = false;
846
- date.#offset = null;
847
- return date;
848
- }
849
- };
850
-
851
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/primitive.js
852
- var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
853
- var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
854
- var LEADING_ZERO = /^[+-]?0[0-9_]/;
855
- var ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i;
856
- var ESC_MAP = {
857
- b: "\b",
858
- t: " ",
859
- n: "\n",
860
- f: "\f",
861
- r: "\r",
862
- '"': '"',
863
- "\\": "\\"
864
- };
865
- function parseString(str, ptr = 0, endPtr = str.length) {
866
- let isLiteral = str[ptr] === "'";
867
- let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
868
- if (isMultiline) {
869
- endPtr -= 2;
870
- if (str[ptr += 2] === "\r")
871
- ptr++;
872
- if (str[ptr] === "\n")
873
- ptr++;
874
- }
875
- let tmp = 0;
876
- let isEscape;
877
- let parsed = "";
878
- let sliceStart = ptr;
879
- while (ptr < endPtr - 1) {
880
- let c = str[ptr++];
881
- if (c === "\n" || c === "\r" && str[ptr] === "\n") {
882
- if (!isMultiline) {
883
- throw new TomlError("newlines are not allowed in strings", {
884
- toml: str,
885
- ptr: ptr - 1
886
- });
887
- }
888
- } else if (c < " " && c !== " " || c === "\x7F") {
889
- throw new TomlError("control characters are not allowed in strings", {
890
- toml: str,
891
- ptr: ptr - 1
892
- });
893
- }
894
- if (isEscape) {
895
- isEscape = false;
896
- if (c === "u" || c === "U") {
897
- let code = str.slice(ptr, ptr += c === "u" ? 4 : 8);
898
- if (!ESCAPE_REGEX.test(code)) {
899
- throw new TomlError("invalid unicode escape", {
900
- toml: str,
901
- ptr: tmp
902
- });
903
- }
904
- try {
905
- parsed += String.fromCodePoint(parseInt(code, 16));
906
- } catch {
907
- throw new TomlError("invalid unicode escape", {
908
- toml: str,
909
- ptr: tmp
910
- });
911
- }
912
- } else if (isMultiline && (c === "\n" || c === " " || c === " " || c === "\r")) {
913
- ptr = skipVoid(str, ptr - 1, true);
914
- if (str[ptr] !== "\n" && str[ptr] !== "\r") {
915
- throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
916
- toml: str,
917
- ptr: tmp
918
- });
919
- }
920
- ptr = skipVoid(str, ptr);
921
- } else if (c in ESC_MAP) {
922
- parsed += ESC_MAP[c];
923
- } else {
924
- throw new TomlError("unrecognized escape sequence", {
925
- toml: str,
926
- ptr: tmp
927
- });
928
- }
929
- sliceStart = ptr;
930
- } else if (!isLiteral && c === "\\") {
931
- tmp = ptr - 1;
932
- isEscape = true;
933
- parsed += str.slice(sliceStart, tmp);
934
- }
935
- }
936
- return parsed + str.slice(sliceStart, endPtr - 1);
937
- }
938
- __name(parseString, "parseString");
939
- function parseValue(value, toml, ptr, integersAsBigInt) {
940
- if (value === "true")
941
- return true;
942
- if (value === "false")
943
- return false;
944
- if (value === "-inf")
945
- return -Infinity;
946
- if (value === "inf" || value === "+inf")
947
- return Infinity;
948
- if (value === "nan" || value === "+nan" || value === "-nan")
949
- return NaN;
950
- if (value === "-0")
951
- return integersAsBigInt ? 0n : 0;
952
- let isInt = INT_REGEX.test(value);
953
- if (isInt || FLOAT_REGEX.test(value)) {
954
- if (LEADING_ZERO.test(value)) {
955
- throw new TomlError("leading zeroes are not allowed", {
956
- toml,
957
- ptr
958
- });
959
- }
960
- value = value.replace(/_/g, "");
961
- let numeric = +value;
962
- if (isNaN(numeric)) {
963
- throw new TomlError("invalid number", {
964
- toml,
965
- ptr
966
- });
967
- }
968
- if (isInt) {
969
- if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
970
- throw new TomlError("integer value cannot be represented losslessly", {
971
- toml,
972
- ptr
973
- });
974
- }
975
- if (isInt || integersAsBigInt === true)
976
- numeric = BigInt(value);
977
- }
978
- return numeric;
979
- }
980
- const date = new TomlDate(value);
981
- if (!date.isValid()) {
982
- throw new TomlError("invalid value", {
983
- toml,
984
- ptr
985
- });
986
- }
987
- return date;
988
- }
989
- __name(parseValue, "parseValue");
990
-
991
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/extract.js
992
- function sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) {
993
- let value = str.slice(startPtr, endPtr);
994
- let commentIdx = value.indexOf("#");
995
- if (commentIdx > -1) {
996
- skipComment(str, commentIdx);
997
- value = value.slice(0, commentIdx);
998
- }
999
- let trimmed = value.trimEnd();
1000
- if (!allowNewLines) {
1001
- let newlineIdx = value.indexOf("\n", trimmed.length);
1002
- if (newlineIdx > -1) {
1003
- throw new TomlError("newlines are not allowed in inline tables", {
1004
- toml: str,
1005
- ptr: startPtr + newlineIdx
1006
- });
1007
- }
1008
- }
1009
- return [trimmed, commentIdx];
1010
- }
1011
- __name(sliceAndTrimEndOf, "sliceAndTrimEndOf");
1012
- function extractValue(str, ptr, end, depth, integersAsBigInt) {
1013
- if (depth === 0) {
1014
- throw new TomlError("document contains excessively nested structures. aborting.", {
1015
- toml: str,
1016
- ptr
1017
- });
1018
- }
1019
- let c = str[ptr];
1020
- if (c === "[" || c === "{") {
1021
- let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
1022
- let newPtr = end ? skipUntil(str, endPtr2, ",", end) : endPtr2;
1023
- if (endPtr2 - newPtr && end === "}") {
1024
- let nextNewLine = indexOfNewline(str, endPtr2, newPtr);
1025
- if (nextNewLine > -1) {
1026
- throw new TomlError("newlines are not allowed in inline tables", {
1027
- toml: str,
1028
- ptr: nextNewLine
1029
- });
1030
- }
1031
- }
1032
- return [value, newPtr];
1033
- }
1034
- let endPtr;
1035
- if (c === '"' || c === "'") {
1036
- endPtr = getStringEnd(str, ptr);
1037
- let parsed = parseString(str, ptr, endPtr);
1038
- if (end) {
1039
- endPtr = skipVoid(str, endPtr, end !== "]");
1040
- if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") {
1041
- throw new TomlError("unexpected character encountered", {
1042
- toml: str,
1043
- ptr: endPtr
1044
- });
1045
- }
1046
- endPtr += +(str[endPtr] === ",");
1047
- }
1048
- return [parsed, endPtr];
1049
- }
1050
- endPtr = skipUntil(str, ptr, ",", end);
1051
- let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ","), end === "]");
1052
- if (!slice[0]) {
1053
- throw new TomlError("incomplete key-value declaration: no value specified", {
1054
- toml: str,
1055
- ptr
1056
- });
1057
- }
1058
- if (end && slice[1] > -1) {
1059
- endPtr = skipVoid(str, ptr + slice[1]);
1060
- endPtr += +(str[endPtr] === ",");
1061
- }
1062
- return [
1063
- parseValue(slice[0], str, ptr, integersAsBigInt),
1064
- endPtr
1065
- ];
1066
- }
1067
- __name(extractValue, "extractValue");
1068
-
1069
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/struct.js
1070
- var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
1071
- function parseKey(str, ptr, end = "=") {
1072
- let dot = ptr - 1;
1073
- let parsed = [];
1074
- let endPtr = str.indexOf(end, ptr);
1075
- if (endPtr < 0) {
1076
- throw new TomlError("incomplete key-value: cannot find end of key", {
1077
- toml: str,
1078
- ptr
1079
- });
1080
- }
1081
- do {
1082
- let c = str[ptr = ++dot];
1083
- if (c !== " " && c !== " ") {
1084
- if (c === '"' || c === "'") {
1085
- if (c === str[ptr + 1] && c === str[ptr + 2]) {
1086
- throw new TomlError("multiline strings are not allowed in keys", {
1087
- toml: str,
1088
- ptr
1089
- });
1090
- }
1091
- let eos = getStringEnd(str, ptr);
1092
- if (eos < 0) {
1093
- throw new TomlError("unfinished string encountered", {
1094
- toml: str,
1095
- ptr
1096
- });
1097
- }
1098
- dot = str.indexOf(".", eos);
1099
- let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
1100
- let newLine = indexOfNewline(strEnd);
1101
- if (newLine > -1) {
1102
- throw new TomlError("newlines are not allowed in keys", {
1103
- toml: str,
1104
- ptr: ptr + dot + newLine
1105
- });
1106
- }
1107
- if (strEnd.trimStart()) {
1108
- throw new TomlError("found extra tokens after the string part", {
1109
- toml: str,
1110
- ptr: eos
1111
- });
1112
- }
1113
- if (endPtr < eos) {
1114
- endPtr = str.indexOf(end, eos);
1115
- if (endPtr < 0) {
1116
- throw new TomlError("incomplete key-value: cannot find end of key", {
1117
- toml: str,
1118
- ptr
1119
- });
1120
- }
1121
- }
1122
- parsed.push(parseString(str, ptr, eos));
1123
- } else {
1124
- dot = str.indexOf(".", ptr);
1125
- let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
1126
- if (!KEY_PART_RE.test(part)) {
1127
- throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
1128
- toml: str,
1129
- ptr
1130
- });
1131
- }
1132
- parsed.push(part.trimEnd());
1133
- }
1134
- }
1135
- } while (dot + 1 && dot < endPtr);
1136
- return [parsed, skipVoid(str, endPtr + 1, true, true)];
1137
- }
1138
- __name(parseKey, "parseKey");
1139
- function parseInlineTable(str, ptr, depth, integersAsBigInt) {
1140
- let res = {};
1141
- let seen = /* @__PURE__ */ new Set();
1142
- let c;
1143
- let comma = 0;
1144
- ptr++;
1145
- while ((c = str[ptr++]) !== "}" && c) {
1146
- let err = { toml: str, ptr: ptr - 1 };
1147
- if (c === "\n") {
1148
- throw new TomlError("newlines are not allowed in inline tables", err);
1149
- } else if (c === "#") {
1150
- throw new TomlError("inline tables cannot contain comments", err);
1151
- } else if (c === ",") {
1152
- throw new TomlError("expected key-value, found comma", err);
1153
- } else if (c !== " " && c !== " ") {
1154
- let k;
1155
- let t = res;
1156
- let hasOwn = false;
1157
- let [key, keyEndPtr] = parseKey(str, ptr - 1);
1158
- for (let i = 0; i < key.length; i++) {
1159
- if (i)
1160
- t = hasOwn ? t[k] : t[k] = {};
1161
- k = key[i];
1162
- if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
1163
- throw new TomlError("trying to redefine an already defined value", {
1164
- toml: str,
1165
- ptr
1166
- });
1167
- }
1168
- if (!hasOwn && k === "__proto__") {
1169
- Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
1170
- }
1171
- }
1172
- if (hasOwn) {
1173
- throw new TomlError("trying to redefine an already defined value", {
1174
- toml: str,
1175
- ptr
1176
- });
1177
- }
1178
- let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
1179
- seen.add(value);
1180
- t[k] = value;
1181
- ptr = valueEndPtr;
1182
- comma = str[ptr - 1] === "," ? ptr - 1 : 0;
1183
- }
1184
- }
1185
- if (comma) {
1186
- throw new TomlError("trailing commas are not allowed in inline tables", {
1187
- toml: str,
1188
- ptr: comma
1189
- });
1190
- }
1191
- if (!c) {
1192
- throw new TomlError("unfinished table encountered", {
1193
- toml: str,
1194
- ptr
1195
- });
1196
- }
1197
- return [res, ptr];
1198
- }
1199
- __name(parseInlineTable, "parseInlineTable");
1200
- function parseArray(str, ptr, depth, integersAsBigInt) {
1201
- let res = [];
1202
- let c;
1203
- ptr++;
1204
- while ((c = str[ptr++]) !== "]" && c) {
1205
- if (c === ",") {
1206
- throw new TomlError("expected value, found comma", {
1207
- toml: str,
1208
- ptr: ptr - 1
1209
- });
1210
- } else if (c === "#")
1211
- ptr = skipComment(str, ptr);
1212
- else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") {
1213
- let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt);
1214
- res.push(e[0]);
1215
- ptr = e[1];
1216
- }
1217
- }
1218
- if (!c) {
1219
- throw new TomlError("unfinished array encountered", {
1220
- toml: str,
1221
- ptr
1222
- });
1223
- }
1224
- return [res, ptr];
1225
- }
1226
- __name(parseArray, "parseArray");
1227
-
1228
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/parse.js
1229
- function peekTable(key, table, meta, type) {
1230
- let t = table;
1231
- let m = meta;
1232
- let k;
1233
- let hasOwn = false;
1234
- let state;
1235
- for (let i = 0; i < key.length; i++) {
1236
- if (i) {
1237
- t = hasOwn ? t[k] : t[k] = {};
1238
- m = (state = m[k]).c;
1239
- if (type === 0 && (state.t === 1 || state.t === 2)) {
1240
- return null;
1241
- }
1242
- if (state.t === 2) {
1243
- let l = t.length - 1;
1244
- t = t[l];
1245
- m = m[l].c;
1246
- }
1247
- }
1248
- k = key[i];
1249
- if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 && m[k]?.d) {
1250
- return null;
1251
- }
1252
- if (!hasOwn) {
1253
- if (k === "__proto__") {
1254
- Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
1255
- Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });
1256
- }
1257
- m[k] = {
1258
- t: i < key.length - 1 && type === 2 ? 3 : type,
1259
- d: false,
1260
- i: 0,
1261
- c: {}
1262
- };
1263
- }
1264
- }
1265
- state = m[k];
1266
- if (state.t !== type && !(type === 1 && state.t === 3)) {
1267
- return null;
1268
- }
1269
- if (type === 2) {
1270
- if (!state.d) {
1271
- state.d = true;
1272
- t[k] = [];
1273
- }
1274
- t[k].push(t = {});
1275
- state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} };
1276
- }
1277
- if (state.d) {
1278
- return null;
1279
- }
1280
- state.d = true;
1281
- if (type === 1) {
1282
- t = hasOwn ? t[k] : t[k] = {};
1283
- } else if (type === 0 && hasOwn) {
1284
- return null;
1285
- }
1286
- return [k, t, state.c];
1287
- }
1288
- __name(peekTable, "peekTable");
1289
- function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
1290
- let res = {};
1291
- let meta = {};
1292
- let tbl = res;
1293
- let m = meta;
1294
- for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) {
1295
- if (toml[ptr] === "[") {
1296
- let isTableArray = toml[++ptr] === "[";
1297
- let k = parseKey(toml, ptr += +isTableArray, "]");
1298
- if (isTableArray) {
1299
- if (toml[k[1] - 1] !== "]") {
1300
- throw new TomlError("expected end of table declaration", {
1301
- toml,
1302
- ptr: k[1] - 1
1303
- });
1304
- }
1305
- k[1]++;
1306
- }
1307
- let p = peekTable(
1308
- k[0],
1309
- res,
1310
- meta,
1311
- isTableArray ? 2 : 1
1312
- /* Type.EXPLICIT */
1313
- );
1314
- if (!p) {
1315
- throw new TomlError("trying to redefine an already defined table or value", {
1316
- toml,
1317
- ptr
1318
- });
1319
- }
1320
- m = p[2];
1321
- tbl = p[1];
1322
- ptr = k[1];
1323
- } else {
1324
- let k = parseKey(toml, ptr);
1325
- let p = peekTable(
1326
- k[0],
1327
- tbl,
1328
- m,
1329
- 0
1330
- /* Type.DOTTED */
1331
- );
1332
- if (!p) {
1333
- throw new TomlError("trying to redefine an already defined table or value", {
1334
- toml,
1335
- ptr
1336
- });
1337
- }
1338
- let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt);
1339
- p[1][p[0]] = v[0];
1340
- ptr = v[1];
1341
- }
1342
- ptr = skipVoid(toml, ptr, true);
1343
- if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") {
1344
- throw new TomlError("each key-value declaration must be followed by an end-of-line", {
1345
- toml,
1346
- ptr
1347
- });
1348
- }
1349
- ptr = skipVoid(toml, ptr);
1350
- }
1351
- return res;
1352
- }
1353
- __name(parse, "parse");
1354
-
1355
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/stringify.js
1356
- var BARE_KEY = /^[a-z0-9-_]+$/i;
1357
- function extendedTypeOf(obj) {
1358
- let type = typeof obj;
1359
- if (type === "object") {
1360
- if (Array.isArray(obj))
1361
- return "array";
1362
- if (obj instanceof Date)
1363
- return "date";
1364
- }
1365
- return type;
1366
- }
1367
- __name(extendedTypeOf, "extendedTypeOf");
1368
- function isArrayOfTables(obj) {
1369
- for (let i = 0; i < obj.length; i++) {
1370
- if (extendedTypeOf(obj[i]) !== "object")
1371
- return false;
1372
- }
1373
- return obj.length != 0;
1374
- }
1375
- __name(isArrayOfTables, "isArrayOfTables");
1376
- function formatString(s) {
1377
- return JSON.stringify(s).replace(/\x7f/g, "\\u007f");
1378
- }
1379
- __name(formatString, "formatString");
1380
- function stringifyValue(val, type, depth, numberAsFloat) {
1381
- if (depth === 0) {
1382
- throw new Error("Could not stringify the object: maximum object depth exceeded");
1383
- }
1384
- if (type === "number") {
1385
- if (isNaN(val))
1386
- return "nan";
1387
- if (val === Infinity)
1388
- return "inf";
1389
- if (val === -Infinity)
1390
- return "-inf";
1391
- if (numberAsFloat && Number.isInteger(val))
1392
- return val.toFixed(1);
1393
- return val.toString();
1394
- }
1395
- if (type === "bigint" || type === "boolean") {
1396
- return val.toString();
1397
- }
1398
- if (type === "string") {
1399
- return formatString(val);
1400
- }
1401
- if (type === "date") {
1402
- if (isNaN(val.getTime())) {
1403
- throw new TypeError("cannot serialize invalid date");
1404
- }
1405
- return val.toISOString();
1406
- }
1407
- if (type === "object") {
1408
- return stringifyInlineTable(val, depth, numberAsFloat);
1409
- }
1410
- if (type === "array") {
1411
- return stringifyArray(val, depth, numberAsFloat);
1412
- }
1413
- }
1414
- __name(stringifyValue, "stringifyValue");
1415
- function stringifyInlineTable(obj, depth, numberAsFloat) {
1416
- let keys = Object.keys(obj);
1417
- if (keys.length === 0)
1418
- return "{}";
1419
- let res = "{ ";
1420
- for (let i = 0; i < keys.length; i++) {
1421
- let k = keys[i];
1422
- if (i)
1423
- res += ", ";
1424
- res += BARE_KEY.test(k) ? k : formatString(k);
1425
- res += " = ";
1426
- res += stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat);
1427
- }
1428
- return res + " }";
1429
- }
1430
- __name(stringifyInlineTable, "stringifyInlineTable");
1431
- function stringifyArray(array, depth, numberAsFloat) {
1432
- if (array.length === 0)
1433
- return "[]";
1434
- let res = "[ ";
1435
- for (let i = 0; i < array.length; i++) {
1436
- if (i)
1437
- res += ", ";
1438
- if (array[i] === null || array[i] === void 0) {
1439
- throw new TypeError("arrays cannot contain null or undefined values");
1440
- }
1441
- res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat);
1442
- }
1443
- return res + " ]";
1444
- }
1445
- __name(stringifyArray, "stringifyArray");
1446
- function stringifyArrayTable(array, key, depth, numberAsFloat) {
1447
- if (depth === 0) {
1448
- throw new Error("Could not stringify the object: maximum object depth exceeded");
1449
- }
1450
- let res = "";
1451
- for (let i = 0; i < array.length; i++) {
1452
- res += `${res && "\n"}[[${key}]]
1453
- `;
1454
- res += stringifyTable(0, array[i], key, depth, numberAsFloat);
1455
- }
1456
- return res;
1457
- }
1458
- __name(stringifyArrayTable, "stringifyArrayTable");
1459
- function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
1460
- if (depth === 0) {
1461
- throw new Error("Could not stringify the object: maximum object depth exceeded");
1462
- }
1463
- let preamble = "";
1464
- let tables = "";
1465
- let keys = Object.keys(obj);
1466
- for (let i = 0; i < keys.length; i++) {
1467
- let k = keys[i];
1468
- if (obj[k] !== null && obj[k] !== void 0) {
1469
- let type = extendedTypeOf(obj[k]);
1470
- if (type === "symbol" || type === "function") {
1471
- throw new TypeError(`cannot serialize values of type '${type}'`);
1472
- }
1473
- let key = BARE_KEY.test(k) ? k : formatString(k);
1474
- if (type === "array" && isArrayOfTables(obj[k])) {
1475
- tables += (tables && "\n") + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
1476
- } else if (type === "object") {
1477
- let tblKey = prefix ? `${prefix}.${key}` : key;
1478
- tables += (tables && "\n") + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat);
1479
- } else {
1480
- preamble += key;
1481
- preamble += " = ";
1482
- preamble += stringifyValue(obj[k], type, depth, numberAsFloat);
1483
- preamble += "\n";
1484
- }
1485
- }
1486
- }
1487
- if (tableKey && (preamble || !tables))
1488
- preamble = preamble ? `[${tableKey}]
1489
- ${preamble}` : `[${tableKey}]`;
1490
- return preamble && tables ? `${preamble}
1491
- ${tables}` : preamble || tables;
1492
- }
1493
- __name(stringifyTable, "stringifyTable");
1494
- function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
1495
- if (extendedTypeOf(obj) !== "object") {
1496
- throw new TypeError("stringify can only be called with an object");
1497
- }
1498
- let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat);
1499
- if (str[str.length - 1] !== "\n")
1500
- return str + "\n";
1501
- return str;
1502
- }
1503
- __name(stringify, "stringify");
1504
-
1505
- // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/index.js
1506
- var dist_default = { parse, stringify, TomlDate, TomlError };
1507
-
1508
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
1509
- function createScanner(text, ignoreTrivia = false) {
1510
- const len = text.length;
1511
- let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
1512
- function scanHexDigits(count, exact) {
1513
- let digits = 0;
1514
- let value2 = 0;
1515
- while (digits < count || !exact) {
1516
- let ch = text.charCodeAt(pos);
1517
- if (ch >= 48 && ch <= 57) {
1518
- value2 = value2 * 16 + ch - 48;
1519
- } else if (ch >= 65 && ch <= 70) {
1520
- value2 = value2 * 16 + ch - 65 + 10;
1521
- } else if (ch >= 97 && ch <= 102) {
1522
- value2 = value2 * 16 + ch - 97 + 10;
1523
- } else {
1524
- break;
1525
- }
1526
- pos++;
1527
- digits++;
1528
- }
1529
- if (digits < count) {
1530
- value2 = -1;
1531
- }
1532
- return value2;
1533
- }
1534
- __name(scanHexDigits, "scanHexDigits");
1535
- function setPosition(newPosition) {
1536
- pos = newPosition;
1537
- value = "";
1538
- tokenOffset = 0;
1539
- token = 16;
1540
- scanError = 0;
1541
- }
1542
- __name(setPosition, "setPosition");
1543
- function scanNumber() {
1544
- let start = pos;
1545
- if (text.charCodeAt(pos) === 48) {
1546
- pos++;
1547
- } else {
1548
- pos++;
1549
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1550
- pos++;
1551
- }
1552
- }
1553
- if (pos < text.length && text.charCodeAt(pos) === 46) {
1554
- pos++;
1555
- if (pos < text.length && isDigit(text.charCodeAt(pos))) {
1556
- pos++;
1557
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1558
- pos++;
1559
- }
1560
- } else {
1561
- scanError = 3;
1562
- return text.substring(start, pos);
1563
- }
1564
- }
1565
- let end = pos;
1566
- if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
1567
- pos++;
1568
- if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
1569
- pos++;
1570
- }
1571
- if (pos < text.length && isDigit(text.charCodeAt(pos))) {
1572
- pos++;
1573
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1574
- pos++;
1575
- }
1576
- end = pos;
1577
- } else {
1578
- scanError = 3;
1579
- }
1580
- }
1581
- return text.substring(start, end);
1582
- }
1583
- __name(scanNumber, "scanNumber");
1584
- function scanString() {
1585
- let result = "", start = pos;
1586
- while (true) {
1587
- if (pos >= len) {
1588
- result += text.substring(start, pos);
1589
- scanError = 2;
1590
- break;
1591
- }
1592
- const ch = text.charCodeAt(pos);
1593
- if (ch === 34) {
1594
- result += text.substring(start, pos);
1595
- pos++;
1596
- break;
1597
- }
1598
- if (ch === 92) {
1599
- result += text.substring(start, pos);
1600
- pos++;
1601
- if (pos >= len) {
1602
- scanError = 2;
1603
- break;
1604
- }
1605
- const ch2 = text.charCodeAt(pos++);
1606
- switch (ch2) {
1607
- case 34:
1608
- result += '"';
1609
- break;
1610
- case 92:
1611
- result += "\\";
1612
- break;
1613
- case 47:
1614
- result += "/";
1615
- break;
1616
- case 98:
1617
- result += "\b";
1618
- break;
1619
- case 102:
1620
- result += "\f";
1621
- break;
1622
- case 110:
1623
- result += "\n";
1624
- break;
1625
- case 114:
1626
- result += "\r";
1627
- break;
1628
- case 116:
1629
- result += " ";
1630
- break;
1631
- case 117:
1632
- const ch3 = scanHexDigits(4, true);
1633
- if (ch3 >= 0) {
1634
- result += String.fromCharCode(ch3);
1635
- } else {
1636
- scanError = 4;
1637
- }
1638
- break;
1639
- default:
1640
- scanError = 5;
1641
- }
1642
- start = pos;
1643
- continue;
1644
- }
1645
- if (ch >= 0 && ch <= 31) {
1646
- if (isLineBreak(ch)) {
1647
- result += text.substring(start, pos);
1648
- scanError = 2;
1649
- break;
1650
- } else {
1651
- scanError = 6;
1652
- }
1653
- }
1654
- pos++;
1655
- }
1656
- return result;
1657
- }
1658
- __name(scanString, "scanString");
1659
- function scanNext() {
1660
- value = "";
1661
- scanError = 0;
1662
- tokenOffset = pos;
1663
- lineStartOffset = lineNumber;
1664
- prevTokenLineStartOffset = tokenLineStartOffset;
1665
- if (pos >= len) {
1666
- tokenOffset = len;
1667
- return token = 17;
1668
- }
1669
- let code = text.charCodeAt(pos);
1670
- if (isWhiteSpace(code)) {
1671
- do {
1672
- pos++;
1673
- value += String.fromCharCode(code);
1674
- code = text.charCodeAt(pos);
1675
- } while (isWhiteSpace(code));
1676
- return token = 15;
1677
- }
1678
- if (isLineBreak(code)) {
1679
- pos++;
1680
- value += String.fromCharCode(code);
1681
- if (code === 13 && text.charCodeAt(pos) === 10) {
1682
- pos++;
1683
- value += "\n";
1684
- }
1685
- lineNumber++;
1686
- tokenLineStartOffset = pos;
1687
- return token = 14;
1688
- }
1689
- switch (code) {
1690
- // tokens: []{}:,
1691
- case 123:
1692
- pos++;
1693
- return token = 1;
1694
- case 125:
1695
- pos++;
1696
- return token = 2;
1697
- case 91:
1698
- pos++;
1699
- return token = 3;
1700
- case 93:
1701
- pos++;
1702
- return token = 4;
1703
- case 58:
1704
- pos++;
1705
- return token = 6;
1706
- case 44:
1707
- pos++;
1708
- return token = 5;
1709
- // strings
1710
- case 34:
1711
- pos++;
1712
- value = scanString();
1713
- return token = 10;
1714
- // comments
1715
- case 47:
1716
- const start = pos - 1;
1717
- if (text.charCodeAt(pos + 1) === 47) {
1718
- pos += 2;
1719
- while (pos < len) {
1720
- if (isLineBreak(text.charCodeAt(pos))) {
1721
- break;
1722
- }
1723
- pos++;
1724
- }
1725
- value = text.substring(start, pos);
1726
- return token = 12;
1727
- }
1728
- if (text.charCodeAt(pos + 1) === 42) {
1729
- pos += 2;
1730
- const safeLength = len - 1;
1731
- let commentClosed = false;
1732
- while (pos < safeLength) {
1733
- const ch = text.charCodeAt(pos);
1734
- if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
1735
- pos += 2;
1736
- commentClosed = true;
1737
- break;
1738
- }
1739
- pos++;
1740
- if (isLineBreak(ch)) {
1741
- if (ch === 13 && text.charCodeAt(pos) === 10) {
1742
- pos++;
1743
- }
1744
- lineNumber++;
1745
- tokenLineStartOffset = pos;
1746
- }
1747
- }
1748
- if (!commentClosed) {
1749
- pos++;
1750
- scanError = 1;
1751
- }
1752
- value = text.substring(start, pos);
1753
- return token = 13;
1754
- }
1755
- value += String.fromCharCode(code);
1756
- pos++;
1757
- return token = 16;
1758
- // numbers
1759
- case 45:
1760
- value += String.fromCharCode(code);
1761
- pos++;
1762
- if (pos === len || !isDigit(text.charCodeAt(pos))) {
1763
- return token = 16;
1764
- }
1765
- // found a minus, followed by a number so
1766
- // we fall through to proceed with scanning
1767
- // numbers
1768
- case 48:
1769
- case 49:
1770
- case 50:
1771
- case 51:
1772
- case 52:
1773
- case 53:
1774
- case 54:
1775
- case 55:
1776
- case 56:
1777
- case 57:
1778
- value += scanNumber();
1779
- return token = 11;
1780
- // literals and unknown symbols
1781
- default:
1782
- while (pos < len && isUnknownContentCharacter(code)) {
1783
- pos++;
1784
- code = text.charCodeAt(pos);
1785
- }
1786
- if (tokenOffset !== pos) {
1787
- value = text.substring(tokenOffset, pos);
1788
- switch (value) {
1789
- case "true":
1790
- return token = 8;
1791
- case "false":
1792
- return token = 9;
1793
- case "null":
1794
- return token = 7;
1795
- }
1796
- return token = 16;
1797
- }
1798
- value += String.fromCharCode(code);
1799
- pos++;
1800
- return token = 16;
1801
- }
1802
- }
1803
- __name(scanNext, "scanNext");
1804
- function isUnknownContentCharacter(code) {
1805
- if (isWhiteSpace(code) || isLineBreak(code)) {
1806
- return false;
1807
- }
1808
- switch (code) {
1809
- case 125:
1810
- case 93:
1811
- case 123:
1812
- case 91:
1813
- case 34:
1814
- case 58:
1815
- case 44:
1816
- case 47:
1817
- return false;
1818
- }
1819
- return true;
1820
- }
1821
- __name(isUnknownContentCharacter, "isUnknownContentCharacter");
1822
- function scanNextNonTrivia() {
1823
- let result;
1824
- do {
1825
- result = scanNext();
1826
- } while (result >= 12 && result <= 15);
1827
- return result;
1828
- }
1829
- __name(scanNextNonTrivia, "scanNextNonTrivia");
1830
- return {
1831
- setPosition,
1832
- getPosition: /* @__PURE__ */ __name(() => pos, "getPosition"),
1833
- scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
1834
- getToken: /* @__PURE__ */ __name(() => token, "getToken"),
1835
- getTokenValue: /* @__PURE__ */ __name(() => value, "getTokenValue"),
1836
- getTokenOffset: /* @__PURE__ */ __name(() => tokenOffset, "getTokenOffset"),
1837
- getTokenLength: /* @__PURE__ */ __name(() => pos - tokenOffset, "getTokenLength"),
1838
- getTokenStartLine: /* @__PURE__ */ __name(() => lineStartOffset, "getTokenStartLine"),
1839
- getTokenStartCharacter: /* @__PURE__ */ __name(() => tokenOffset - prevTokenLineStartOffset, "getTokenStartCharacter"),
1840
- getTokenError: /* @__PURE__ */ __name(() => scanError, "getTokenError")
1841
- };
1842
- }
1843
- __name(createScanner, "createScanner");
1844
- function isWhiteSpace(ch) {
1845
- return ch === 32 || ch === 9;
1846
- }
1847
- __name(isWhiteSpace, "isWhiteSpace");
1848
- function isLineBreak(ch) {
1849
- return ch === 10 || ch === 13;
1850
- }
1851
- __name(isLineBreak, "isLineBreak");
1852
- function isDigit(ch) {
1853
- return ch >= 48 && ch <= 57;
1854
- }
1855
- __name(isDigit, "isDigit");
1856
- var CharacterCodes;
1857
- (function(CharacterCodes2) {
1858
- CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
1859
- CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
1860
- CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
1861
- CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
1862
- CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
1863
- CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
1864
- CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
1865
- CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
1866
- CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
1867
- CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
1868
- CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
1869
- CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
1870
- CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
1871
- CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
1872
- CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
1873
- CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
1874
- CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
1875
- CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
1876
- CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
1877
- CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
1878
- CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
1879
- CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
1880
- CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
1881
- CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
1882
- CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
1883
- CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
1884
- CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
1885
- CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
1886
- CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
1887
- CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
1888
- CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
1889
- CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
1890
- CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
1891
- CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
1892
- CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
1893
- CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
1894
- CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
1895
- CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
1896
- CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
1897
- CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
1898
- CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
1899
- CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
1900
- CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
1901
- CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
1902
- CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
1903
- CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
1904
- CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
1905
- CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
1906
- CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
1907
- CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
1908
- CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
1909
- CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
1910
- CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
1911
- CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
1912
- CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
1913
- CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
1914
- CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
1915
- CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
1916
- CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
1917
- CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
1918
- CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
1919
- CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
1920
- CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
1921
- CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
1922
- CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
1923
- CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
1924
- CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
1925
- CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
1926
- CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
1927
- CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
1928
- CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
1929
- CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
1930
- CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
1931
- CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
1932
- CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
1933
- CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
1934
- CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
1935
- CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
1936
- CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
1937
- CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
1938
- })(CharacterCodes || (CharacterCodes = {}));
1939
-
1940
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js
1941
- function format(documentText, range, options) {
1942
- let initialIndentLevel;
1943
- let formatText;
1944
- let formatTextStart;
1945
- let rangeStart;
1946
- let rangeEnd;
1947
- if (range) {
1948
- rangeStart = range.offset;
1949
- rangeEnd = rangeStart + range.length;
1950
- formatTextStart = rangeStart;
1951
- while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {
1952
- formatTextStart--;
1953
- }
1954
- let endOffset = rangeEnd;
1955
- while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {
1956
- endOffset++;
1957
- }
1958
- formatText = documentText.substring(formatTextStart, endOffset);
1959
- initialIndentLevel = computeIndentLevel(formatText, options);
1960
- } else {
1961
- formatText = documentText;
1962
- initialIndentLevel = 0;
1963
- formatTextStart = 0;
1964
- rangeStart = 0;
1965
- rangeEnd = documentText.length;
1966
- }
1967
- const eol = getEOL(options, documentText);
1968
- let numberLineBreaks = 0;
1969
- let indentLevel = 0;
1970
- let indentValue;
1971
- if (options.insertSpaces) {
1972
- indentValue = repeat(" ", options.tabSize || 4);
1973
- } else {
1974
- indentValue = " ";
1975
- }
1976
- let scanner = createScanner(formatText, false);
1977
- let hasError = false;
1978
- function newLinesAndIndent() {
1979
- if (numberLineBreaks > 1) {
1980
- return repeat(eol, numberLineBreaks) + repeat(indentValue, initialIndentLevel + indentLevel);
1981
- } else {
1982
- return eol + repeat(indentValue, initialIndentLevel + indentLevel);
1983
- }
1984
- }
1985
- __name(newLinesAndIndent, "newLinesAndIndent");
1986
- function scanNext() {
1987
- let token = scanner.scan();
1988
- numberLineBreaks = 0;
1989
- while (token === 15 || token === 14) {
1990
- if (token === 14 && options.keepLines) {
1991
- numberLineBreaks += 1;
1992
- } else if (token === 14) {
1993
- numberLineBreaks = 1;
1994
- }
1995
- token = scanner.scan();
1996
- }
1997
- hasError = token === 16 || scanner.getTokenError() !== 0;
1998
- return token;
1999
- }
2000
- __name(scanNext, "scanNext");
2001
- const editOperations = [];
2002
- function addEdit(text, startOffset, endOffset) {
2003
- if (!hasError && (!range || startOffset < rangeEnd && endOffset > rangeStart) && documentText.substring(startOffset, endOffset) !== text) {
2004
- editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text });
2005
- }
2006
- }
2007
- __name(addEdit, "addEdit");
2008
- let firstToken = scanNext();
2009
- if (options.keepLines && numberLineBreaks > 0) {
2010
- addEdit(repeat(eol, numberLineBreaks), 0, 0);
2011
- }
2012
- if (firstToken !== 17) {
2013
- let firstTokenStart = scanner.getTokenOffset() + formatTextStart;
2014
- let initialIndent = repeat(indentValue, initialIndentLevel);
2015
- addEdit(initialIndent, formatTextStart, firstTokenStart);
2016
- }
2017
- while (firstToken !== 17) {
2018
- let firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
2019
- let secondToken = scanNext();
2020
- let replaceContent = "";
2021
- let needsLineBreak = false;
2022
- while (numberLineBreaks === 0 && (secondToken === 12 || secondToken === 13)) {
2023
- let commentTokenStart = scanner.getTokenOffset() + formatTextStart;
2024
- addEdit(" ", firstTokenEnd, commentTokenStart);
2025
- firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
2026
- needsLineBreak = secondToken === 12;
2027
- replaceContent = needsLineBreak ? newLinesAndIndent() : "";
2028
- secondToken = scanNext();
2029
- }
2030
- if (secondToken === 2) {
2031
- if (firstToken !== 1) {
2032
- indentLevel--;
2033
- }
2034
- if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 1) {
2035
- replaceContent = newLinesAndIndent();
2036
- } else if (options.keepLines) {
2037
- replaceContent = " ";
2038
- }
2039
- } else if (secondToken === 4) {
2040
- if (firstToken !== 3) {
2041
- indentLevel--;
2042
- }
2043
- if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 3) {
2044
- replaceContent = newLinesAndIndent();
2045
- } else if (options.keepLines) {
2046
- replaceContent = " ";
2047
- }
2048
- } else {
2049
- switch (firstToken) {
2050
- case 3:
2051
- case 1:
2052
- indentLevel++;
2053
- if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {
2054
- replaceContent = newLinesAndIndent();
2055
- } else {
2056
- replaceContent = " ";
2057
- }
2058
- break;
2059
- case 5:
2060
- if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {
2061
- replaceContent = newLinesAndIndent();
2062
- } else {
2063
- replaceContent = " ";
2064
- }
2065
- break;
2066
- case 12:
2067
- replaceContent = newLinesAndIndent();
2068
- break;
2069
- case 13:
2070
- if (numberLineBreaks > 0) {
2071
- replaceContent = newLinesAndIndent();
2072
- } else if (!needsLineBreak) {
2073
- replaceContent = " ";
2074
- }
2075
- break;
2076
- case 6:
2077
- if (options.keepLines && numberLineBreaks > 0) {
2078
- replaceContent = newLinesAndIndent();
2079
- } else if (!needsLineBreak) {
2080
- replaceContent = " ";
2081
- }
2082
- break;
2083
- case 10:
2084
- if (options.keepLines && numberLineBreaks > 0) {
2085
- replaceContent = newLinesAndIndent();
2086
- } else if (secondToken === 6 && !needsLineBreak) {
2087
- replaceContent = "";
2088
- }
2089
- break;
2090
- case 7:
2091
- case 8:
2092
- case 9:
2093
- case 11:
2094
- case 2:
2095
- case 4:
2096
- if (options.keepLines && numberLineBreaks > 0) {
2097
- replaceContent = newLinesAndIndent();
2098
- } else {
2099
- if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) {
2100
- replaceContent = " ";
2101
- } else if (secondToken !== 5 && secondToken !== 17) {
2102
- hasError = true;
2103
- }
2104
- }
2105
- break;
2106
- case 16:
2107
- hasError = true;
2108
- break;
2109
- }
2110
- if (numberLineBreaks > 0 && (secondToken === 12 || secondToken === 13)) {
2111
- replaceContent = newLinesAndIndent();
2112
- }
2113
- }
2114
- if (secondToken === 17) {
2115
- if (options.keepLines && numberLineBreaks > 0) {
2116
- replaceContent = newLinesAndIndent();
2117
- } else {
2118
- replaceContent = options.insertFinalNewline ? eol : "";
2119
- }
2120
- }
2121
- const secondTokenStart = scanner.getTokenOffset() + formatTextStart;
2122
- addEdit(replaceContent, firstTokenEnd, secondTokenStart);
2123
- firstToken = secondToken;
2124
- }
2125
- return editOperations;
2126
- }
2127
- __name(format, "format");
2128
- function repeat(s, count) {
2129
- let result = "";
2130
- for (let i = 0; i < count; i++) {
2131
- result += s;
2132
- }
2133
- return result;
2134
- }
2135
- __name(repeat, "repeat");
2136
- function computeIndentLevel(content, options) {
2137
- let i = 0;
2138
- let nChars = 0;
2139
- const tabSize = options.tabSize || 4;
2140
- while (i < content.length) {
2141
- let ch = content.charAt(i);
2142
- if (ch === " ") {
2143
- nChars++;
2144
- } else if (ch === " ") {
2145
- nChars += tabSize;
2146
- } else {
2147
- break;
2148
- }
2149
- i++;
2150
- }
2151
- return Math.floor(nChars / tabSize);
2152
- }
2153
- __name(computeIndentLevel, "computeIndentLevel");
2154
- function getEOL(options, text) {
2155
- for (let i = 0; i < text.length; i++) {
2156
- const ch = text.charAt(i);
2157
- if (ch === "\r") {
2158
- if (i + 1 < text.length && text.charAt(i + 1) === "\n") {
2159
- return "\r\n";
2160
- }
2161
- return "\r";
2162
- } else if (ch === "\n") {
2163
- return "\n";
2164
- }
2165
- }
2166
- return options && options.eol || "\n";
2167
- }
2168
- __name(getEOL, "getEOL");
2169
- function isEOL(text, offset) {
2170
- return "\r\n".indexOf(text.charAt(offset)) !== -1;
2171
- }
2172
- __name(isEOL, "isEOL");
2173
-
2174
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js
2175
- var ParseOptions;
2176
- (function(ParseOptions2) {
2177
- ParseOptions2.DEFAULT = {
2178
- allowTrailingComma: false
2179
- };
2180
- })(ParseOptions || (ParseOptions = {}));
2181
- function parse2(text, errors = [], options = ParseOptions.DEFAULT) {
2182
- let currentProperty = null;
2183
- let currentParent = [];
2184
- const previousParents = [];
2185
- function onValue(value) {
2186
- if (Array.isArray(currentParent)) {
2187
- currentParent.push(value);
2188
- } else if (currentProperty !== null) {
2189
- currentParent[currentProperty] = value;
2190
- }
2191
- }
2192
- __name(onValue, "onValue");
2193
- const visitor = {
2194
- onObjectBegin: /* @__PURE__ */ __name(() => {
2195
- const object = {};
2196
- onValue(object);
2197
- previousParents.push(currentParent);
2198
- currentParent = object;
2199
- currentProperty = null;
2200
- }, "onObjectBegin"),
2201
- onObjectProperty: /* @__PURE__ */ __name((name) => {
2202
- currentProperty = name;
2203
- }, "onObjectProperty"),
2204
- onObjectEnd: /* @__PURE__ */ __name(() => {
2205
- currentParent = previousParents.pop();
2206
- }, "onObjectEnd"),
2207
- onArrayBegin: /* @__PURE__ */ __name(() => {
2208
- const array = [];
2209
- onValue(array);
2210
- previousParents.push(currentParent);
2211
- currentParent = array;
2212
- currentProperty = null;
2213
- }, "onArrayBegin"),
2214
- onArrayEnd: /* @__PURE__ */ __name(() => {
2215
- currentParent = previousParents.pop();
2216
- }, "onArrayEnd"),
2217
- onLiteralValue: onValue,
2218
- onError: /* @__PURE__ */ __name((error, offset, length) => {
2219
- errors.push({ error, offset, length });
2220
- }, "onError")
2221
- };
2222
- visit(text, visitor, options);
2223
- return currentParent[0];
2224
- }
2225
- __name(parse2, "parse");
2226
- function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
2227
- let currentParent = { type: "array", offset: -1, length: -1, children: [], parent: void 0 };
2228
- function ensurePropertyComplete(endOffset) {
2229
- if (currentParent.type === "property") {
2230
- currentParent.length = endOffset - currentParent.offset;
2231
- currentParent = currentParent.parent;
2232
- }
2233
- }
2234
- __name(ensurePropertyComplete, "ensurePropertyComplete");
2235
- function onValue(valueNode) {
2236
- currentParent.children.push(valueNode);
2237
- return valueNode;
2238
- }
2239
- __name(onValue, "onValue");
2240
- const visitor = {
2241
- onObjectBegin: /* @__PURE__ */ __name((offset) => {
2242
- currentParent = onValue({ type: "object", offset, length: -1, parent: currentParent, children: [] });
2243
- }, "onObjectBegin"),
2244
- onObjectProperty: /* @__PURE__ */ __name((name, offset, length) => {
2245
- currentParent = onValue({ type: "property", offset, length: -1, parent: currentParent, children: [] });
2246
- currentParent.children.push({ type: "string", value: name, offset, length, parent: currentParent });
2247
- }, "onObjectProperty"),
2248
- onObjectEnd: /* @__PURE__ */ __name((offset, length) => {
2249
- ensurePropertyComplete(offset + length);
2250
- currentParent.length = offset + length - currentParent.offset;
2251
- currentParent = currentParent.parent;
2252
- ensurePropertyComplete(offset + length);
2253
- }, "onObjectEnd"),
2254
- onArrayBegin: /* @__PURE__ */ __name((offset, length) => {
2255
- currentParent = onValue({ type: "array", offset, length: -1, parent: currentParent, children: [] });
2256
- }, "onArrayBegin"),
2257
- onArrayEnd: /* @__PURE__ */ __name((offset, length) => {
2258
- currentParent.length = offset + length - currentParent.offset;
2259
- currentParent = currentParent.parent;
2260
- ensurePropertyComplete(offset + length);
2261
- }, "onArrayEnd"),
2262
- onLiteralValue: /* @__PURE__ */ __name((value, offset, length) => {
2263
- onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });
2264
- ensurePropertyComplete(offset + length);
2265
- }, "onLiteralValue"),
2266
- onSeparator: /* @__PURE__ */ __name((sep, offset, length) => {
2267
- if (currentParent.type === "property") {
2268
- if (sep === ":") {
2269
- currentParent.colonOffset = offset;
2270
- } else if (sep === ",") {
2271
- ensurePropertyComplete(offset);
2272
- }
2273
- }
2274
- }, "onSeparator"),
2275
- onError: /* @__PURE__ */ __name((error, offset, length) => {
2276
- errors.push({ error, offset, length });
2277
- }, "onError")
2278
- };
2279
- visit(text, visitor, options);
2280
- const result = currentParent.children[0];
2281
- if (result) {
2282
- delete result.parent;
2283
- }
2284
- return result;
2285
- }
2286
- __name(parseTree, "parseTree");
2287
- function findNodeAtLocation(root, path8) {
2288
- if (!root) {
2289
- return void 0;
2290
- }
2291
- let node = root;
2292
- for (let segment of path8) {
2293
- if (typeof segment === "string") {
2294
- if (node.type !== "object" || !Array.isArray(node.children)) {
2295
- return void 0;
2296
- }
2297
- let found = false;
2298
- for (const propertyNode of node.children) {
2299
- if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment && propertyNode.children.length === 2) {
2300
- node = propertyNode.children[1];
2301
- found = true;
2302
- break;
2303
- }
2304
- }
2305
- if (!found) {
2306
- return void 0;
2307
- }
2308
- } else {
2309
- const index = segment;
2310
- if (node.type !== "array" || index < 0 || !Array.isArray(node.children) || index >= node.children.length) {
2311
- return void 0;
2312
- }
2313
- node = node.children[index];
2314
- }
2315
- }
2316
- return node;
2317
- }
2318
- __name(findNodeAtLocation, "findNodeAtLocation");
2319
- function visit(text, visitor, options = ParseOptions.DEFAULT) {
2320
- const _scanner = createScanner(text, false);
2321
- const _jsonPath = [];
2322
- function toNoArgVisit(visitFunction) {
2323
- return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
2324
- }
2325
- __name(toNoArgVisit, "toNoArgVisit");
2326
- function toNoArgVisitWithPath(visitFunction) {
2327
- return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
2328
- }
2329
- __name(toNoArgVisitWithPath, "toNoArgVisitWithPath");
2330
- function toOneArgVisit(visitFunction) {
2331
- return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
2332
- }
2333
- __name(toOneArgVisit, "toOneArgVisit");
2334
- function toOneArgVisitWithPath(visitFunction) {
2335
- return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
2336
- }
2337
- __name(toOneArgVisitWithPath, "toOneArgVisitWithPath");
2338
- const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
2339
- const disallowComments = options && options.disallowComments;
2340
- const allowTrailingComma = options && options.allowTrailingComma;
2341
- function scanNext() {
2342
- while (true) {
2343
- const token = _scanner.scan();
2344
- switch (_scanner.getTokenError()) {
2345
- case 4:
2346
- handleError(
2347
- 14
2348
- /* ParseErrorCode.InvalidUnicode */
2349
- );
2350
- break;
2351
- case 5:
2352
- handleError(
2353
- 15
2354
- /* ParseErrorCode.InvalidEscapeCharacter */
2355
- );
2356
- break;
2357
- case 3:
2358
- handleError(
2359
- 13
2360
- /* ParseErrorCode.UnexpectedEndOfNumber */
2361
- );
2362
- break;
2363
- case 1:
2364
- if (!disallowComments) {
2365
- handleError(
2366
- 11
2367
- /* ParseErrorCode.UnexpectedEndOfComment */
2368
- );
2369
- }
2370
- break;
2371
- case 2:
2372
- handleError(
2373
- 12
2374
- /* ParseErrorCode.UnexpectedEndOfString */
2375
- );
2376
- break;
2377
- case 6:
2378
- handleError(
2379
- 16
2380
- /* ParseErrorCode.InvalidCharacter */
2381
- );
2382
- break;
2383
- }
2384
- switch (token) {
2385
- case 12:
2386
- case 13:
2387
- if (disallowComments) {
2388
- handleError(
2389
- 10
2390
- /* ParseErrorCode.InvalidCommentToken */
2391
- );
2392
- } else {
2393
- onComment();
2394
- }
2395
- break;
2396
- case 16:
2397
- handleError(
2398
- 1
2399
- /* ParseErrorCode.InvalidSymbol */
2400
- );
2401
- break;
2402
- case 15:
2403
- case 14:
2404
- break;
2405
- default:
2406
- return token;
2407
- }
2408
- }
2409
- }
2410
- __name(scanNext, "scanNext");
2411
- function handleError(error, skipUntilAfter = [], skipUntil2 = []) {
2412
- onError(error);
2413
- if (skipUntilAfter.length + skipUntil2.length > 0) {
2414
- let token = _scanner.getToken();
2415
- while (token !== 17) {
2416
- if (skipUntilAfter.indexOf(token) !== -1) {
2417
- scanNext();
2418
- break;
2419
- } else if (skipUntil2.indexOf(token) !== -1) {
2420
- break;
2421
- }
2422
- token = scanNext();
2423
- }
2424
- }
2425
- }
2426
- __name(handleError, "handleError");
2427
- function parseString2(isValue) {
2428
- const value = _scanner.getTokenValue();
2429
- if (isValue) {
2430
- onLiteralValue(value);
2431
- } else {
2432
- onObjectProperty(value);
2433
- _jsonPath.push(value);
2434
- }
2435
- scanNext();
2436
- return true;
2437
- }
2438
- __name(parseString2, "parseString");
2439
- function parseLiteral() {
2440
- switch (_scanner.getToken()) {
2441
- case 11:
2442
- const tokenValue = _scanner.getTokenValue();
2443
- let value = Number(tokenValue);
2444
- if (isNaN(value)) {
2445
- handleError(
2446
- 2
2447
- /* ParseErrorCode.InvalidNumberFormat */
2448
- );
2449
- value = 0;
2450
- }
2451
- onLiteralValue(value);
2452
- break;
2453
- case 7:
2454
- onLiteralValue(null);
2455
- break;
2456
- case 8:
2457
- onLiteralValue(true);
2458
- break;
2459
- case 9:
2460
- onLiteralValue(false);
2461
- break;
2462
- default:
2463
- return false;
2464
- }
2465
- scanNext();
2466
- return true;
2467
- }
2468
- __name(parseLiteral, "parseLiteral");
2469
- function parseProperty() {
2470
- if (_scanner.getToken() !== 10) {
2471
- handleError(3, [], [
2472
- 2,
2473
- 5
2474
- /* SyntaxKind.CommaToken */
2475
- ]);
2476
- return false;
2477
- }
2478
- parseString2(false);
2479
- if (_scanner.getToken() === 6) {
2480
- onSeparator(":");
2481
- scanNext();
2482
- if (!parseValue2()) {
2483
- handleError(4, [], [
2484
- 2,
2485
- 5
2486
- /* SyntaxKind.CommaToken */
2487
- ]);
2488
- }
2489
- } else {
2490
- handleError(5, [], [
2491
- 2,
2492
- 5
2493
- /* SyntaxKind.CommaToken */
2494
- ]);
2495
- }
2496
- _jsonPath.pop();
2497
- return true;
2498
- }
2499
- __name(parseProperty, "parseProperty");
2500
- function parseObject() {
2501
- onObjectBegin();
2502
- scanNext();
2503
- let needsComma = false;
2504
- while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
2505
- if (_scanner.getToken() === 5) {
2506
- if (!needsComma) {
2507
- handleError(4, [], []);
2508
- }
2509
- onSeparator(",");
2510
- scanNext();
2511
- if (_scanner.getToken() === 2 && allowTrailingComma) {
2512
- break;
2513
- }
2514
- } else if (needsComma) {
2515
- handleError(6, [], []);
2516
- }
2517
- if (!parseProperty()) {
2518
- handleError(4, [], [
2519
- 2,
2520
- 5
2521
- /* SyntaxKind.CommaToken */
2522
- ]);
2523
- }
2524
- needsComma = true;
2525
- }
2526
- onObjectEnd();
2527
- if (_scanner.getToken() !== 2) {
2528
- handleError(7, [
2529
- 2
2530
- /* SyntaxKind.CloseBraceToken */
2531
- ], []);
2532
- } else {
2533
- scanNext();
2534
- }
2535
- return true;
2536
- }
2537
- __name(parseObject, "parseObject");
2538
- function parseArray2() {
2539
- onArrayBegin();
2540
- scanNext();
2541
- let isFirstElement = true;
2542
- let needsComma = false;
2543
- while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
2544
- if (_scanner.getToken() === 5) {
2545
- if (!needsComma) {
2546
- handleError(4, [], []);
2547
- }
2548
- onSeparator(",");
2549
- scanNext();
2550
- if (_scanner.getToken() === 4 && allowTrailingComma) {
2551
- break;
2552
- }
2553
- } else if (needsComma) {
2554
- handleError(6, [], []);
2555
- }
2556
- if (isFirstElement) {
2557
- _jsonPath.push(0);
2558
- isFirstElement = false;
2559
- } else {
2560
- _jsonPath[_jsonPath.length - 1]++;
2561
- }
2562
- if (!parseValue2()) {
2563
- handleError(4, [], [
2564
- 4,
2565
- 5
2566
- /* SyntaxKind.CommaToken */
2567
- ]);
2568
- }
2569
- needsComma = true;
2570
- }
2571
- onArrayEnd();
2572
- if (!isFirstElement) {
2573
- _jsonPath.pop();
2574
- }
2575
- if (_scanner.getToken() !== 4) {
2576
- handleError(8, [
2577
- 4
2578
- /* SyntaxKind.CloseBracketToken */
2579
- ], []);
2580
- } else {
2581
- scanNext();
2582
- }
2583
- return true;
2584
- }
2585
- __name(parseArray2, "parseArray");
2586
- function parseValue2() {
2587
- switch (_scanner.getToken()) {
2588
- case 3:
2589
- return parseArray2();
2590
- case 1:
2591
- return parseObject();
2592
- case 10:
2593
- return parseString2(true);
2594
- default:
2595
- return parseLiteral();
2596
- }
2597
- }
2598
- __name(parseValue2, "parseValue");
2599
- scanNext();
2600
- if (_scanner.getToken() === 17) {
2601
- if (options.allowEmptyContent) {
2602
- return true;
2603
- }
2604
- handleError(4, [], []);
2605
- return false;
2606
- }
2607
- if (!parseValue2()) {
2608
- handleError(4, [], []);
2609
- return false;
2610
- }
2611
- if (_scanner.getToken() !== 17) {
2612
- handleError(9, [], []);
2613
- }
2614
- return true;
2615
- }
2616
- __name(visit, "visit");
2617
- function getNodeType(value) {
2618
- switch (typeof value) {
2619
- case "boolean":
2620
- return "boolean";
2621
- case "number":
2622
- return "number";
2623
- case "string":
2624
- return "string";
2625
- case "object": {
2626
- if (!value) {
2627
- return "null";
2628
- } else if (Array.isArray(value)) {
2629
- return "array";
2630
- }
2631
- return "object";
2632
- }
2633
- default:
2634
- return "null";
2635
- }
2636
- }
2637
- __name(getNodeType, "getNodeType");
2638
-
2639
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js
2640
- function setProperty(text, originalPath, value, options) {
2641
- const path8 = originalPath.slice();
2642
- const errors = [];
2643
- const root = parseTree(text, errors);
2644
- let parent = void 0;
2645
- let lastSegment = void 0;
2646
- while (path8.length > 0) {
2647
- lastSegment = path8.pop();
2648
- parent = findNodeAtLocation(root, path8);
2649
- if (parent === void 0 && value !== void 0) {
2650
- if (typeof lastSegment === "string") {
2651
- value = { [lastSegment]: value };
2652
- } else {
2653
- value = [value];
2654
- }
2655
- } else {
2656
- break;
2657
- }
2658
- }
2659
- if (!parent) {
2660
- if (value === void 0) {
2661
- throw new Error("Can not delete in empty document");
2662
- }
2663
- return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, options);
2664
- } else if (parent.type === "object" && typeof lastSegment === "string" && Array.isArray(parent.children)) {
2665
- const existing = findNodeAtLocation(parent, [lastSegment]);
2666
- if (existing !== void 0) {
2667
- if (value === void 0) {
2668
- if (!existing.parent) {
2669
- throw new Error("Malformed AST");
2670
- }
2671
- const propertyIndex = parent.children.indexOf(existing.parent);
2672
- let removeBegin;
2673
- let removeEnd = existing.parent.offset + existing.parent.length;
2674
- if (propertyIndex > 0) {
2675
- let previous = parent.children[propertyIndex - 1];
2676
- removeBegin = previous.offset + previous.length;
2677
- } else {
2678
- removeBegin = parent.offset + 1;
2679
- if (parent.children.length > 1) {
2680
- let next = parent.children[1];
2681
- removeEnd = next.offset;
2682
- }
2683
- }
2684
- return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: "" }, options);
2685
- } else {
2686
- return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options);
2687
- }
2688
- } else {
2689
- if (value === void 0) {
2690
- return [];
2691
- }
2692
- const newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;
2693
- const index = options.getInsertionIndex ? options.getInsertionIndex(parent.children.map((p) => p.children[0].value)) : parent.children.length;
2694
- let edit;
2695
- if (index > 0) {
2696
- let previous = parent.children[index - 1];
2697
- edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty };
2698
- } else if (parent.children.length === 0) {
2699
- edit = { offset: parent.offset + 1, length: 0, content: newProperty };
2700
- } else {
2701
- edit = { offset: parent.offset + 1, length: 0, content: newProperty + "," };
2702
- }
2703
- return withFormatting(text, edit, options);
2704
- }
2705
- } else if (parent.type === "array" && typeof lastSegment === "number" && Array.isArray(parent.children)) {
2706
- const insertIndex = lastSegment;
2707
- if (insertIndex === -1) {
2708
- const newProperty = `${JSON.stringify(value)}`;
2709
- let edit;
2710
- if (parent.children.length === 0) {
2711
- edit = { offset: parent.offset + 1, length: 0, content: newProperty };
2712
- } else {
2713
- const previous = parent.children[parent.children.length - 1];
2714
- edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty };
2715
- }
2716
- return withFormatting(text, edit, options);
2717
- } else if (value === void 0 && parent.children.length >= 0) {
2718
- const removalIndex = lastSegment;
2719
- const toRemove = parent.children[removalIndex];
2720
- let edit;
2721
- if (parent.children.length === 1) {
2722
- edit = { offset: parent.offset + 1, length: parent.length - 2, content: "" };
2723
- } else if (parent.children.length - 1 === removalIndex) {
2724
- let previous = parent.children[removalIndex - 1];
2725
- let offset = previous.offset + previous.length;
2726
- let parentEndOffset = parent.offset + parent.length;
2727
- edit = { offset, length: parentEndOffset - 2 - offset, content: "" };
2728
- } else {
2729
- edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: "" };
2730
- }
2731
- return withFormatting(text, edit, options);
2732
- } else if (value !== void 0) {
2733
- let edit;
2734
- const newProperty = `${JSON.stringify(value)}`;
2735
- if (!options.isArrayInsertion && parent.children.length > lastSegment) {
2736
- const toModify = parent.children[lastSegment];
2737
- edit = { offset: toModify.offset, length: toModify.length, content: newProperty };
2738
- } else if (parent.children.length === 0 || lastSegment === 0) {
2739
- edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + "," };
2740
- } else {
2741
- const index = lastSegment > parent.children.length ? parent.children.length : lastSegment;
2742
- const previous = parent.children[index - 1];
2743
- edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty };
2744
- }
2745
- return withFormatting(text, edit, options);
2746
- } else {
2747
- throw new Error(`Can not ${value === void 0 ? "remove" : options.isArrayInsertion ? "insert" : "modify"} Array index ${insertIndex} as length is not sufficient`);
2748
- }
2749
- } else {
2750
- throw new Error(`Can not add ${typeof lastSegment !== "number" ? "index" : "property"} to parent of type ${parent.type}`);
2751
- }
2752
- }
2753
- __name(setProperty, "setProperty");
2754
- function withFormatting(text, edit, options) {
2755
- if (!options.formattingOptions) {
2756
- return [edit];
2757
- }
2758
- let newText = applyEdit(text, edit);
2759
- let begin = edit.offset;
2760
- let end = edit.offset + edit.content.length;
2761
- if (edit.length === 0 || edit.content.length === 0) {
2762
- while (begin > 0 && !isEOL(newText, begin - 1)) {
2763
- begin--;
2764
- }
2765
- while (end < newText.length && !isEOL(newText, end)) {
2766
- end++;
2767
- }
2768
- }
2769
- const edits = format(newText, { offset: begin, length: end - begin }, { ...options.formattingOptions, keepLines: false });
2770
- for (let i = edits.length - 1; i >= 0; i--) {
2771
- const edit2 = edits[i];
2772
- newText = applyEdit(newText, edit2);
2773
- begin = Math.min(begin, edit2.offset);
2774
- end = Math.max(end, edit2.offset + edit2.length);
2775
- end += edit2.content.length - edit2.length;
2776
- }
2777
- const editLength = text.length - (newText.length - end) - begin;
2778
- return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }];
2779
- }
2780
- __name(withFormatting, "withFormatting");
2781
- function applyEdit(text, edit) {
2782
- return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length);
2783
- }
2784
- __name(applyEdit, "applyEdit");
2785
-
2786
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
2787
- var ScanError;
2788
- (function(ScanError2) {
2789
- ScanError2[ScanError2["None"] = 0] = "None";
2790
- ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
2791
- ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
2792
- ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
2793
- ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
2794
- ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
2795
- ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
2796
- })(ScanError || (ScanError = {}));
2797
- var SyntaxKind;
2798
- (function(SyntaxKind2) {
2799
- SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
2800
- SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
2801
- SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
2802
- SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
2803
- SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
2804
- SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
2805
- SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
2806
- SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
2807
- SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
2808
- SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
2809
- SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
2810
- SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
2811
- SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
2812
- SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
2813
- SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
2814
- SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
2815
- SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
2816
- })(SyntaxKind || (SyntaxKind = {}));
2817
- var parse3 = parse2;
2818
- var ParseErrorCode;
2819
- (function(ParseErrorCode2) {
2820
- ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
2821
- ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
2822
- ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
2823
- ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
2824
- ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
2825
- ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
2826
- ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
2827
- ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
2828
- ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
2829
- ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
2830
- ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
2831
- ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
2832
- ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
2833
- ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
2834
- ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
2835
- ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
2836
- })(ParseErrorCode || (ParseErrorCode = {}));
2837
- function printParseErrorCode(code) {
2838
- switch (code) {
2839
- case 1:
2840
- return "InvalidSymbol";
2841
- case 2:
2842
- return "InvalidNumberFormat";
2843
- case 3:
2844
- return "PropertyNameExpected";
2845
- case 4:
2846
- return "ValueExpected";
2847
- case 5:
2848
- return "ColonExpected";
2849
- case 6:
2850
- return "CommaExpected";
2851
- case 7:
2852
- return "CloseBraceExpected";
2853
- case 8:
2854
- return "CloseBracketExpected";
2855
- case 9:
2856
- return "EndOfFileExpected";
2857
- case 10:
2858
- return "InvalidCommentToken";
2859
- case 11:
2860
- return "UnexpectedEndOfComment";
2861
- case 12:
2862
- return "UnexpectedEndOfString";
2863
- case 13:
2864
- return "UnexpectedEndOfNumber";
2865
- case 14:
2866
- return "InvalidUnicode";
2867
- case 15:
2868
- return "InvalidEscapeCharacter";
2869
- case 16:
2870
- return "InvalidCharacter";
2871
- }
2872
- return "<unknown ParseErrorCode>";
2873
- }
2874
- __name(printParseErrorCode, "printParseErrorCode");
2875
- function format2(documentText, range, options) {
2876
- return format(documentText, range, options);
2877
- }
2878
- __name(format2, "format");
2879
- function modify(text, path8, value, options) {
2880
- return setProperty(text, path8, value, options);
2881
- }
2882
- __name(modify, "modify");
2883
- function applyEdits(text, edits) {
2884
- let sortedEdits = edits.slice(0).sort((a, b) => {
2885
- const diff = a.offset - b.offset;
2886
- if (diff === 0) {
2887
- return a.length - b.length;
2888
- }
2889
- return diff;
2890
- });
2891
- let lastModifiedOffset = text.length;
2892
- for (let i = sortedEdits.length - 1; i >= 0; i--) {
2893
- let e = sortedEdits[i];
2894
- if (e.offset + e.length <= lastModifiedOffset) {
2895
- text = applyEdit(text, e);
2896
- } else {
2897
- throw new Error("Overlapping edit");
2898
- }
2899
- lastModifiedOffset = e.offset;
2900
- }
2901
- return text;
2902
- }
2903
- __name(applyEdits, "applyEdits");
2904
-
2905
- // src/errors.ts
2906
- var UserError = class extends Error {
2907
- static {
2908
- __name(this, "UserError");
2909
- }
2910
- telemetryMessage;
2911
- constructor(message, options) {
2912
- super(message, options);
2913
- Object.setPrototypeOf(this, new.target.prototype);
2914
- this.telemetryMessage = options?.telemetryMessage === true ? message : options?.telemetryMessage;
2915
- }
2916
- };
2917
- var DeprecationError = class extends UserError {
2918
- static {
2919
- __name(this, "DeprecationError");
2920
- }
2921
- constructor(message, options) {
2922
- super(`Deprecation:
2923
- ${message}`, options);
2924
- }
2925
- };
2926
- var FatalError = class extends UserError {
2927
- constructor(message, code, options) {
2928
- super(message, options);
2929
- this.code = code;
2930
- }
2931
- static {
2932
- __name(this, "FatalError");
2933
- }
2934
- };
2935
- var CommandLineArgsError = class extends UserError {
2936
- static {
2937
- __name(this, "CommandLineArgsError");
2938
- }
2939
- };
2940
- var JsonFriendlyFatalError = class extends FatalError {
2941
- constructor(message, code, options) {
2942
- super(message, code, options);
2943
- this.code = code;
2944
- }
2945
- static {
2946
- __name(this, "JsonFriendlyFatalError");
2947
- }
2948
- };
2949
- var MissingConfigError = class extends Error {
2950
- static {
2951
- __name(this, "MissingConfigError");
2952
- }
2953
- telemetryMessage;
2954
- constructor(key) {
2955
- super(`Missing config value for ${key}`);
2956
- this.telemetryMessage = `Missing config value for ${key}`;
2957
- }
2958
- };
2959
- function createFatalError(message, isJson, code, telemetryMessage) {
2960
- if (isJson) {
2961
- return new JsonFriendlyFatalError(
2962
- JSON.stringify(message),
2963
- code,
2964
- telemetryMessage
2965
- );
2966
- } else {
2967
- return new FatalError(`${message}`, code, telemetryMessage);
2968
- }
2969
- }
2970
- __name(createFatalError, "createFatalError");
2971
-
2972
- // src/parse.ts
2973
- var ParseError = class extends UserError {
2974
- static {
2975
- __name(this, "ParseError");
2976
- }
2977
- text;
2978
- notes;
2979
- location;
2980
- kind;
2981
- constructor({ text, notes, location, kind, telemetryMessage }) {
2982
- super(text, { telemetryMessage });
2983
- this.name = this.constructor.name;
2984
- this.text = text;
2985
- this.notes = notes ?? [];
2986
- this.location = location;
2987
- this.kind = kind ?? "error";
2988
- }
2989
- };
2990
- var APIError = class extends ParseError {
2991
- static {
2992
- __name(this, "APIError");
2993
- }
2994
- #status;
2995
- code;
2996
- accountTag;
2997
- constructor({ status, ...rest }) {
2998
- super(rest);
2999
- this.name = this.constructor.name;
3000
- this.#status = status;
3001
- }
3002
- isGatewayError() {
3003
- if (this.#status !== void 0) {
3004
- return [524].includes(this.#status);
3005
- }
3006
- return false;
3007
- }
3008
- isRetryable() {
3009
- return String(this.#status).startsWith("5");
3010
- }
3011
- // Allow `APIError`s to be marked as handled.
3012
- #reportable = true;
3013
- get reportable() {
3014
- return this.#reportable;
3015
- }
3016
- preventReport() {
3017
- this.#reportable = false;
3018
- }
3019
- };
3020
- function parseTOML(input, file) {
3021
- try {
3022
- return dist_default.parse(input);
3023
- } catch (err) {
3024
- if (!(err instanceof TomlError)) {
3025
- throw err;
3026
- }
3027
- const location = {
3028
- lineText: input.split("\n")[err.line - 1],
3029
- line: err.line,
3030
- column: err.column - 1,
3031
- file,
3032
- fileText: input
3033
- };
3034
- throw new ParseError({
3035
- text: err.message.substring(0, err.message.indexOf("\n")),
3036
- location,
3037
- telemetryMessage: "TOML parse error"
3038
- });
3039
- }
3040
- }
3041
- __name(parseTOML, "parseTOML");
3042
- function parsePackageJSON(input, file) {
3043
- return parseJSON(input, file);
3044
- }
3045
- __name(parsePackageJSON, "parsePackageJSON");
3046
- function parseJSON(input, file) {
3047
- return parseJSONC(input, file, {
3048
- allowEmptyContent: false,
3049
- allowTrailingComma: false,
3050
- disallowComments: true
3051
- });
3052
- }
3053
- __name(parseJSON, "parseJSON");
3054
- function parseJSONC(input, file, options = { allowTrailingComma: true }) {
3055
- const errors = [];
3056
- const data = parse3(input, errors, options);
3057
- if (errors.length) {
3058
- throw new ParseError({
3059
- text: printParseErrorCode(errors[0].error),
3060
- location: {
3061
- ...indexLocation({ file, fileText: input }, errors[0].offset + 1),
3062
- length: errors[0].length
3063
- },
3064
- telemetryMessage: "JSON(C) parse error"
3065
- });
3066
- }
3067
- return data;
3068
- }
3069
- __name(parseJSONC, "parseJSONC");
3070
- function readFileSyncToBuffer(file) {
3071
- try {
3072
- return readFileSync$1(file);
3073
- } catch (err) {
3074
- const { message } = err;
3075
- throw new ParseError({
3076
- text: `Could not read file: ${file}`,
3077
- notes: [
3078
- {
3079
- text: message.replace(file, resolve(file))
3080
- }
3081
- ]
3082
- });
3083
- }
3084
- }
3085
- __name(readFileSyncToBuffer, "readFileSyncToBuffer");
3086
- function readFileSync(file) {
3087
- try {
3088
- const buffer = readFileSync$1(file);
3089
- return removeBOMAndValidate(buffer, file);
3090
- } catch (err) {
3091
- if (err instanceof ParseError) {
3092
- throw err;
3093
- }
3094
- const { message } = err;
3095
- throw new ParseError({
3096
- text: `Could not read file: ${file}`,
3097
- notes: [
3098
- {
3099
- text: message.replace(file, resolve(file))
3100
- }
3101
- ],
3102
- telemetryMessage: "Could not read file"
3103
- });
3104
- }
3105
- }
3106
- __name(readFileSync, "readFileSync");
3107
- function indexLocation(file, index) {
3108
- let lineText, line = 0, column = 0, cursor = 0;
3109
- const { fileText = "" } = file;
3110
- for (const row of fileText.split("\n")) {
3111
- line++;
3112
- cursor += row.length + 1;
3113
- if (cursor >= index) {
3114
- lineText = row;
3115
- column = row.length - (cursor - index);
3116
- break;
3117
- }
3118
- }
3119
- return { lineText, line, column, ...file };
3120
- }
3121
- __name(indexLocation, "indexLocation");
3122
- function searchLocation(file, query) {
3123
- let lineText, length, line = 0, column = 0;
3124
- const queryText = String(query);
3125
- const { fileText = "" } = file;
3126
- for (const content of fileText.split("\n")) {
3127
- line++;
3128
- const index = content.indexOf(queryText);
3129
- if (index >= 0) {
3130
- lineText = content;
3131
- column = index;
3132
- length = queryText.length;
3133
- break;
3134
- }
3135
- }
3136
- return { lineText, line, column, length, ...file };
3137
- }
3138
- __name(searchLocation, "searchLocation");
3139
- var units = {
3140
- nanoseconds: 1e-9,
3141
- nanosecond: 1e-9,
3142
- microseconds: 1e-6,
3143
- microsecond: 1e-6,
3144
- milliseconds: 1e-3,
3145
- millisecond: 1e-3,
3146
- seconds: 1,
3147
- second: 1,
3148
- minutes: 60,
3149
- minute: 60,
3150
- hours: 3600,
3151
- hour: 3600,
3152
- days: 86400,
3153
- day: 86400,
3154
- weeks: 604800,
3155
- week: 604800,
3156
- month: 18144e3,
3157
- year: 220752e3,
3158
- nsecs: 1e-9,
3159
- nsec: 1e-9,
3160
- usecs: 1e-6,
3161
- usec: 1e-6,
3162
- msecs: 1e-3,
3163
- msec: 1e-3,
3164
- secs: 1,
3165
- sec: 1,
3166
- mins: 60,
3167
- min: 60,
3168
- ns: 1e-9,
3169
- us: 1e-6,
3170
- ms: 1e-3,
3171
- mo: 18144e3,
3172
- yr: 220752e3,
3173
- s: 1,
3174
- m: 60,
3175
- h: 3600,
3176
- d: 86400,
3177
- w: 604800,
3178
- y: 220752e3
3179
- };
3180
- function parseHumanDuration(s) {
3181
- const unitsMap = new Map(Object.entries(units));
3182
- s = s.trim().toLowerCase();
3183
- let base = 1;
3184
- for (const [name, _2] of unitsMap) {
3185
- if (s.endsWith(name)) {
3186
- s = s.substring(0, s.length - name.length);
3187
- base = unitsMap.get(name) || 1;
3188
- break;
3189
- }
3190
- }
3191
- return Number(s) * base;
3192
- }
3193
- __name(parseHumanDuration, "parseHumanDuration");
3194
- function parseNonHyphenedUuid(uuid) {
3195
- if (uuid == null || uuid.includes("-")) {
3196
- return uuid;
3197
- }
3198
- if (uuid.length != 32) {
3199
- return null;
3200
- }
3201
- const uuid_parts = [];
3202
- uuid_parts.push(uuid.slice(0, 8));
3203
- uuid_parts.push(uuid.slice(8, 12));
3204
- uuid_parts.push(uuid.slice(12, 16));
3205
- uuid_parts.push(uuid.slice(16, 20));
3206
- uuid_parts.push(uuid.slice(20));
3207
- let hyphenated = "";
3208
- uuid_parts.forEach((part) => hyphenated += part + "-");
3209
- return hyphenated.slice(0, 36);
3210
- }
3211
- __name(parseNonHyphenedUuid, "parseNonHyphenedUuid");
3212
- function parseByteSize(s, base = void 0) {
3213
- const match = s.match(
3214
- /^(\d*\.*\d*)\s*([kKmMgGtTpP]{0,1})([i]{0,1}[bB]{0,1})$/
3215
- );
3216
- if (!match) {
3217
- return NaN;
3218
- }
3219
- const size = match[1];
3220
- if (size.length === 0 || isNaN(Number(size))) {
3221
- return NaN;
3222
- }
3223
- const unit = match[2].toLowerCase();
3224
- const sizeUnits = {
3225
- k: 1,
3226
- m: 2,
3227
- g: 3,
3228
- t: 4,
3229
- p: 5
3230
- };
3231
- if (unit.length !== 0 && !(unit in sizeUnits)) {
3232
- return NaN;
3233
- }
3234
- const binary = match[3].toLowerCase() == "ib";
3235
- if (binary && unit.length === 0) {
3236
- return NaN;
3237
- }
3238
- const pow = sizeUnits[unit] || 0;
3239
- return Math.floor(
3240
- Number(size) * Math.pow(base ?? (binary ? 1024 : 1e3), pow)
3241
- );
3242
- }
3243
- __name(parseByteSize, "parseByteSize");
3244
- var UNSUPPORTED_BOMS = [
3245
- {
3246
- buffer: Buffer.from([0, 0, 254, 255]),
3247
- encoding: "UTF-32 BE"
3248
- },
3249
- {
3250
- buffer: Buffer.from([255, 254, 0, 0]),
3251
- encoding: "UTF-32 LE"
3252
- },
3253
- {
3254
- buffer: Buffer.from([254, 255]),
3255
- encoding: "UTF-16 BE"
3256
- },
3257
- {
3258
- buffer: Buffer.from([255, 254]),
3259
- encoding: "UTF-16 LE"
3260
- }
3261
- ];
3262
- function removeBOMAndValidate(buffer, file) {
3263
- for (const bom of UNSUPPORTED_BOMS) {
3264
- if (buffer.length >= bom.buffer.length && buffer.subarray(0, bom.buffer.length).equals(bom.buffer)) {
3265
- throw new ParseError({
3266
- text: `Configuration file contains ${bom.encoding} byte order marker`,
3267
- notes: [
3268
- {
3269
- text: `The file "${file}" appears to be encoded as ${bom.encoding}. Please save the file as UTF-8 without BOM.`
3270
- }
3271
- ],
3272
- location: { file, line: 1, column: 0 },
3273
- telemetryMessage: `${bom.encoding} BOM detected`
3274
- });
3275
- }
3276
- }
3277
- const content = buffer.toString("utf-8");
3278
- if (content.charCodeAt(0) === 65279) {
3279
- return content.slice(1);
3280
- }
3281
- return content;
3282
- }
3283
- __name(removeBOMAndValidate, "removeBOMAndValidate");
3284
- var typeMappings = {
3285
- directory: "isDirectory",
3286
- file: "isFile"
3287
- };
3288
- function checkType(type) {
3289
- if (type in typeMappings) {
3290
- return;
3291
- }
3292
- throw new Error(`Invalid type specified: ${type}`);
3293
- }
3294
- __name(checkType, "checkType");
3295
- var matchType = /* @__PURE__ */ __name((type, stat) => type === void 0 || stat[typeMappings[type]](), "matchType");
3296
- var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath, "toPath");
3297
- function locatePathSync(paths, {
3298
- cwd = process2.cwd(),
3299
- type = "file",
3300
- allowSymlinks = true
3301
- } = {}) {
3302
- checkType(type);
3303
- cwd = toPath(cwd);
3304
- const statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;
3305
- for (const path_ of paths) {
3306
- try {
3307
- const stat = statFunction(path7.resolve(cwd, path_));
3308
- if (matchType(type, stat)) {
3309
- return path_;
3310
- }
3311
- } catch {
3312
- }
3313
- }
3314
- }
3315
- __name(locatePathSync, "locatePathSync");
3316
-
3317
- // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
3318
- var toPath2 = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath, "toPath");
3319
- var findUpStop = Symbol("findUpStop");
3320
- function findUpMultipleSync(name, options = {}) {
3321
- let directory = path7.resolve(toPath2(options.cwd) || "");
3322
- const { root } = path7.parse(directory);
3323
- const stopAt = options.stopAt || root;
3324
- const limit = options.limit || Number.POSITIVE_INFINITY;
3325
- const paths = [name].flat();
3326
- const runMatcher = /* @__PURE__ */ __name((locateOptions) => {
3327
- if (typeof name !== "function") {
3328
- return locatePathSync(paths, locateOptions);
3329
- }
3330
- const foundPath = name(locateOptions.cwd);
3331
- if (typeof foundPath === "string") {
3332
- return locatePathSync([foundPath], locateOptions);
3333
- }
3334
- return foundPath;
3335
- }, "runMatcher");
3336
- const matches = [];
3337
- while (true) {
3338
- const foundPath = runMatcher({ ...options, cwd: directory });
3339
- if (foundPath === findUpStop) {
3340
- break;
3341
- }
3342
- if (foundPath) {
3343
- matches.push(path7.resolve(directory, foundPath));
3344
- }
3345
- if (directory === stopAt || matches.length >= limit) {
3346
- break;
3347
- }
3348
- directory = path7.dirname(directory);
3349
- }
3350
- return matches;
3351
- }
3352
- __name(findUpMultipleSync, "findUpMultipleSync");
3353
- function findUpSync(name, options = {}) {
3354
- const matches = findUpMultipleSync(name, { ...options, limit: 1 });
3355
- return matches[0];
3356
- }
3357
- __name(findUpSync, "findUpSync");
3358
-
3359
- // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
3360
- function dedent(templ) {
3361
- var values = [];
3362
- for (var _i = 1; _i < arguments.length; _i++) {
3363
- values[_i - 1] = arguments[_i];
3364
- }
3365
- var strings = Array.from(typeof templ === "string" ? [templ] : templ);
3366
- strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
3367
- var indentLengths = strings.reduce(function(arr, str) {
3368
- var matches = str.match(/\n([\t ]+|(?!\s).)/g);
3369
- if (matches) {
3370
- return arr.concat(matches.map(function(match) {
3371
- var _a, _b;
3372
- return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
3373
- }));
3374
- }
3375
- return arr;
3376
- }, []);
3377
- if (indentLengths.length) {
3378
- var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
3379
- strings = strings.map(function(str) {
3380
- return str.replace(pattern_1, "\n");
3381
- });
3382
- }
3383
- strings[0] = strings[0].replace(/^\r?\n/, "");
3384
- var string = strings[0];
3385
- values.forEach(function(value, i) {
3386
- var endentations = string.match(/(?:^|\n)( *)$/);
3387
- var endentation = endentations ? endentations[1] : "";
3388
- var indentedValue = value;
3389
- if (typeof value === "string" && value.includes("\n")) {
3390
- indentedValue = String(value).split("\n").map(function(str, i2) {
3391
- return i2 === 0 ? str : "" + endentation + str;
3392
- }).join("\n");
3393
- }
3394
- string += indentedValue + strings[i + 1];
3395
- });
3396
- return string;
3397
- }
3398
- __name(dedent, "dedent");
3399
- var esm_default = dedent;
3400
-
3401
- // src/config/config-helpers.ts
3402
- function resolveWranglerConfigPath({
3403
- config,
3404
- script
3405
- }, options) {
3406
- if (config !== void 0) {
3407
- return {
3408
- userConfigPath: config,
3409
- configPath: config,
3410
- deployConfigPath: void 0,
3411
- redirected: false
3412
- };
3413
- }
3414
- const leafPath = script !== void 0 ? path7.dirname(script) : process.cwd();
3415
- return findWranglerConfig(leafPath, options);
3416
- }
3417
- __name(resolveWranglerConfigPath, "resolveWranglerConfigPath");
3418
- function findWranglerConfig(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
3419
- const userConfigPath = findUpSync(`wrangler.json`, { cwd: referencePath }) ?? findUpSync(`wrangler.jsonc`, { cwd: referencePath }) ?? findUpSync(`wrangler.toml`, { cwd: referencePath });
3420
- if (!useRedirectIfAvailable) {
3421
- return {
3422
- userConfigPath,
3423
- configPath: userConfigPath,
3424
- deployConfigPath: void 0,
3425
- redirected: false
3426
- };
3427
- }
3428
- const { configPath, deployConfigPath, redirected } = findRedirectedWranglerConfig(referencePath, userConfigPath);
3429
- return {
3430
- userConfigPath,
3431
- configPath,
3432
- deployConfigPath,
3433
- redirected
3434
- };
3435
- }
3436
- __name(findWranglerConfig, "findWranglerConfig");
3437
- function findRedirectedWranglerConfig(cwd, userConfigPath) {
3438
- const deployConfigPath = findUpSync(PATH_TO_DEPLOY_CONFIG, { cwd });
3439
- if (deployConfigPath === void 0) {
3440
- return { configPath: userConfigPath, deployConfigPath, redirected: false };
3441
- }
3442
- let redirectedConfigPath;
3443
- const deployConfigFile = readFileSync(deployConfigPath);
3444
- try {
3445
- const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
3446
- redirectedConfigPath = deployConfig.configPath && path7.resolve(path7.dirname(deployConfigPath), deployConfig.configPath);
3447
- } catch (e) {
3448
- throw new UserError(
3449
- `Failed to parse the deploy configuration file at ${path7.relative(".", deployConfigPath)}`,
3450
- { cause: e }
3451
- );
3452
- }
3453
- if (!redirectedConfigPath) {
3454
- throw new UserError(esm_default`
3455
- A deploy configuration file was found at "${path7.relative(".", deployConfigPath)}".
3456
- But this is not valid - the required "configPath" property was not found.
3457
- Instead this file contains:
3458
- \`\`\`
3459
- ${deployConfigFile}
3460
- \`\`\`
3461
- `);
3462
- }
3463
- if (!existsSync(redirectedConfigPath)) {
3464
- throw new UserError(esm_default`
3465
- There is a deploy configuration at "${path7.relative(".", deployConfigPath)}".
3466
- But the redirected configuration path it points to, "${path7.relative(".", redirectedConfigPath)}", does not exist.
3467
- `);
3468
- }
3469
- if (userConfigPath) {
3470
- if (path7.join(path7.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) {
3471
- throw new UserError(esm_default`
3472
- Found both a user configuration file at "${path7.relative(".", userConfigPath)}"
3473
- and a deploy configuration file at "${path7.relative(".", deployConfigPath)}".
3474
- But these do not share the same base path so it is not clear which should be used.
3475
- `);
3476
- }
3477
- }
3478
- return {
3479
- configPath: redirectedConfigPath,
3480
- deployConfigPath,
3481
- redirected: true
3482
- };
3483
- }
3484
- __name(findRedirectedWranglerConfig, "findRedirectedWranglerConfig");
3485
- function isRedirectedRawConfig(rawConfig, configPath, userConfigPath) {
3486
- return configPath !== void 0 && configPath !== userConfigPath;
3487
- }
3488
- __name(isRedirectedRawConfig, "isRedirectedRawConfig");
3489
-
3490
- // src/config/index.ts
3491
- function configFormat(configPath) {
3492
- if (configPath?.endsWith("toml")) {
3493
- return "toml";
3494
- } else if (configPath?.endsWith("json") || configPath?.endsWith("jsonc")) {
3495
- return "jsonc";
3496
- }
3497
- return "none";
3498
- }
3499
- __name(configFormat, "configFormat");
3500
- function configFileName(configPath) {
3501
- const format3 = configFormat(configPath);
3502
- if (format3 === "toml") {
3503
- return "wrangler.toml";
3504
- } else if (format3 === "jsonc") {
3505
- return "wrangler.json";
3506
- } else {
3507
- return "Wrangler configuration";
3508
- }
3509
- }
3510
- __name(configFileName, "configFileName");
3511
- function formatConfigSnippet(snippet, configPath, formatted = true) {
3512
- const format3 = configFormat(configPath);
3513
- if (format3 === "toml") {
3514
- return dist_default.stringify(snippet);
3515
- } else {
3516
- return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet);
3517
- }
3518
- }
3519
- __name(formatConfigSnippet, "formatConfigSnippet");
3520
- var parseRawConfigFile = /* @__PURE__ */ __name((configPath) => {
3521
- if (configPath.endsWith(".toml")) {
3522
- return parseTOML(readFileSync(configPath), configPath);
3523
- }
3524
- if (configPath.endsWith(".json") || configPath.endsWith(".jsonc")) {
3525
- return parseJSONC(readFileSync(configPath), configPath);
3526
- }
3527
- return {};
3528
- }, "parseRawConfigFile");
3529
- var experimental_readRawConfig = /* @__PURE__ */ __name((args, options = {}) => {
3530
- const { configPath, userConfigPath, deployConfigPath, redirected } = resolveWranglerConfigPath(args, options);
3531
- const rawConfig = parseRawConfigFile(configPath ?? "");
3532
- return {
3533
- rawConfig,
3534
- configPath,
3535
- userConfigPath,
3536
- deployConfigPath,
3537
- redirected
3538
- };
3539
- }, "experimental_readRawConfig");
3540
630
  var experimental_patchConfig = /* @__PURE__ */ __name((configPath, patch, isArrayInsertion = true) => {
3541
631
  let configString = readFileSync(configPath);
3542
632
  if (configPath.endsWith("toml")) {
@@ -3557,7 +647,7 @@ var experimental_patchConfig = /* @__PURE__ */ __name((configPath, patch, isArra
3557
647
  });
3558
648
  configString = applyEdits(configString, edit);
3559
649
  }
3560
- const formatEdit = format2(configString, void 0, {});
650
+ const formatEdit = format(configString, void 0, {});
3561
651
  configString = applyEdits(configString, formatEdit);
3562
652
  if (configPath.endsWith(".toml")) {
3563
653
  configString = dist_default.stringify(parseJSONC(configString));
@@ -3776,8 +866,8 @@ function isDir(inputPath) {
3776
866
  }
3777
867
  __name(isDir, "isDir");
3778
868
  var isDockerfile = /* @__PURE__ */ __name((image, configPath) => {
3779
- const baseDir = configPath ? path7.dirname(configPath) : process.cwd();
3780
- const maybeDockerfile = path7.resolve(baseDir, image);
869
+ const baseDir = configPath ? path4.dirname(configPath) : process.cwd();
870
+ const maybeDockerfile = path4.resolve(baseDir, image);
3781
871
  if (existsSync(maybeDockerfile)) {
3782
872
  if (isDir(maybeDockerfile)) {
3783
873
  throw new UserError2(
@@ -3848,7 +938,7 @@ function isDirectory(configPath) {
3848
938
  __name(isDirectory, "isDirectory");
3849
939
  function getGlobalWranglerConfigPath() {
3850
940
  const configDir = mod_esm_default(".wrangler").config();
3851
- const legacyConfigDir = path7.join(os.homedir(), ".wrangler");
941
+ const legacyConfigDir = path4.join(os.homedir(), ".wrangler");
3852
942
  if (isDirectory(legacyConfigDir)) {
3853
943
  return legacyConfigDir;
3854
944
  } else {
@@ -4004,7 +1094,7 @@ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({
4004
1094
  var getRegistryPath = getEnvironmentVariableFactory({
4005
1095
  variableName: "WRANGLER_REGISTRY_PATH",
4006
1096
  defaultValue() {
4007
- return path7.join(getGlobalWranglerConfigPath(), "registry");
1097
+ return path4.join(getGlobalWranglerConfigPath(), "registry");
4008
1098
  }
4009
1099
  });
4010
1100
  var getD1ExtraLocationChoices = getEnvironmentVariableFactory({
@@ -4042,6 +1132,9 @@ var getWranglerHideBanner = getBooleanEnvironmentVariableFactory({
4042
1132
  var getCloudflareEnv = getEnvironmentVariableFactory({
4043
1133
  variableName: "CLOUDFLARE_ENV"
4044
1134
  });
1135
+ var getOpenNextDeployFromEnv = getEnvironmentVariableFactory({
1136
+ variableName: "OPEN_NEXT_DEPLOY"
1137
+ });
4045
1138
 
4046
1139
  // src/config/diagnostics.ts
4047
1140
  var Diagnostics = class {
@@ -4188,9 +1281,9 @@ Please add "${field}" to "env.${envName}".`
4188
1281
  return rawEnv[field] ?? defaultValue;
4189
1282
  }
4190
1283
  __name(notInheritable, "notInheritable");
4191
- function unwindPropertyPath(root, path8) {
1284
+ function unwindPropertyPath(root, path5) {
4192
1285
  let container = root;
4193
- const parts = path8.split(".");
1286
+ const parts = path5.split(".");
4194
1287
  for (let i = 0; i < parts.length - 1; i++) {
4195
1288
  if (!hasProperty(container, parts[i])) {
4196
1289
  return;
@@ -4505,7 +1598,7 @@ function isPagesConfig(rawConfig) {
4505
1598
  __name(isPagesConfig, "isPagesConfig");
4506
1599
  function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
4507
1600
  const diagnostics = new Diagnostics(
4508
- `Processing ${configPath ? path7.relative(process.cwd(), configPath) : "wrangler"} configuration:`
1601
+ `Processing ${configPath ? path4.relative(process.cwd(), configPath) : "wrangler"} configuration:`
4509
1602
  );
4510
1603
  validateOptionalProperty(
4511
1604
  diagnostics,
@@ -4729,13 +1822,13 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
4729
1822
  // be configured in the Wrangler configuration file, but who knows, that may
4730
1823
  // change in the future, so we do a check anyway
4731
1824
  command && configPath ? Array.isArray(watch_dir) ? watch_dir.map(
4732
- (dir) => path7.relative(
1825
+ (dir) => path4.relative(
4733
1826
  process.cwd(),
4734
- path7.join(path7.dirname(configPath), `${dir}`)
1827
+ path4.join(path4.dirname(configPath), `${dir}`)
4735
1828
  )
4736
- ) : path7.relative(
1829
+ ) : path4.relative(
4737
1830
  process.cwd(),
4738
- path7.join(path7.dirname(configPath), `${watch_dir}`)
1831
+ path4.join(path4.dirname(configPath), `${watch_dir}`)
4739
1832
  ) : watch_dir
4740
1833
  ),
4741
1834
  cwd
@@ -4743,11 +1836,11 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
4743
1836
  }
4744
1837
  __name(normalizeAndValidateBuild, "normalizeAndValidateBuild");
4745
1838
  function normalizeAndValidateMainField(configPath, rawMain) {
4746
- const configDir = path7.dirname(configPath ?? "wrangler.toml");
1839
+ const configDir = path4.dirname(configPath ?? "wrangler.toml");
4747
1840
  if (rawMain !== void 0) {
4748
1841
  if (typeof rawMain === "string") {
4749
- const directory = path7.resolve(configDir);
4750
- return path7.resolve(directory, rawMain);
1842
+ const directory = path4.resolve(configDir);
1843
+ return path4.resolve(directory, rawMain);
4751
1844
  } else {
4752
1845
  return rawMain;
4753
1846
  }
@@ -4757,11 +1850,11 @@ function normalizeAndValidateMainField(configPath, rawMain) {
4757
1850
  }
4758
1851
  __name(normalizeAndValidateMainField, "normalizeAndValidateMainField");
4759
1852
  function normalizeAndValidateBaseDirField(configPath, rawDir) {
4760
- const configDir = path7.dirname(configPath ?? "wrangler.toml");
1853
+ const configDir = path4.dirname(configPath ?? "wrangler.toml");
4761
1854
  if (rawDir !== void 0) {
4762
1855
  if (typeof rawDir === "string") {
4763
- const directory = path7.resolve(configDir);
4764
- return path7.resolve(directory, rawDir);
1856
+ const directory = path4.resolve(configDir);
1857
+ return path4.resolve(directory, rawDir);
4765
1858
  } else {
4766
1859
  return rawDir;
4767
1860
  }
@@ -4771,11 +1864,11 @@ function normalizeAndValidateBaseDirField(configPath, rawDir) {
4771
1864
  }
4772
1865
  __name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
4773
1866
  function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
4774
- const configDir = path7.dirname(configPath ?? "wrangler.toml");
1867
+ const configDir = path4.dirname(configPath ?? "wrangler.toml");
4775
1868
  if (rawPagesDir !== void 0) {
4776
1869
  if (typeof rawPagesDir === "string") {
4777
- const directory = path7.resolve(configDir);
4778
- return path7.resolve(directory, rawPagesDir);
1870
+ const directory = path4.resolve(configDir);
1871
+ return path4.resolve(directory, rawPagesDir);
4779
1872
  } else {
4780
1873
  return rawPagesDir;
4781
1874
  }
@@ -4907,9 +2000,9 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
4907
2000
  `site.entry-point`,
4908
2001
  `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
4909
2002
  \`\`\`
4910
- main = "${path7.join(
2003
+ main = "${path4.join(
4911
2004
  String(rawConfig.site["entry-point"]) || "workers-site",
4912
- path7.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js"
2005
+ path4.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js"
4913
2006
  )}"
4914
2007
  \`\`\``,
4915
2008
  false,
@@ -4934,9 +2027,9 @@ Delete the deprecated \`site.entry-point\` field from your config.`
4934
2027
  );
4935
2028
  }
4936
2029
  if (configPath && siteEntryPoint) {
4937
- siteEntryPoint = path7.relative(
2030
+ siteEntryPoint = path4.relative(
4938
2031
  process.cwd(),
4939
- path7.join(path7.dirname(configPath), siteEntryPoint)
2032
+ path4.join(path4.dirname(configPath), siteEntryPoint)
4940
2033
  );
4941
2034
  }
4942
2035
  return {
@@ -4982,9 +2075,9 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
4982
2075
  for (const [name, filePath] of Object.entries(rawMapping)) {
4983
2076
  if (isString(diagnostics, `${field}['${name}']`, filePath, void 0)) {
4984
2077
  if (configPath) {
4985
- mapping[name] = configPath ? path7.relative(
2078
+ mapping[name] = configPath ? path4.relative(
4986
2079
  process.cwd(),
4987
- path7.join(path7.dirname(configPath), filePath)
2080
+ path4.join(path4.dirname(configPath), filePath)
4988
2081
  ) : filePath;
4989
2082
  }
4990
2083
  }
@@ -5870,9 +2963,9 @@ function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPa
5870
2963
  isString,
5871
2964
  void 0
5872
2965
  );
5873
- return configPath && tsconfig ? path7.relative(
2966
+ return configPath && tsconfig ? path4.relative(
5874
2967
  process.cwd(),
5875
- path7.join(path7.dirname(configPath), tsconfig)
2968
+ path4.join(path4.dirname(configPath), tsconfig)
5876
2969
  ) : tsconfig;
5877
2970
  }
5878
2971
  __name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
@@ -6631,9 +3724,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
6631
3724
  let resolvedBuildContextPath = void 0;
6632
3725
  try {
6633
3726
  if (isDockerfile(resolvedImage, configPath)) {
6634
- const baseDir = configPath ? path7.dirname(configPath) : process.cwd();
6635
- resolvedImage = path7.resolve(baseDir, resolvedImage);
6636
- resolvedBuildContextPath = containerAppOptional.image_build_context ? path7.resolve(baseDir, containerAppOptional.image_build_context) : path7.dirname(resolvedImage);
3727
+ const baseDir = configPath ? path4.dirname(configPath) : process.cwd();
3728
+ resolvedImage = path4.resolve(baseDir, resolvedImage);
3729
+ resolvedBuildContextPath = containerAppOptional.image_build_context ? path4.resolve(baseDir, containerAppOptional.image_build_context) : path4.dirname(resolvedImage);
6637
3730
  }
6638
3731
  } catch (err) {
6639
3732
  if (err instanceof Error && err.message) {
@@ -6780,6 +3873,8 @@ function validateContainerApp(envName, topLevelName, configPath) {
6780
3873
  "class_name",
6781
3874
  "scheduling_policy",
6782
3875
  "instance_type",
3876
+ "wrangler_ssh",
3877
+ "authorized_keys",
6783
3878
  "configuration",
6784
3879
  "constraints",
6785
3880
  "affinities",
@@ -6798,6 +3893,54 @@ function validateContainerApp(envName, topLevelName, configPath) {
6798
3893
  ["image", "secrets", "labels", "disk", "vcpu", "memory_mib"]
6799
3894
  );
6800
3895
  }
3896
+ if ("wrangler_ssh" in containerAppOptional) {
3897
+ if (!isRequiredProperty(
3898
+ containerAppOptional.wrangler_ssh,
3899
+ "enabled",
3900
+ "boolean"
3901
+ )) {
3902
+ diagnostics.errors.push(
3903
+ `${field}.wrangler_ssh.enabled must be a boolean`
3904
+ );
3905
+ }
3906
+ if (!isOptionalProperty(
3907
+ containerAppOptional.wrangler_ssh,
3908
+ "port",
3909
+ "number"
3910
+ ) || containerAppOptional.wrangler_ssh.port < 1 || containerAppOptional.wrangler_ssh.port > 65535) {
3911
+ diagnostics.errors.push(
3912
+ `${field}.wrangler_ssh.port must be a number between 1 and 65535 inclusive`
3913
+ );
3914
+ }
3915
+ if (!("authorized_keys" in containerAppOptional) && containerAppOptional.wrangler_ssh.enabled) {
3916
+ diagnostics.errors.push(
3917
+ `${field}.authorized_keys must be provided if wrangler ssh is enabled`
3918
+ );
3919
+ }
3920
+ }
3921
+ if ("authorized_keys" in containerAppOptional) {
3922
+ if (!Array.isArray(containerAppOptional.authorized_keys)) {
3923
+ diagnostics.errors.push(`${field}.authorized_keys must be an array`);
3924
+ } else {
3925
+ for (const index in containerAppOptional.authorized_keys) {
3926
+ const fieldPath = `${field}.authorized_keys[${index}]`;
3927
+ const key = containerAppOptional.authorized_keys[index];
3928
+ if (!isRequiredProperty(key, "name", "string")) {
3929
+ diagnostics.errors.push(`${fieldPath}.name must be a string`);
3930
+ }
3931
+ if (!isRequiredProperty(key, "public_key", "string")) {
3932
+ diagnostics.errors.push(
3933
+ `${fieldPath}.public_key must be a string`
3934
+ );
3935
+ }
3936
+ if (!key.public_key.toLowerCase().startsWith("ssh-ed25519")) {
3937
+ diagnostics.errors.push(
3938
+ `${fieldPath}.public_key is a unsupported key type. Please provide a ED25519 public key.`
3939
+ );
3940
+ }
3941
+ }
3942
+ }
3943
+ }
6801
3944
  if (typeof containerAppOptional.instance_type === "string") {
6802
3945
  validateOptionalProperty(
6803
3946
  diagnostics,
@@ -8240,268 +5383,5 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
8240
5383
  }
8241
5384
  }
8242
5385
  __name(validateDurableObjectBinding2, "validateDurableObjectBinding");
8243
- /*! Bundled license information:
8244
-
8245
- smol-toml/dist/error.js:
8246
- (*!
8247
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8248
- * SPDX-License-Identifier: BSD-3-Clause
8249
- *
8250
- * Redistribution and use in source and binary forms, with or without
8251
- * modification, are permitted provided that the following conditions are met:
8252
- *
8253
- * 1. Redistributions of source code must retain the above copyright notice, this
8254
- * list of conditions and the following disclaimer.
8255
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8256
- * this list of conditions and the following disclaimer in the
8257
- * documentation and/or other materials provided with the distribution.
8258
- * 3. Neither the name of the copyright holder nor the names of its contributors
8259
- * may be used to endorse or promote products derived from this software without
8260
- * specific prior written permission.
8261
- *
8262
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8263
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8264
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8265
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8266
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8267
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8268
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8269
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8270
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8271
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8272
- *)
8273
-
8274
- smol-toml/dist/util.js:
8275
- (*!
8276
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8277
- * SPDX-License-Identifier: BSD-3-Clause
8278
- *
8279
- * Redistribution and use in source and binary forms, with or without
8280
- * modification, are permitted provided that the following conditions are met:
8281
- *
8282
- * 1. Redistributions of source code must retain the above copyright notice, this
8283
- * list of conditions and the following disclaimer.
8284
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8285
- * this list of conditions and the following disclaimer in the
8286
- * documentation and/or other materials provided with the distribution.
8287
- * 3. Neither the name of the copyright holder nor the names of its contributors
8288
- * may be used to endorse or promote products derived from this software without
8289
- * specific prior written permission.
8290
- *
8291
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8292
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8293
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8294
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8295
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8296
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8297
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8298
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8299
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8300
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8301
- *)
8302
-
8303
- smol-toml/dist/date.js:
8304
- (*!
8305
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8306
- * SPDX-License-Identifier: BSD-3-Clause
8307
- *
8308
- * Redistribution and use in source and binary forms, with or without
8309
- * modification, are permitted provided that the following conditions are met:
8310
- *
8311
- * 1. Redistributions of source code must retain the above copyright notice, this
8312
- * list of conditions and the following disclaimer.
8313
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8314
- * this list of conditions and the following disclaimer in the
8315
- * documentation and/or other materials provided with the distribution.
8316
- * 3. Neither the name of the copyright holder nor the names of its contributors
8317
- * may be used to endorse or promote products derived from this software without
8318
- * specific prior written permission.
8319
- *
8320
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8321
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8322
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8323
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8324
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8325
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8326
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8327
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8328
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8329
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8330
- *)
8331
-
8332
- smol-toml/dist/primitive.js:
8333
- (*!
8334
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8335
- * SPDX-License-Identifier: BSD-3-Clause
8336
- *
8337
- * Redistribution and use in source and binary forms, with or without
8338
- * modification, are permitted provided that the following conditions are met:
8339
- *
8340
- * 1. Redistributions of source code must retain the above copyright notice, this
8341
- * list of conditions and the following disclaimer.
8342
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8343
- * this list of conditions and the following disclaimer in the
8344
- * documentation and/or other materials provided with the distribution.
8345
- * 3. Neither the name of the copyright holder nor the names of its contributors
8346
- * may be used to endorse or promote products derived from this software without
8347
- * specific prior written permission.
8348
- *
8349
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8350
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8351
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8352
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8353
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8354
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8355
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8356
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8357
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8358
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8359
- *)
8360
-
8361
- smol-toml/dist/extract.js:
8362
- (*!
8363
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8364
- * SPDX-License-Identifier: BSD-3-Clause
8365
- *
8366
- * Redistribution and use in source and binary forms, with or without
8367
- * modification, are permitted provided that the following conditions are met:
8368
- *
8369
- * 1. Redistributions of source code must retain the above copyright notice, this
8370
- * list of conditions and the following disclaimer.
8371
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8372
- * this list of conditions and the following disclaimer in the
8373
- * documentation and/or other materials provided with the distribution.
8374
- * 3. Neither the name of the copyright holder nor the names of its contributors
8375
- * may be used to endorse or promote products derived from this software without
8376
- * specific prior written permission.
8377
- *
8378
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8379
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8380
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8381
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8382
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8383
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8384
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8385
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8386
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8387
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8388
- *)
8389
-
8390
- smol-toml/dist/struct.js:
8391
- (*!
8392
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8393
- * SPDX-License-Identifier: BSD-3-Clause
8394
- *
8395
- * Redistribution and use in source and binary forms, with or without
8396
- * modification, are permitted provided that the following conditions are met:
8397
- *
8398
- * 1. Redistributions of source code must retain the above copyright notice, this
8399
- * list of conditions and the following disclaimer.
8400
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8401
- * this list of conditions and the following disclaimer in the
8402
- * documentation and/or other materials provided with the distribution.
8403
- * 3. Neither the name of the copyright holder nor the names of its contributors
8404
- * may be used to endorse or promote products derived from this software without
8405
- * specific prior written permission.
8406
- *
8407
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8408
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8409
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8410
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8411
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8412
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8413
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8414
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8415
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8416
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8417
- *)
8418
-
8419
- smol-toml/dist/parse.js:
8420
- (*!
8421
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8422
- * SPDX-License-Identifier: BSD-3-Clause
8423
- *
8424
- * Redistribution and use in source and binary forms, with or without
8425
- * modification, are permitted provided that the following conditions are met:
8426
- *
8427
- * 1. Redistributions of source code must retain the above copyright notice, this
8428
- * list of conditions and the following disclaimer.
8429
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8430
- * this list of conditions and the following disclaimer in the
8431
- * documentation and/or other materials provided with the distribution.
8432
- * 3. Neither the name of the copyright holder nor the names of its contributors
8433
- * may be used to endorse or promote products derived from this software without
8434
- * specific prior written permission.
8435
- *
8436
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8437
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8438
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8439
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8440
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8441
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8442
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8443
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8444
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8445
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8446
- *)
8447
-
8448
- smol-toml/dist/stringify.js:
8449
- (*!
8450
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8451
- * SPDX-License-Identifier: BSD-3-Clause
8452
- *
8453
- * Redistribution and use in source and binary forms, with or without
8454
- * modification, are permitted provided that the following conditions are met:
8455
- *
8456
- * 1. Redistributions of source code must retain the above copyright notice, this
8457
- * list of conditions and the following disclaimer.
8458
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8459
- * this list of conditions and the following disclaimer in the
8460
- * documentation and/or other materials provided with the distribution.
8461
- * 3. Neither the name of the copyright holder nor the names of its contributors
8462
- * may be used to endorse or promote products derived from this software without
8463
- * specific prior written permission.
8464
- *
8465
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8466
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8467
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8468
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8469
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8470
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8471
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8472
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8473
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8474
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8475
- *)
8476
-
8477
- smol-toml/dist/index.js:
8478
- (*!
8479
- * Copyright (c) Squirrel Chat et al., All rights reserved.
8480
- * SPDX-License-Identifier: BSD-3-Clause
8481
- *
8482
- * Redistribution and use in source and binary forms, with or without
8483
- * modification, are permitted provided that the following conditions are met:
8484
- *
8485
- * 1. Redistributions of source code must retain the above copyright notice, this
8486
- * list of conditions and the following disclaimer.
8487
- * 2. Redistributions in binary form must reproduce the above copyright notice,
8488
- * this list of conditions and the following disclaimer in the
8489
- * documentation and/or other materials provided with the distribution.
8490
- * 3. Neither the name of the copyright holder nor the names of its contributors
8491
- * may be used to endorse or promote products derived from this software without
8492
- * specific prior written permission.
8493
- *
8494
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
8495
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8496
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8497
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8498
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8499
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8500
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8501
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8502
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8503
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8504
- *)
8505
- */
8506
5386
 
8507
- export { APIError, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, ParseError, PatchConfigError, UserError, bucketFormatMessage, configFileName, configFormat, createFatalError, defaultWranglerConfig, experimental_patchConfig, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, friendlyBindingNames, getBooleanEnvironmentVariableFactory, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getEnvironmentVariableFactory, getGlobalWranglerConfigPath, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, hasProperty, indexLocation, isOptionalProperty, isPagesConfig, isRequiredProperty, isValidR2BucketName, normalizeAndValidateConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation, validatePagesConfig };
5387
+ export { COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, PatchConfigError, bucketFormatMessage, defaultWranglerConfig, experimental_patchConfig, friendlyBindingNames, getBooleanEnvironmentVariableFactory, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getEnvironmentVariableFactory, getGlobalWranglerConfigPath, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, hasProperty, isOptionalProperty, isPagesConfig, isRequiredProperty, isValidR2BucketName, normalizeAndValidateConfig, validatePagesConfig };