@veryfront/ext-content-mdx 0.1.1190 → 0.1.1192

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 (66) hide show
  1. package/esm/deno.d.ts +6 -0
  2. package/esm/deno.js +13 -7
  3. package/esm/src/errors/error-registry/module.d.ts +4 -0
  4. package/esm/src/errors/error-registry/module.d.ts.map +1 -1
  5. package/esm/src/errors/error-registry/module.js +16 -0
  6. package/esm/src/errors/error-registry.d.ts +2 -0
  7. package/esm/src/errors/error-registry.d.ts.map +1 -1
  8. package/esm/src/errors/types.d.ts.map +1 -1
  9. package/esm/src/errors/types.js +5 -2
  10. package/esm/src/platform/compat/error-introspection.d.ts +12 -1
  11. package/esm/src/platform/compat/error-introspection.d.ts.map +1 -1
  12. package/esm/src/platform/compat/error-introspection.js +40 -5
  13. package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
  14. package/esm/src/platform/compat/path/basic-operations.js +6 -2
  15. package/esm/src/platform/compat/path/portable.d.ts.map +1 -1
  16. package/esm/src/platform/compat/path/portable.js +98 -54
  17. package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
  18. package/esm/src/platform/compat/path/resolution.js +14 -5
  19. package/esm/src/platform/compat/primordials/array.d.ts +8 -0
  20. package/esm/src/platform/compat/primordials/array.d.ts.map +1 -0
  21. package/esm/src/platform/compat/primordials/array.js +33 -0
  22. package/esm/src/transforms/import-rewriter/url-builder.d.ts +6 -0
  23. package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -1
  24. package/esm/src/transforms/import-rewriter/url-builder.js +96 -29
  25. package/esm/src/utils/base64url.d.ts.map +1 -1
  26. package/esm/src/utils/base64url.js +10 -4
  27. package/esm/src/utils/bundle-manifest.d.ts +19 -1
  28. package/esm/src/utils/bundle-manifest.d.ts.map +1 -1
  29. package/esm/src/utils/bundle-manifest.js +124 -27
  30. package/esm/src/utils/constants/limits.d.ts +1 -1
  31. package/esm/src/utils/constants/limits.d.ts.map +1 -1
  32. package/esm/src/utils/constants/limits.js +1 -1
  33. package/esm/src/utils/hash-utils.d.ts.map +1 -1
  34. package/esm/src/utils/hash-utils.js +32 -6
  35. package/esm/src/utils/id.d.ts +16 -0
  36. package/esm/src/utils/id.d.ts.map +1 -0
  37. package/esm/src/utils/id.js +69 -0
  38. package/esm/src/utils/import-lockfile.d.ts +52 -1
  39. package/esm/src/utils/import-lockfile.d.ts.map +1 -1
  40. package/esm/src/utils/import-lockfile.js +1042 -58
  41. package/esm/src/utils/index.d.ts +1 -1
  42. package/esm/src/utils/index.d.ts.map +1 -1
  43. package/esm/src/utils/index.js +1 -1
  44. package/esm/src/utils/logger/logger.d.ts +1 -0
  45. package/esm/src/utils/logger/logger.d.ts.map +1 -1
  46. package/esm/src/utils/logger/logger.js +359 -78
  47. package/esm/src/utils/logger/redact.d.ts +4 -2
  48. package/esm/src/utils/logger/redact.d.ts.map +1 -1
  49. package/esm/src/utils/logger/redact.js +300 -112
  50. package/esm/src/utils/logger/serialization.d.ts +3 -0
  51. package/esm/src/utils/logger/serialization.d.ts.map +1 -0
  52. package/esm/src/utils/logger/serialization.js +81 -0
  53. package/esm/src/utils/memoize.d.ts +1 -1
  54. package/esm/src/utils/memoize.d.ts.map +1 -1
  55. package/esm/src/utils/memoize.js +16 -5
  56. package/esm/src/utils/path-utils.d.ts.map +1 -1
  57. package/esm/src/utils/path-utils.js +4 -2
  58. package/esm/src/utils/sleep.d.ts +8 -0
  59. package/esm/src/utils/sleep.d.ts.map +1 -1
  60. package/esm/src/utils/sleep.js +11 -2
  61. package/esm/src/utils/timer.d.ts +10 -0
  62. package/esm/src/utils/timer.d.ts.map +1 -0
  63. package/esm/src/utils/timer.js +19 -0
  64. package/esm/src/utils/version-constant.d.ts +1 -1
  65. package/esm/src/utils/version-constant.js +1 -1
  66. package/package.json +2 -2
@@ -1,15 +1,44 @@
1
1
  import * as dntShim from "../../../../_dnt.shims.js";
2
+ import { primordialArrayAt as arrayAt, primordialArrayFilter as arrayFilter, primordialArrayJoin as arrayJoin, primordialArrayPop as arrayPop, primordialArrayPush as arrayPush, } from "../primordials/array.js";
3
+ const apply = Reflect.apply;
4
+ const arraySlice = Array.prototype.slice;
5
+ const regExpExec = RegExp.prototype.exec;
6
+ const stringEndsWith = String.prototype.endsWith;
7
+ const stringIncludes = String.prototype.includes;
8
+ const stringLastIndexOf = String.prototype.lastIndexOf;
9
+ const stringReplaceAll = String.prototype.replaceAll;
10
+ const stringSlice = String.prototype.slice;
11
+ const stringSplit = String.prototype.split;
12
+ const stringStartsWith = String.prototype.startsWith;
13
+ const stringToLowerCase = String.prototype.toLowerCase;
14
+ function includes(value, search) {
15
+ return apply(stringIncludes, value, [search]);
16
+ }
17
+ function startsWith(value, search) {
18
+ return apply(stringStartsWith, value, [search]);
19
+ }
20
+ function endsWith(value, search) {
21
+ return apply(stringEndsWith, value, [search]);
22
+ }
23
+ function slice(value, start, end) {
24
+ return apply(stringSlice, value, end === undefined ? [start] : [start, end]);
25
+ }
26
+ function lastIndexOf(value, search) {
27
+ return apply(stringLastIndexOf, value, [search]);
28
+ }
29
+ function matches(pattern, value) {
30
+ return apply(regExpExec, pattern, [value]);
31
+ }
2
32
  export function hasWindowsLikePath(path) {
3
- return path.includes("\\") ||
4
- /^[A-Za-z]:/.test(path);
33
+ return includes(path, "\\") || matches(/^[A-Za-z]:/, path) !== null;
5
34
  }
6
35
  export function toPortableSeparators(path) {
7
- return path.replaceAll("\\", "/");
36
+ return apply(stringReplaceAll, path, ["\\", "/"]);
8
37
  }
9
38
  function analyzeRoot(path, windows) {
10
39
  const portable = toPortableSeparators(path);
11
40
  if (windows) {
12
- const unc = portable.match(/^\/\/([^/]+)\/+([^/]+)(\/+(.*))?$/);
41
+ const unc = matches(/^\/\/([^/]+)\/+([^/]+)(\/+(.*))?$/, portable);
13
42
  if (unc?.[1] && unc[2]) {
14
43
  const device = `//${unc[1]}/${unc[2]}`;
15
44
  return {
@@ -19,7 +48,7 @@ function analyzeRoot(path, windows) {
19
48
  root: unc[3] === undefined ? device : `${device}/`,
20
49
  };
21
50
  }
22
- const drive = portable.match(/^([A-Za-z]:)(\/+)?(.*)$/);
51
+ const drive = matches(/^([A-Za-z]:)(\/+)?(.*)$/, portable);
23
52
  if (drive?.[1] !== undefined) {
24
53
  const absolute = drive[2] !== undefined;
25
54
  return {
@@ -30,11 +59,14 @@ function analyzeRoot(path, windows) {
30
59
  };
31
60
  }
32
61
  }
33
- if (portable.startsWith("/")) {
62
+ if (startsWith(portable, "/")) {
63
+ let restStart = 0;
64
+ while (portable[restStart] === "/")
65
+ restStart++;
34
66
  return {
35
67
  absolute: true,
36
68
  device: "",
37
- rest: portable.replace(/^\/+/, ""),
69
+ rest: slice(portable, restStart),
38
70
  root: "/",
39
71
  };
40
72
  }
@@ -51,25 +83,30 @@ function appendRoot(root, tail) {
51
83
  if (!root.absolute)
52
84
  return `${root.root}${tail || "."}`;
53
85
  if (!tail) {
54
- return root.device.startsWith("//") ? `${root.device}/` : root.root;
86
+ return startsWith(root.device, "//") ? `${root.device}/` : root.root;
55
87
  }
56
- return root.root.endsWith("/") ? `${root.root}${tail}` : `${root.root}/${tail}`;
88
+ return endsWith(root.root, "/") ? `${root.root}${tail}` : `${root.root}/${tail}`;
57
89
  }
58
90
  function normalizeTail(rest, absolute) {
59
91
  const normalized = [];
60
- for (const segment of rest.split("/")) {
92
+ const segments = apply(stringSplit, rest, ["/"]);
93
+ // Path normalization is reached by shared-runtime coordination after tenant
94
+ // code has loaded. Avoid the live Array iterator so post-import prototype
95
+ // mutation cannot turn canonical lockfile lookup into a process-wide outage.
96
+ for (let index = 0; index < segments.length; index++) {
97
+ const segment = segments[index];
61
98
  if (segment === "" || segment === ".")
62
99
  continue;
63
100
  if (segment !== "..") {
64
- normalized.push(segment);
101
+ arrayPush(normalized, segment);
65
102
  continue;
66
103
  }
67
- const previous = normalized.at(-1);
104
+ const previous = arrayAt(normalized, -1);
68
105
  if (previous !== undefined && previous !== "..") {
69
- normalized.pop();
106
+ arrayPop(normalized);
70
107
  }
71
108
  else if (!absolute) {
72
- normalized.push("..");
109
+ arrayPush(normalized, "..");
73
110
  }
74
111
  }
75
112
  return normalized;
@@ -80,15 +117,15 @@ function canonicalPath(path, windows) {
80
117
  export function removeTrailingSeparatorsExceptRoot(path, windows) {
81
118
  const root = analyzeRoot(path, windows);
82
119
  let canonical = canonicalPath(path, windows);
83
- while (canonical.endsWith("/") &&
120
+ while (endsWith(canonical, "/") &&
84
121
  canonical.length > root.root.length) {
85
- canonical = canonical.slice(0, -1);
122
+ canonical = slice(canonical, 0, -1);
86
123
  }
87
124
  return canonical;
88
125
  }
89
126
  function rootKey(root, windows) {
90
127
  const value = root.device || root.root;
91
- return windows ? value.toLowerCase() : value;
128
+ return windows ? apply(stringToLowerCase, value, []) : value;
92
129
  }
93
130
  export function runtimeUsesWindowsPaths() {
94
131
  const runtime = dntShim.dntGlobalThis;
@@ -121,44 +158,44 @@ export function portableNormalize(path, windows) {
121
158
  if (path === "")
122
159
  return ".";
123
160
  const root = analyzeRoot(path, windows);
124
- const tail = normalizeTail(root.rest, root.absolute).join("/");
161
+ const tail = arrayJoin(normalizeTail(root.rest, root.absolute), "/");
125
162
  let result = appendRoot(root, tail);
126
- const hadTrailingSeparator = /[\\/]$/.test(path);
163
+ const hadTrailingSeparator = matches(/[\\/]$/, path) !== null;
127
164
  if (hadTrailingSeparator && result === ".")
128
165
  return "./";
129
166
  if (hadTrailingSeparator &&
130
167
  result !== root.root &&
131
- !result.endsWith("/")) {
168
+ !endsWith(result, "/")) {
132
169
  result += "/";
133
170
  }
134
171
  return result;
135
172
  }
136
173
  export function portableJoin(paths, windows) {
137
- const nonempty = paths.filter((path) => path.length > 0);
174
+ const nonempty = arrayFilter(paths, (path) => path.length > 0);
138
175
  if (nonempty.length === 0)
139
176
  return "/";
140
- return portableNormalize(nonempty.join("/"), windows);
177
+ return portableNormalize(arrayJoin(nonempty, "/"), windows);
141
178
  }
142
179
  export function portableDirname(path, windows) {
143
180
  if (path.length === 0)
144
181
  return ".";
145
182
  const root = analyzeRoot(path, windows);
146
183
  let canonical = canonicalPath(path, windows);
147
- while (canonical.endsWith("/") &&
184
+ while (endsWith(canonical, "/") &&
148
185
  canonical.length > root.root.length) {
149
- canonical = canonical.slice(0, -1);
186
+ canonical = slice(canonical, 0, -1);
150
187
  }
151
188
  if (canonical === root.root || canonical === root.device) {
152
189
  return root.root || root.device || ".";
153
190
  }
154
- const lastSeparator = canonical.lastIndexOf("/");
191
+ const lastSeparator = lastIndexOf(canonical, "/");
155
192
  if (lastSeparator === -1)
156
193
  return root.device || ".";
157
194
  if (lastSeparator < root.root.length)
158
195
  return root.root || "/";
159
196
  if (lastSeparator === 0)
160
197
  return "/";
161
- return canonical.slice(0, lastSeparator);
198
+ return slice(canonical, 0, lastSeparator);
162
199
  }
163
200
  export function portableBasename(path, ext, windows) {
164
201
  if (path.length === 0)
@@ -168,44 +205,45 @@ export function portableBasename(path, ext, windows) {
168
205
  const originalPath = canonical;
169
206
  if (ext !== undefined && ext !== "" && ext === originalPath)
170
207
  return "";
171
- while (canonical.endsWith("/") &&
208
+ while (endsWith(canonical, "/") &&
172
209
  canonical.length > root.root.length) {
173
- canonical = canonical.slice(0, -1);
210
+ canonical = slice(canonical, 0, -1);
174
211
  }
175
212
  if (windows &&
176
- root.device.startsWith("//") &&
213
+ startsWith(root.device, "//") &&
177
214
  root.rest === "") {
178
- return root.device.slice(root.device.lastIndexOf("/") + 1);
215
+ return slice(root.device, lastIndexOf(root.device, "/") + 1);
179
216
  }
180
217
  if (canonical === root.root || canonical === root.device)
181
218
  return "";
182
- const lastSeparator = canonical.lastIndexOf("/");
183
- let base = canonical.slice(lastSeparator + 1);
219
+ const lastSeparator = lastIndexOf(canonical, "/");
220
+ let base = slice(canonical, lastSeparator + 1);
184
221
  if (!root.absolute &&
185
222
  root.device &&
186
223
  lastSeparator === -1 &&
187
- base.startsWith(root.device)) {
188
- base = base.slice(root.device.length);
224
+ startsWith(base, root.device)) {
225
+ base = slice(base, root.device.length);
189
226
  }
190
- if (ext !== undefined && ext !== "" && base.endsWith(ext)) {
227
+ if (ext !== undefined && ext !== "" && endsWith(base, ext)) {
191
228
  if (ext.length < base.length)
192
- return base.slice(0, -ext.length);
229
+ return slice(base, 0, -ext.length);
193
230
  }
194
231
  return base;
195
232
  }
196
233
  export function portableExtname(path, windows) {
197
234
  const base = portableBasename(path, undefined, windows);
198
- const lastDot = base.lastIndexOf(".");
235
+ const lastDot = lastIndexOf(base, ".");
199
236
  if (lastDot <= 0 || base === "." || base === "..")
200
237
  return "";
201
- return base.slice(lastDot);
238
+ return slice(base, lastDot);
202
239
  }
203
240
  export function portableIsAbsolute(path, windows) {
204
241
  return analyzeRoot(path, windows).absolute;
205
242
  }
206
243
  export function portableResolve(paths, windows) {
207
244
  let resolved = runtimeCwd();
208
- for (const rawPath of paths) {
245
+ for (let index = 0; index < paths.length; index++) {
246
+ const rawPath = paths[index];
209
247
  if (rawPath.length === 0)
210
248
  continue;
211
249
  const path = toPortableSeparators(rawPath);
@@ -228,10 +266,10 @@ export function portableResolve(paths, windows) {
228
266
  }
229
267
  const normalized = portableNormalize(resolved, windows);
230
268
  const root = analyzeRoot(normalized, windows);
231
- if (normalized.endsWith("/") &&
269
+ if (endsWith(normalized, "/") &&
232
270
  normalized !== root.root &&
233
271
  normalized !== `${root.device}/`) {
234
- return normalized.slice(0, -1);
272
+ return slice(normalized, 0, -1);
235
273
  }
236
274
  return normalized;
237
275
  }
@@ -249,34 +287,40 @@ export function portableRelative(from, to, windows) {
249
287
  while (common < fromParts.length && common < toParts.length) {
250
288
  const fromPart = fromParts[common];
251
289
  const toPart = toParts[common];
252
- const equal = windows ? fromPart.toLowerCase() === toPart.toLowerCase() : fromPart === toPart;
290
+ const equal = windows
291
+ ? apply(stringToLowerCase, fromPart, []) === apply(stringToLowerCase, toPart, [])
292
+ : fromPart === toPart;
253
293
  if (!equal)
254
294
  break;
255
295
  common++;
256
296
  }
257
- const result = [
258
- ...Array.from({ length: fromParts.length - common }, () => ".."),
259
- ...toParts.slice(common),
260
- ];
261
- return result.join("/") || ".";
297
+ const result = [];
298
+ for (let index = common; index < fromParts.length; index++) {
299
+ arrayPush(result, "..");
300
+ }
301
+ const remainingToParts = apply(arraySlice, toParts, [common]);
302
+ for (let index = 0; index < remainingToParts.length; index++) {
303
+ arrayPush(result, remainingToParts[index]);
304
+ }
305
+ return arrayJoin(result, "/") || ".";
262
306
  }
263
307
  export function portableParse(path, windows) {
264
308
  const root = analyzeRoot(path, windows);
265
309
  let canonical = canonicalPath(path, windows);
266
- while (canonical.endsWith("/") &&
310
+ while (endsWith(canonical, "/") &&
267
311
  canonical.length > root.root.length) {
268
- canonical = canonical.slice(0, -1);
312
+ canonical = slice(canonical, 0, -1);
269
313
  }
270
- const base = windows && root.device.startsWith("//") && root.rest === ""
314
+ const base = windows && startsWith(root.device, "//") && root.rest === ""
271
315
  ? ""
272
316
  : portableBasename(canonical, undefined, windows);
273
317
  const ext = portableExtname(base, windows);
274
- const name = base.slice(0, base.length - ext.length);
318
+ const name = slice(base, 0, base.length - ext.length);
275
319
  let dir = "";
276
320
  if (base === "") {
277
321
  dir = root.root;
278
322
  }
279
- else if (canonical.includes("/") ||
323
+ else if (includes(canonical, "/") ||
280
324
  (windows && root.device !== "")) {
281
325
  dir = portableDirname(canonical, windows);
282
326
  }
@@ -292,7 +336,7 @@ export function portableFormat(pathObject, windows) {
292
336
  const root = toPortableSeparators(pathObject.root ?? "");
293
337
  const dir = toPortableSeparators(pathObject.dir ?? "");
294
338
  const rawExt = pathObject.ext ?? "";
295
- const ext = rawExt && !rawExt.startsWith(".") ? `.${rawExt}` : rawExt;
339
+ const ext = rawExt && !startsWith(rawExt, ".") ? `.${rawExt}` : rawExt;
296
340
  const base = pathObject.base ||
297
341
  `${pathObject.name ?? ""}${ext}`;
298
342
  const directory = dir || root;
@@ -300,7 +344,7 @@ export function portableFormat(pathObject, windows) {
300
344
  return base;
301
345
  if (!base)
302
346
  return directory;
303
- if (directory.endsWith("/") || (windows && /^[A-Za-z]:$/.test(directory))) {
347
+ if (endsWith(directory, "/") || (windows && matches(/^[A-Za-z]:$/, directory) !== null)) {
304
348
  return `${directory}${base}`;
305
349
  }
306
350
  return `${directory}/${base}`;
@@ -1 +1 @@
1
- {"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/resolution.ts"],"names":[],"mappings":"AAgBA,6DAA6D;AAC7D,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAMlD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIhD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW9C"}
1
+ {"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/resolution.ts"],"names":[],"mappings":"AAsBA,6DAA6D;AAC7D,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAMlD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMhD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW9C"}
@@ -1,26 +1,35 @@
1
1
  import { hasWindowsLikePath, portableIsAbsolute, portableNormalize, portableRelative, portableResolve, removeTrailingSeparatorsExceptRoot, runtimeUsesWindowsPaths, toPortableSeparators, } from "./portable.js";
2
2
  import { getNativePathImplementation } from "./runtime.js";
3
+ const apply = Reflect.apply;
3
4
  function usesWindowsFlavor(paths) {
4
- return runtimeUsesWindowsPaths() || paths.some(hasWindowsLikePath);
5
+ if (runtimeUsesWindowsPaths())
6
+ return true;
7
+ for (let index = 0; index < paths.length; index++) {
8
+ if (hasWindowsLikePath(paths[index]))
9
+ return true;
10
+ }
11
+ return false;
5
12
  }
6
13
  /** Resolve path segments to an absolute, normalized path. */
7
14
  export function resolve(...paths) {
8
15
  const windows = usesWindowsFlavor(paths);
9
16
  const pathApi = getNativePathImplementation(windows);
10
17
  return pathApi
11
- ? toPortableSeparators(pathApi.resolve(...paths))
18
+ ? toPortableSeparators(apply(pathApi.resolve, pathApi, paths))
12
19
  : portableResolve(paths, windows);
13
20
  }
14
21
  export function isAbsolute(path) {
15
22
  const windows = usesWindowsFlavor([path]);
16
23
  const pathApi = getNativePathImplementation(windows);
17
- return pathApi?.isAbsolute(path) ?? portableIsAbsolute(path, windows);
24
+ return pathApi
25
+ ? apply(pathApi.isAbsolute, pathApi, [path])
26
+ : portableIsAbsolute(path, windows);
18
27
  }
19
28
  export function relative(from, to) {
20
29
  const windows = usesWindowsFlavor([from, to]);
21
30
  const pathApi = getNativePathImplementation(windows);
22
31
  const result = pathApi
23
- ? toPortableSeparators(pathApi.relative(from, to))
32
+ ? toPortableSeparators(apply(pathApi.relative, pathApi, [from, to]))
24
33
  : portableRelative(from, to, windows);
25
34
  return result || ".";
26
35
  }
@@ -28,7 +37,7 @@ export function normalize(path) {
28
37
  const windows = usesWindowsFlavor([path]);
29
38
  const pathApi = getNativePathImplementation(windows);
30
39
  const normalized = pathApi
31
- ? toPortableSeparators(pathApi.normalize(path))
40
+ ? toPortableSeparators(apply(pathApi.normalize, pathApi, [path]))
32
41
  : portableNormalize(path, windows);
33
42
  // The established Veryfront facade contract returns canonical paths without
34
43
  // a trailing separator, except for filesystem roots. Enforce that
@@ -0,0 +1,8 @@
1
+ export declare function primordialArrayAt<T>(values: readonly T[], index: number): T | undefined;
2
+ export declare function primordialArrayFilter<T>(values: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown): T[];
3
+ export declare function primordialArrayJoin(values: readonly unknown[], separator: string): string;
4
+ export declare function primordialArrayMap<T, U>(values: readonly T[], callback: (value: T, index: number, array: readonly T[]) => U): U[];
5
+ export declare function primordialArrayPop<T>(values: T[]): T | undefined;
6
+ export declare function primordialArrayPush<T>(values: T[], value: T): void;
7
+ export declare function primordialArraySort<T>(values: T[], compare: (left: T, right: T) => number): T[];
8
+ //# sourceMappingURL=array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/primordials/array.ts"],"names":[],"mappings":"AAaA,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,KAAK,EAAE,MAAM,GACZ,CAAC,GAAG,SAAS,CAEf;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GACnE,CAAC,EAAE,CAEL;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,OAAO,EAAE,EAC1B,SAAS,EAAE,MAAM,GAChB,MAAM,CAER;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC,GAC5D,CAAC,EAAE,CAEL;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,SAAS,CAEhE;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAElE;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,CAAC,EAAE,EACX,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,MAAM,GACrC,CAAC,EAAE,CAEL"}
@@ -0,0 +1,33 @@
1
+ // Capture shared array intrinsics once, before project code can replace mutable
2
+ // prototype methods in a long-lived runtime. Keep this module dependency-free so
3
+ // low-level compatibility code and higher framework layers can use the same
4
+ // trusted operations without introducing an import cycle.
5
+ const ArrayPrototypeAt = Array.prototype.at;
6
+ const ArrayPrototypeFilter = Array.prototype.filter;
7
+ const ArrayPrototypeJoin = Array.prototype.join;
8
+ const ArrayPrototypeMap = Array.prototype.map;
9
+ const ArrayPrototypePop = Array.prototype.pop;
10
+ const ArrayPrototypePush = Array.prototype.push;
11
+ const ArrayPrototypeSort = Array.prototype.sort;
12
+ const ReflectApply = Reflect.apply;
13
+ export function primordialArrayAt(values, index) {
14
+ return ReflectApply(ArrayPrototypeAt, values, [index]);
15
+ }
16
+ export function primordialArrayFilter(values, predicate) {
17
+ return ReflectApply(ArrayPrototypeFilter, values, [predicate]);
18
+ }
19
+ export function primordialArrayJoin(values, separator) {
20
+ return ReflectApply(ArrayPrototypeJoin, values, [separator]);
21
+ }
22
+ export function primordialArrayMap(values, callback) {
23
+ return ReflectApply(ArrayPrototypeMap, values, [callback]);
24
+ }
25
+ export function primordialArrayPop(values) {
26
+ return ReflectApply(ArrayPrototypePop, values, []);
27
+ }
28
+ export function primordialArrayPush(values, value) {
29
+ ReflectApply(ArrayPrototypePush, values, [value]);
30
+ }
31
+ export function primordialArraySort(values, compare) {
32
+ return ReflectApply(ArrayPrototypeSort, values, [compare]);
33
+ }
@@ -66,6 +66,12 @@ export declare function appendSameOriginDependencyPinningPathKey(url: string, de
66
66
  * Foreign origins and flag-off requests are preserved byte-for-byte.
67
67
  */
68
68
  export declare function appendSameOriginSSRDependencyPinningKey(url: string, dependencyPinningCacheKey?: string, moduleServerOrigin?: string): string;
69
+ /**
70
+ * Bind a same-origin absolute module URL to an SSR dependency snapshot using
71
+ * the module-server path transport. Use this only when the consumer resolves
72
+ * `/_vf_modules/` paths through the module server instead of generic fetch.
73
+ */
74
+ export declare function appendSameOriginSSRDependencyPinningPathKey(url: string, dependencyPinningCacheKey?: string, moduleServerOrigin?: string): string;
69
75
  export interface ExtractedDependencyPinningPath {
70
76
  pathname: string;
71
77
  cacheKey?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"url-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/import-rewriter/url-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,2BAA2B;AAC3B,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,kEAAkE;AAClE,eAAO,MAAM,eAAe,UAAU,CAAC;AAEvC,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,CAqBR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,GAAG,WAAW,EAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,UAAQ,GACf,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI1E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,GACjC,MAAM,CAcR;AAeD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,GACjC,MAAM,CA4CR;AAED;;;GAGG;AACH,wBAAgB,wCAAwC,CACtD,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CA8BR;AAED;;;GAGG;AACH,wBAAgB,uCAAuC,CACrD,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CAwBR;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,GACf,8BAA8B,CA4ChC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,IAAI,EAAE,MAAM,GACX,MAAM,CAIR;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAGhG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAgDtE"}
1
+ {"version":3,"file":"url-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/import-rewriter/url-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,2BAA2B;AAC3B,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,kEAAkE;AAClE,eAAO,MAAM,eAAe,UAAU,CAAC;AAEvC,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AA0BF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,CAQR;AAgBD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,GAAG,WAAW,EAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,UAAQ,GACf,MAAM,CAKR;AAYD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAazE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI1E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,GACjC,MAAM,CAcR;AA4CD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,GACjC,MAAM,CAqCR;AAED;;;GAGG;AACH,wBAAgB,wCAAwC,CACtD,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CA8BR;AAED;;;GAGG;AACH,wBAAgB,uCAAuC,CACrD,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CA0BR;AAED;;;;GAIG;AACH,wBAAgB,2CAA2C,CACzD,GAAG,EAAE,MAAM,EACX,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CA8BR;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,GACf,8BAA8B,CAmChC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,IAAI,EAAE,MAAM,GACX,MAAM,CAIR;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAGhG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAgDtE"}
@@ -4,6 +4,7 @@
4
4
  * Single source of truth for all URL generation.
5
5
  * Ensures consistent URLs across SSR and browser for hydration parity.
6
6
  */
7
+ import { primordialArrayJoin as arrayJoin, primordialArrayPush as arrayPush, } from "../../platform/compat/primordials/array.js";
7
8
  /**
8
9
  * Default React version - used when not specified.
9
10
  *
@@ -17,6 +18,24 @@ export const DEFAULT_REACT_VERSION = "19.2.4";
17
18
  export const TAILWIND_VERSION = "4.1.8";
18
19
  /** csstype version - must match deno.json for type consistency */
19
20
  export const CSSTYPE_VERSION = "3.2.3";
21
+ const ObjectEntries = Object.entries;
22
+ function buildEsmShParams(options) {
23
+ const params = [];
24
+ if (options?.external?.length) {
25
+ arrayPush(params, `external=${arrayJoin(options.external, ",")}`);
26
+ }
27
+ arrayPush(params, `target=${options?.target ?? "es2022"}`);
28
+ if (options?.deps) {
29
+ const deps = [];
30
+ const entries = ObjectEntries(options.deps);
31
+ for (let index = 0; index < entries.length; index++) {
32
+ const [key, value] = entries[index];
33
+ arrayPush(deps, `${key}@${value}`);
34
+ }
35
+ arrayPush(params, `deps=${arrayJoin(deps, ",")}`);
36
+ }
37
+ return params;
38
+ }
20
39
  /**
21
40
  * Build esm.sh URL with proper configuration.
22
41
  *
@@ -26,22 +45,21 @@ export const CSSTYPE_VERSION = "3.2.3";
26
45
  * @param options - URL options
27
46
  */
28
47
  export function buildEsmShUrl(pkg, version, subpath, options) {
29
- const params = [];
30
- if (options?.external?.length) {
31
- params.push(`external=${options.external.join(",")}`);
32
- }
33
- params.push(`target=${options?.target ?? "es2022"}`);
34
- if (options?.deps) {
35
- const depsStr = Object.entries(options.deps)
36
- .map(([k, v]) => `${k}@${v}`)
37
- .join(",");
38
- params.push(`deps=${depsStr}`);
39
- }
48
+ const params = buildEsmShParams(options);
40
49
  const versionStr = version ? `@${version}` : "";
41
50
  const pathStr = subpath ?? "";
42
- const queryStr = params.length ? `?${params.join("&")}` : "";
51
+ const queryStr = params.length ? `?${arrayJoin(params, "&")}` : "";
43
52
  return `https://esm.sh/${pkg}${versionStr}${pathStr}${queryStr}`;
44
53
  }
54
+ /**
55
+ * Build an esm.sh package-prefix URL. esm.sh's `&option/` form keeps the
56
+ * trailing slash required by the import-map prefix-matching algorithm.
57
+ */
58
+ function buildEsmShPrefixUrl(pkg, version, options) {
59
+ const params = buildEsmShParams(options);
60
+ const optionStr = params.length ? `&${arrayJoin(params, "&")}` : "";
61
+ return `https://esm.sh/${pkg}@${version}${optionStr}/`;
62
+ }
45
63
  /**
46
64
  * Build React esm.sh URL.
47
65
  * Uses deps=csstype for type consistency.
@@ -52,6 +70,12 @@ export function buildReactUrl(pkg, version, subpath, external = false) {
52
70
  deps: { csstype: CSSTYPE_VERSION },
53
71
  });
54
72
  }
73
+ function buildReactPrefixUrl(pkg, version) {
74
+ return buildEsmShPrefixUrl(pkg, version, {
75
+ external: ["react"],
76
+ deps: { csstype: CSSTYPE_VERSION },
77
+ });
78
+ }
55
79
  /**
56
80
  * Get complete React import map for a specific version.
57
81
  */
@@ -63,8 +87,10 @@ export function getReactImportMap(version) {
63
87
  "react-dom/server": buildReactUrl("react-dom", version, "/server", true),
64
88
  "react/jsx-runtime": buildReactUrl("react", version, "/jsx-runtime", true),
65
89
  "react/jsx-dev-runtime": buildReactUrl("react", version, "/jsx-dev-runtime", true),
66
- // Prefix match for any react/* subpath imports
67
- "react/": buildReactUrl("react", version, "/", true),
90
+ // Prefix matches cover future package exports without allowing a project
91
+ // import map to redirect React or ReactDOM subpaths.
92
+ "react/": buildReactPrefixUrl("react", version),
93
+ "react-dom/": buildReactPrefixUrl("react-dom", version),
68
94
  };
69
95
  }
70
96
  /**
@@ -94,6 +120,17 @@ export function appendDependencyPinningKey(url, dependencyPinningCacheKey) {
94
120
  const DEPENDENCY_PINNING_PATH_MARKER = "_pins/";
95
121
  const MODULE_SERVER_PATH_PREFIXES = ["/_vf_modules/"];
96
122
  const DEPENDENCY_PINNING_PATH_KEY_PATTERN = /^on:[A-Za-z0-9._-]+$/;
123
+ function splitUrlComponents(url) {
124
+ const hashIndex = url.indexOf("#");
125
+ const hash = hashIndex === -1 ? "" : url.slice(hashIndex);
126
+ const urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
127
+ const queryIndex = urlWithoutHash.indexOf("?");
128
+ return {
129
+ path: queryIndex === -1 ? urlWithoutHash : urlWithoutHash.slice(0, queryIndex),
130
+ params: new URLSearchParams(queryIndex === -1 ? "" : urlWithoutHash.slice(queryIndex + 1)),
131
+ hash,
132
+ };
133
+ }
97
134
  function decodeDependencyPinningPathKey(encodedKey) {
98
135
  try {
99
136
  const cacheKey = decodeURIComponent(encodedKey);
@@ -103,6 +140,15 @@ function decodeDependencyPinningPathKey(encodedKey) {
103
140
  return undefined;
104
141
  }
105
142
  }
143
+ function hasMalformedPercentEncoding(value) {
144
+ try {
145
+ decodeURIComponent(value);
146
+ return false;
147
+ }
148
+ catch {
149
+ return true;
150
+ }
151
+ }
106
152
  /**
107
153
  * Bind an import-map prefix target to a dependency snapshot without adding a
108
154
  * query string. Import-map prefix targets must end in `/`; placing the token in
@@ -112,12 +158,7 @@ function decodeDependencyPinningPathKey(encodedKey) {
112
158
  export function appendDependencyPinningPathKey(url, dependencyPinningCacheKey) {
113
159
  if (!dependencyPinningCacheKey?.startsWith("on:"))
114
160
  return url;
115
- const hashIndex = url.indexOf("#");
116
- const hash = hashIndex === -1 ? "" : url.slice(hashIndex);
117
- const urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
118
- const queryIndex = urlWithoutHash.indexOf("?");
119
- const path = queryIndex === -1 ? urlWithoutHash : urlWithoutHash.slice(0, queryIndex);
120
- const params = new URLSearchParams(queryIndex === -1 ? "" : urlWithoutHash.slice(queryIndex + 1));
161
+ const { path, params, hash } = splitUrlComponents(url);
121
162
  for (const prefix of MODULE_SERVER_PATH_PREFIXES) {
122
163
  const prefixIndex = path.indexOf(prefix);
123
164
  if (prefixIndex === -1)
@@ -187,8 +228,37 @@ export function appendSameOriginSSRDependencyPinningKey(url, dependencyPinningCa
187
228
  !target.pathname.startsWith("/_vf_modules/")) {
188
229
  return url;
189
230
  }
190
- target.searchParams.set("ssr", "true");
191
- return appendDependencyPinningKey(target.href, dependencyPinningCacheKey);
231
+ const params = target.searchParams;
232
+ params.set("pins", dependencyPinningCacheKey);
233
+ params.set("ssr", "true");
234
+ return target.toString();
235
+ }
236
+ catch {
237
+ return url;
238
+ }
239
+ }
240
+ /**
241
+ * Bind a same-origin absolute module URL to an SSR dependency snapshot using
242
+ * the module-server path transport. Use this only when the consumer resolves
243
+ * `/_vf_modules/` paths through the module server instead of generic fetch.
244
+ */
245
+ export function appendSameOriginSSRDependencyPinningPathKey(url, dependencyPinningCacheKey, moduleServerOrigin) {
246
+ if (!dependencyPinningCacheKey?.startsWith("on:") ||
247
+ !moduleServerOrigin ||
248
+ (!/^https?:\/\//i.test(url) && !url.startsWith("//"))) {
249
+ return url;
250
+ }
251
+ try {
252
+ const requestOrigin = new URL(moduleServerOrigin);
253
+ const target = new URL(url, requestOrigin);
254
+ if (target.origin !== requestOrigin.origin ||
255
+ !target.pathname.startsWith("/_vf_modules/")) {
256
+ return url;
257
+ }
258
+ const moduleUrl = appendDependencyPinningPathKey(`${target.pathname}${target.search}${target.hash}`, dependencyPinningCacheKey);
259
+ const { path, params, hash } = splitUrlComponents(moduleUrl);
260
+ params.set("ssr", "true");
261
+ return `${path}?${params.toString()}${hash}`;
192
262
  }
193
263
  catch {
194
264
  return url;
@@ -209,6 +279,9 @@ export function extractDependencyPinningPathKey(pathname) {
209
279
  const encodedKey = separatorIndex === -1
210
280
  ? encodedKeyAndPath
211
281
  : encodedKeyAndPath.slice(0, separatorIndex);
282
+ if (hasMalformedPercentEncoding(encodedKey)) {
283
+ return { pathname, found: true, malformed: true };
284
+ }
212
285
  const cacheKey = decodeDependencyPinningPathKey(encodedKey);
213
286
  if (!cacheKey) {
214
287
  return { pathname, found: false, malformed: false };
@@ -218,13 +291,7 @@ export function extractDependencyPinningPathKey(pathname) {
218
291
  }
219
292
  const modulePath = encodedKeyAndPath.slice(separatorIndex + 1);
220
293
  if (modulePath.startsWith(DEPENDENCY_PINNING_PATH_MARKER)) {
221
- const nestedKeyEnd = modulePath.indexOf("/", DEPENDENCY_PINNING_PATH_MARKER.length);
222
- const nestedEncodedKey = nestedKeyEnd === -1
223
- ? modulePath.slice(DEPENDENCY_PINNING_PATH_MARKER.length)
224
- : modulePath.slice(DEPENDENCY_PINNING_PATH_MARKER.length, nestedKeyEnd);
225
- if (decodeDependencyPinningPathKey(nestedEncodedKey)) {
226
- return { pathname, found: true, malformed: true };
227
- }
294
+ return { pathname, found: true, malformed: true };
228
295
  }
229
296
  return {
230
297
  pathname: `${prefix}${modulePath}`,