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

Function sourceMapTo

src/pkg/utils/utils.ts:457–461  ·  view source on GitHub ↗
(scriptName: string)

Source from the content-addressed store, hash-verified

455}
456
457export const sourceMapTo = (scriptName: string) => {
458 // sandbox 环境中 chrome.runtime 不可用,使用脚本名作为 sourceURL
459 const url = chrome.runtime?.getURL ? chrome.runtime.getURL(`/${encodeURI(scriptName)}`) : encodeURI(scriptName);
460 return `\n//# sourceURL=${url}`;
461};
462
463export const stringMatching = (main: string, sub: string): boolean => {
464 // If no wildcards, use simple includes check

Callers 3

compileScriptletCodeFunction · 0.90

Calls 1

getURLMethod · 0.80

Tested by

no test coverage detected