(code: string)
| 75 | }); |
| 76 | |
| 77 | function 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 | |
| 83 | async function startGMApiMockServer(): Promise<GMApiMockServer> { |
| 84 | const server = createServer((req, res) => { |