MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / patchScriptCode

Function patchScriptCode

e2e/utils.ts:6–10  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

4
5/** Strip SRI hashes and replace slow CDN with faster alternative */
6export function patchScriptCode(code: string): string {
7 return code
8 .replace(/^(\/\/\s*@(?:require|resource)\s+.*?)#sha(?:256|384|512)[=-][^\s]+/gm, "$1")
9 .replace(/https:\/\/cdn\.jsdelivr\.net\/npm\//g, "https://unpkg.com/");
10}
11
12/**
13 * Auto-approve permission confirm dialogs opened by the extension.

Callers 1

runTestScriptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected