nitro-nightly 3.0.1-20260120-020848-6786d069 → 3.0.1-20260120-133849-ca1a9dee

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/_build/common.mjs +24931 -0
  2. package/dist/_build/rolldown.mjs +6 -11
  3. package/dist/_build/rollup.mjs +201 -0
  4. package/dist/_build/vite.build.mjs +1 -1
  5. package/dist/_chunks/dev.mjs +4 -6
  6. package/dist/_chunks/nitro.mjs +1183 -24
  7. package/dist/_chunks/nitro2.mjs +91 -248
  8. package/dist/_chunks/utils.mjs +254 -0
  9. package/dist/_common.mjs +45 -0
  10. package/dist/_libs/c12+giget+readdirp+chokidar.d.mts +214 -0
  11. package/dist/_libs/citty.mjs +140 -110
  12. package/dist/_libs/commondir+is-reference.mjs +1300 -0
  13. package/dist/_libs/compatx.d.mts +47 -0
  14. package/dist/_libs/confbox.mjs +2488 -70
  15. package/dist/_libs/esbuild.d.mts +20 -0
  16. package/dist/_libs/escape-string-regexp.mjs +8 -0
  17. package/dist/_libs/estree-walker.mjs +187 -0
  18. package/dist/_libs/hasown+resolve+deepmerge.mjs +1972 -0
  19. package/dist/_libs/httpxy.d.mts +79 -0
  20. package/dist/_libs/httpxy.mjs +6 -1
  21. package/dist/_libs/klona.mjs +38 -0
  22. package/dist/_libs/magic-string.d.mts +220 -0
  23. package/dist/_libs/mlly.d.mts +57 -0
  24. package/dist/_libs/nypm+giget+tinyexec.mjs +3603 -0
  25. package/dist/_libs/pkg-types.d.mts +23 -0
  26. package/dist/_libs/plugin-alias.mjs +64 -0
  27. package/dist/_libs/{plugin-alias+plugin-inject.mjs → plugin-inject.mjs} +2 -65
  28. package/dist/_libs/plugin-json.mjs +36 -0
  29. package/dist/_libs/pluginutils+plugin-commonjs.d.mts +241 -0
  30. package/dist/_libs/pluginutils.mjs +652 -0
  31. package/dist/_libs/{c12+dotenv+rc9.mjs → rc9+c12+dotenv.mjs} +105 -12
  32. package/dist/_libs/{chokidar+readdirp.mjs → readdirp+chokidar.mjs} +8 -1
  33. package/dist/_libs/remapping.mjs +117 -0
  34. package/dist/_libs/resolve-uri+gen-mapping.mjs +448 -0
  35. package/dist/_libs/rou3.d.mts +43 -0
  36. package/dist/_libs/rou3.mjs +322 -0
  37. package/dist/_libs/std-env.d.mts +4 -0
  38. package/dist/_libs/tsconfck.mjs +832 -0
  39. package/dist/_libs/ultrahtml.mjs +138 -0
  40. package/dist/_libs/{gen-mapping+remapping+resolve-uri+trace-mapping+unimport+unplugin+unplugin-utils+webpack-virtual-modules.mjs → unimport+unplugin.mjs} +228 -593
  41. package/dist/_libs/unplugin+unimport.d.mts +426 -0
  42. package/dist/_libs/unwasm.d.mts +29 -0
  43. package/dist/_presets.mjs +3 -8
  44. package/dist/builder.mjs +6 -8
  45. package/dist/cli/_chunks/build.mjs +1 -1
  46. package/dist/cli/_chunks/dev.mjs +2 -3
  47. package/dist/cli/_chunks/list.mjs +1 -1
  48. package/dist/cli/_chunks/prepare.mjs +1 -1
  49. package/dist/cli/_chunks/run.mjs +1 -1
  50. package/dist/cli/_chunks/task.mjs +16 -0
  51. package/dist/cli/index.mjs +1 -1
  52. package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -5
  53. package/dist/presets/netlify/runtime/netlify-edge.d.mts +0 -1
  54. package/dist/presets/winterjs/runtime/winterjs.d.mts +0 -1
  55. package/dist/runtime/internal/error/dev.d.mts +0 -1
  56. package/dist/runtime/internal/route-rules.d.mts +0 -4
  57. package/dist/runtime/internal/routes/openapi.d.mts +0 -1
  58. package/dist/runtime/internal/routes/scalar.d.mts +0 -1
  59. package/dist/runtime/internal/routes/swagger.d.mts +0 -1
  60. package/dist/runtime/internal/runtime-config.d.mts +0 -1
  61. package/dist/runtime/nitro.d.mts +0 -3
  62. package/dist/runtime/virtual/renderer-template.d.mts +0 -1
  63. package/dist/types/index.d.mts +25 -1394
  64. package/dist/vite.mjs +18 -641
  65. package/package.json +5 -5
  66. package/dist/_chunks/nitro3.mjs +0 -2696
  67. package/dist/_chunks/nitro4.mjs +0 -176
  68. package/dist/_chunks/nitro5.mjs +0 -733
  69. package/dist/_chunks/nitro6.mjs +0 -1458
  70. package/dist/_chunks/nitro7.mjs +0 -7561
  71. package/dist/_chunks/nitro8.mjs +0 -3524
  72. package/dist/_chunks/nitro9.mjs +0 -1729
  73. package/dist/_libs/_.mjs +0 -3
  74. package/dist/_libs/_2.mjs +0 -3
  75. package/dist/_libs/_3.mjs +0 -4
  76. package/dist/_libs/_4.mjs +0 -6
  77. package/dist/_libs/_5.mjs +0 -3
  78. package/dist/_libs/_6.mjs +0 -3
  79. package/dist/_libs/acorn+confbox+js-tokens+magic-string+mlly+pkg-types+sourcemap-codec+strip-literal+unimport.mjs +0 -8900
  80. package/dist/_libs/confbox+exsolve+pkg-types.mjs +0 -1249
  81. package/dist/_libs/confbox2.mjs +0 -786
  82. package/dist/_libs/confbox3.mjs +0 -404
  83. package/dist/_libs/confbox4.mjs +0 -3
  84. package/dist/_libs/estree-walker+unimport.mjs +0 -378
  85. package/dist/_libs/fdir+picomatch+tinyglobby.mjs +0 -2471
  86. package/dist/_libs/giget+node-fetch-native.mjs +0 -2692
  87. package/dist/_libs/local-pkg+quansync+unimport.mjs +0 -1526
  88. package/dist/_libs/nypm+tinyexec.mjs +0 -858
  89. package/dist/_libs/pathe.mjs +0 -164
  90. package/dist/_libs/perfect-debounce.mjs +0 -89
  91. package/dist/_libs/std-env.mjs +0 -158
  92. package/dist/_libs/unimport.mjs +0 -9
  93. package/dist/_libs/vite-plugin-fullstack.mjs +0 -26
@@ -0,0 +1,448 @@
1
+ import { C as decode, w as encode } from "../_build/common.mjs";
2
+
3
+ //#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
4
+ const schemeRegex = /^[\w+.-]+:\/\//;
5
+ /**
6
+ * Matches the parts of a URL:
7
+ * 1. Scheme, including ":", guaranteed.
8
+ * 2. User/password, including "@", optional.
9
+ * 3. Host, guaranteed.
10
+ * 4. Port, including ":", optional.
11
+ * 5. Path, including "/", optional.
12
+ * 6. Query, including "?", optional.
13
+ * 7. Hash, including "#", optional.
14
+ */
15
+ const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
16
+ /**
17
+ * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
18
+ * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
19
+ *
20
+ * 1. Host, optional.
21
+ * 2. Path, which may include "/", guaranteed.
22
+ * 3. Query, including "?", optional.
23
+ * 4. Hash, including "#", optional.
24
+ */
25
+ const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
26
+ function isAbsoluteUrl(input) {
27
+ return schemeRegex.test(input);
28
+ }
29
+ function isSchemeRelativeUrl(input) {
30
+ return input.startsWith("//");
31
+ }
32
+ function isAbsolutePath(input) {
33
+ return input.startsWith("/");
34
+ }
35
+ function isFileUrl(input) {
36
+ return input.startsWith("file:");
37
+ }
38
+ function isRelative(input) {
39
+ return /^[.?#]/.test(input);
40
+ }
41
+ function parseAbsoluteUrl(input) {
42
+ const match = urlRegex.exec(input);
43
+ return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
44
+ }
45
+ function parseFileUrl(input) {
46
+ const match = fileRegex.exec(input);
47
+ const path = match[2];
48
+ return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
49
+ }
50
+ function makeUrl(scheme, user, host, port, path, query, hash) {
51
+ return {
52
+ scheme,
53
+ user,
54
+ host,
55
+ port,
56
+ path,
57
+ query,
58
+ hash,
59
+ type: 7
60
+ };
61
+ }
62
+ function parseUrl(input) {
63
+ if (isSchemeRelativeUrl(input)) {
64
+ const url$1 = parseAbsoluteUrl("http:" + input);
65
+ url$1.scheme = "";
66
+ url$1.type = 6;
67
+ return url$1;
68
+ }
69
+ if (isAbsolutePath(input)) {
70
+ const url$1 = parseAbsoluteUrl("http://foo.com" + input);
71
+ url$1.scheme = "";
72
+ url$1.host = "";
73
+ url$1.type = 5;
74
+ return url$1;
75
+ }
76
+ if (isFileUrl(input)) return parseFileUrl(input);
77
+ if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
78
+ const url = parseAbsoluteUrl("http://foo.com/" + input);
79
+ url.scheme = "";
80
+ url.host = "";
81
+ url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
82
+ return url;
83
+ }
84
+ function stripPathFilename(path) {
85
+ if (path.endsWith("/..")) return path;
86
+ const index = path.lastIndexOf("/");
87
+ return path.slice(0, index + 1);
88
+ }
89
+ function mergePaths(url, base) {
90
+ normalizePath(base, base.type);
91
+ if (url.path === "/") url.path = base.path;
92
+ else url.path = stripPathFilename(base.path) + url.path;
93
+ }
94
+ /**
95
+ * The path can have empty directories "//", unneeded parents "foo/..", or current directory
96
+ * "foo/.". We need to normalize to a standard representation.
97
+ */
98
+ function normalizePath(url, type) {
99
+ const rel = type <= 4;
100
+ const pieces = url.path.split("/");
101
+ let pointer = 1;
102
+ let positive = 0;
103
+ let addTrailingSlash = false;
104
+ for (let i = 1; i < pieces.length; i++) {
105
+ const piece = pieces[i];
106
+ if (!piece) {
107
+ addTrailingSlash = true;
108
+ continue;
109
+ }
110
+ addTrailingSlash = false;
111
+ if (piece === ".") continue;
112
+ if (piece === "..") {
113
+ if (positive) {
114
+ addTrailingSlash = true;
115
+ positive--;
116
+ pointer--;
117
+ } else if (rel) pieces[pointer++] = piece;
118
+ continue;
119
+ }
120
+ pieces[pointer++] = piece;
121
+ positive++;
122
+ }
123
+ let path = "";
124
+ for (let i = 1; i < pointer; i++) path += "/" + pieces[i];
125
+ if (!path || addTrailingSlash && !path.endsWith("/..")) path += "/";
126
+ url.path = path;
127
+ }
128
+ /**
129
+ * Attempts to resolve `input` URL/path relative to `base`.
130
+ */
131
+ function resolve(input, base) {
132
+ if (!input && !base) return "";
133
+ const url = parseUrl(input);
134
+ let inputType = url.type;
135
+ if (base && inputType !== 7) {
136
+ const baseUrl = parseUrl(base);
137
+ const baseType = baseUrl.type;
138
+ switch (inputType) {
139
+ case 1: url.hash = baseUrl.hash;
140
+ case 2: url.query = baseUrl.query;
141
+ case 3:
142
+ case 4: mergePaths(url, baseUrl);
143
+ case 5:
144
+ url.user = baseUrl.user;
145
+ url.host = baseUrl.host;
146
+ url.port = baseUrl.port;
147
+ case 6: url.scheme = baseUrl.scheme;
148
+ }
149
+ if (baseType > inputType) inputType = baseType;
150
+ }
151
+ normalizePath(url, inputType);
152
+ const queryHash = url.query + url.hash;
153
+ switch (inputType) {
154
+ case 2:
155
+ case 3: return queryHash;
156
+ case 4: {
157
+ const path = url.path.slice(1);
158
+ if (!path) return queryHash || ".";
159
+ if (isRelative(base || input) && !isRelative(path)) return "./" + path + queryHash;
160
+ return path + queryHash;
161
+ }
162
+ case 5: return url.path + queryHash;
163
+ default: return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
164
+ }
165
+ }
166
+
167
+ //#endregion
168
+ //#region node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
169
+ function stripFilename(path) {
170
+ if (!path) return "";
171
+ const index = path.lastIndexOf("/");
172
+ return path.slice(0, index + 1);
173
+ }
174
+ function resolver(mapUrl, sourceRoot) {
175
+ const from = stripFilename(mapUrl);
176
+ const prefix = sourceRoot ? sourceRoot + "/" : "";
177
+ return (source) => resolve(prefix + (source || ""), from);
178
+ }
179
+ var COLUMN$1 = 0;
180
+ function maybeSort(mappings, owned) {
181
+ const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
182
+ if (unsortedIndex === mappings.length) return mappings;
183
+ if (!owned) mappings = mappings.slice();
184
+ for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) mappings[i] = sortSegments(mappings[i], owned);
185
+ return mappings;
186
+ }
187
+ function nextUnsortedSegmentLine(mappings, start) {
188
+ for (let i = start; i < mappings.length; i++) if (!isSorted(mappings[i])) return i;
189
+ return mappings.length;
190
+ }
191
+ function isSorted(line) {
192
+ for (let j = 1; j < line.length; j++) if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) return false;
193
+ return true;
194
+ }
195
+ function sortSegments(line, owned) {
196
+ if (!owned) line = line.slice();
197
+ return line.sort(sortComparator);
198
+ }
199
+ function sortComparator(a, b) {
200
+ return a[COLUMN$1] - b[COLUMN$1];
201
+ }
202
+ var found = false;
203
+ function binarySearch(haystack, needle, low, high) {
204
+ while (low <= high) {
205
+ const mid = low + (high - low >> 1);
206
+ const cmp = haystack[mid][COLUMN$1] - needle;
207
+ if (cmp === 0) {
208
+ found = true;
209
+ return mid;
210
+ }
211
+ if (cmp < 0) low = mid + 1;
212
+ else high = mid - 1;
213
+ }
214
+ found = false;
215
+ return low - 1;
216
+ }
217
+ function upperBound(haystack, needle, index) {
218
+ for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN$1] !== needle) break;
219
+ return index;
220
+ }
221
+ function lowerBound(haystack, needle, index) {
222
+ for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN$1] !== needle) break;
223
+ return index;
224
+ }
225
+ function memoizedState() {
226
+ return {
227
+ lastKey: -1,
228
+ lastNeedle: -1,
229
+ lastIndex: -1
230
+ };
231
+ }
232
+ function memoizedBinarySearch(haystack, needle, state, key) {
233
+ const { lastKey, lastNeedle, lastIndex } = state;
234
+ let low = 0;
235
+ let high = haystack.length - 1;
236
+ if (key === lastKey) {
237
+ if (needle === lastNeedle) {
238
+ found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
239
+ return lastIndex;
240
+ }
241
+ if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex;
242
+ else high = lastIndex;
243
+ }
244
+ state.lastKey = key;
245
+ state.lastNeedle = needle;
246
+ return state.lastIndex = binarySearch(haystack, needle, low, high);
247
+ }
248
+ function parse(map) {
249
+ return typeof map === "string" ? JSON.parse(map) : map;
250
+ }
251
+ var LEAST_UPPER_BOUND = -1;
252
+ var GREATEST_LOWER_BOUND = 1;
253
+ var TraceMap = class {
254
+ constructor(map, mapUrl) {
255
+ const isString = typeof map === "string";
256
+ if (!isString && map._decodedMemo) return map;
257
+ const parsed = parse(map);
258
+ const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
259
+ this.version = version;
260
+ this.file = file;
261
+ this.names = names || [];
262
+ this.sourceRoot = sourceRoot;
263
+ this.sources = sources;
264
+ this.sourcesContent = sourcesContent;
265
+ this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
266
+ const resolve$1 = resolver(mapUrl, sourceRoot);
267
+ this.resolvedSources = sources.map(resolve$1);
268
+ const { mappings } = parsed;
269
+ if (typeof mappings === "string") {
270
+ this._encoded = mappings;
271
+ this._decoded = void 0;
272
+ } else if (Array.isArray(mappings)) {
273
+ this._encoded = void 0;
274
+ this._decoded = maybeSort(mappings, isString);
275
+ } else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
276
+ else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
277
+ this._decodedMemo = memoizedState();
278
+ this._bySources = void 0;
279
+ this._bySourceMemos = void 0;
280
+ }
281
+ };
282
+ function cast$1(map) {
283
+ return map;
284
+ }
285
+ function decodedMappings(map) {
286
+ var _a;
287
+ return (_a = cast$1(map))._decoded || (_a._decoded = decode(cast$1(map)._encoded));
288
+ }
289
+ function traceSegment(map, line, column) {
290
+ const decoded = decodedMappings(map);
291
+ if (line >= decoded.length) return null;
292
+ const segments = decoded[line];
293
+ const index = traceSegmentInternal(segments, cast$1(map)._decodedMemo, line, column, GREATEST_LOWER_BOUND);
294
+ return index === -1 ? null : segments[index];
295
+ }
296
+ function traceSegmentInternal(segments, memo, line, column, bias) {
297
+ let index = memoizedBinarySearch(segments, column, memo, line);
298
+ if (found) index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
299
+ else if (bias === LEAST_UPPER_BOUND) index++;
300
+ if (index === -1 || index === segments.length) return -1;
301
+ return index;
302
+ }
303
+
304
+ //#endregion
305
+ //#region node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
306
+ var SetArray = class {
307
+ constructor() {
308
+ this._indexes = { __proto__: null };
309
+ this.array = [];
310
+ }
311
+ };
312
+ function cast(set) {
313
+ return set;
314
+ }
315
+ function get(setarr, key) {
316
+ return cast(setarr)._indexes[key];
317
+ }
318
+ function put(setarr, key) {
319
+ const index = get(setarr, key);
320
+ if (index !== void 0) return index;
321
+ const { array, _indexes: indexes } = cast(setarr);
322
+ return indexes[key] = array.push(key) - 1;
323
+ }
324
+ function remove(setarr, key) {
325
+ const index = get(setarr, key);
326
+ if (index === void 0) return;
327
+ const { array, _indexes: indexes } = cast(setarr);
328
+ for (let i = index + 1; i < array.length; i++) {
329
+ const k = array[i];
330
+ array[i - 1] = k;
331
+ indexes[k]--;
332
+ }
333
+ indexes[key] = void 0;
334
+ array.pop();
335
+ }
336
+ var COLUMN = 0;
337
+ var SOURCES_INDEX = 1;
338
+ var SOURCE_LINE = 2;
339
+ var SOURCE_COLUMN = 3;
340
+ var NAMES_INDEX = 4;
341
+ var NO_NAME = -1;
342
+ var GenMapping = class {
343
+ constructor({ file, sourceRoot } = {}) {
344
+ this._names = new SetArray();
345
+ this._sources = new SetArray();
346
+ this._sourcesContent = [];
347
+ this._mappings = [];
348
+ this.file = file;
349
+ this.sourceRoot = sourceRoot;
350
+ this._ignoreList = new SetArray();
351
+ }
352
+ };
353
+ function cast2(map) {
354
+ return map;
355
+ }
356
+ var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
357
+ return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
358
+ };
359
+ function setSourceContent(map, source, content) {
360
+ const { _sources: sources, _sourcesContent: sourcesContent } = cast2(map);
361
+ const index = put(sources, source);
362
+ sourcesContent[index] = content;
363
+ }
364
+ function setIgnore(map, source, ignore = true) {
365
+ const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast2(map);
366
+ const index = put(sources, source);
367
+ if (index === sourcesContent.length) sourcesContent[index] = null;
368
+ if (ignore) put(ignoreList, index);
369
+ else remove(ignoreList, index);
370
+ }
371
+ function toDecodedMap(map) {
372
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList } = cast2(map);
373
+ removeEmptyFinalLines(mappings);
374
+ return {
375
+ version: 3,
376
+ file: map.file || void 0,
377
+ names: names.array,
378
+ sourceRoot: map.sourceRoot || void 0,
379
+ sources: sources.array,
380
+ sourcesContent,
381
+ mappings,
382
+ ignoreList: ignoreList.array
383
+ };
384
+ }
385
+ function toEncodedMap(map) {
386
+ const decoded = toDecodedMap(map);
387
+ return Object.assign({}, decoded, { mappings: encode(decoded.mappings) });
388
+ }
389
+ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
390
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast2(map);
391
+ const line = getIndex(mappings, genLine);
392
+ const index = getColumnIndex(line, genColumn);
393
+ if (!source) {
394
+ if (skipable && skipSourceless(line, index)) return;
395
+ return insert(line, index, [genColumn]);
396
+ }
397
+ assert(sourceLine);
398
+ assert(sourceColumn);
399
+ const sourcesIndex = put(sources, source);
400
+ const namesIndex = name ? put(names, name) : NO_NAME;
401
+ if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
402
+ if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) return;
403
+ return insert(line, index, name ? [
404
+ genColumn,
405
+ sourcesIndex,
406
+ sourceLine,
407
+ sourceColumn,
408
+ namesIndex
409
+ ] : [
410
+ genColumn,
411
+ sourcesIndex,
412
+ sourceLine,
413
+ sourceColumn
414
+ ]);
415
+ }
416
+ function assert(_val) {}
417
+ function getIndex(arr, index) {
418
+ for (let i = arr.length; i <= index; i++) arr[i] = [];
419
+ return arr[index];
420
+ }
421
+ function getColumnIndex(line, genColumn) {
422
+ let index = line.length;
423
+ for (let i = index - 1; i >= 0; index = i--) if (genColumn >= line[i][COLUMN]) break;
424
+ return index;
425
+ }
426
+ function insert(array, index, value) {
427
+ for (let i = array.length; i > index; i--) array[i] = array[i - 1];
428
+ array[index] = value;
429
+ }
430
+ function removeEmptyFinalLines(mappings) {
431
+ const { length } = mappings;
432
+ let len = length;
433
+ for (let i = len - 1; i >= 0; len = i, i--) if (mappings[i].length > 0) break;
434
+ if (len < length) mappings.length = len;
435
+ }
436
+ function skipSourceless(line, index) {
437
+ if (index === 0) return true;
438
+ return line[index - 1].length === 1;
439
+ }
440
+ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
441
+ if (index === 0) return false;
442
+ const prev = line[index - 1];
443
+ if (prev.length === 1) return false;
444
+ return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
445
+ }
446
+
447
+ //#endregion
448
+ export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t };
@@ -0,0 +1,43 @@
1
+ //#region node_modules/.pnpm/rou3@0.7.12/node_modules/rou3/dist/index.d.mts
2
+ interface RouterContext<T = unknown> {
3
+ root: Node<T>;
4
+ static: Record<string, Node<T> | undefined>;
5
+ }
6
+ type ParamsIndexMap = Array<[Index: number, name: string | RegExp, optional: boolean]>;
7
+ type MethodData<T = unknown> = {
8
+ data: T;
9
+ paramsMap?: ParamsIndexMap;
10
+ paramsRegexp: RegExp[];
11
+ };
12
+ interface Node<T = unknown> {
13
+ key: string;
14
+ static?: Record<string, Node<T>>;
15
+ param?: Node<T>;
16
+ wildcard?: Node<T>;
17
+ hasRegexParam?: boolean;
18
+ methods?: Record<string, MethodData<T>[] | undefined>;
19
+ }
20
+ //#endregion
21
+ //#region node_modules/.pnpm/rou3@0.7.12/node_modules/rou3/dist/compiler.d.mts
22
+ interface RouterCompilerOptions<T = any> {
23
+ matchAll?: boolean;
24
+ serialize?: (data: T) => string;
25
+ }
26
+ /**
27
+ * Compiles the router instance into a faster route-matching function.
28
+ *
29
+ * **IMPORTANT:** `compileRouter` requires eval support with `new Function()` in the runtime for JIT compilation.
30
+ *
31
+ * @example
32
+ * import { createRouter, addRoute } from "rou3";
33
+ * import { compileRouter } from "rou3/compiler";
34
+ * const router = createRouter();
35
+ * // [add some routes]
36
+ * const findRoute = compileRouter(router);
37
+ * const matchAll = compileRouter(router, { matchAll: true });
38
+ * findRoute("GET", "/path/foo/bar");
39
+ *
40
+ * @param router - The router context to compile.
41
+ */
42
+ //#endregion
43
+ export { RouterContext as n, RouterCompilerOptions as t };