MCPcopy Create free account
hub / github.com/W4G1/multithreading / wrapRoot

Function wrapRoot

test/patch_import.test.ts:24–28  ·  view source on GitHub ↗
(argCode: string)

Source from the content-addressed store, hash-verified

22 * Logic: new URL(ARG, (typeof location !== "undefined" ? location.origin : import.meta.url)).href
23 */
24const wrapRoot = (argCode: string) => {
25 const base =
26 `(typeof location !== "undefined" ? location.origin : import.meta.url)`;
27 return `new URL(${argCode}, ${base}).href`;
28};
29
30Deno.test("Patch: Explicit relative path (double quotes)", () => {
31 const input = `await import("./foo.js")`;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected