MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / patchScriptCode

Function patchScriptCode

e2e/gm-api.spec.ts:77–81  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

75});
76
77function patchScriptCode(code: string): string {
78 return code
79 .replace(/^(\/\/\s*@(?:require|resource)\s+.*?)#sha(?:256|384|512)[=-][^\s]+/gm, "$1")
80 .replace(/https:\/\/cdn\.jsdelivr\.net\/npm\//g, "https://unpkg.com/");
81}
82
83async function startGMApiMockServer(): Promise<GMApiMockServer> {
84 const server = createServer((req, res) => {

Callers 1

runTestScriptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected