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

Function getMetadataStr

src/pkg/utils/utils.ts:413–420  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

411}
412
413export function getMetadataStr(code: string): string | null {
414 const start = code.indexOf("==UserScript==");
415 const end = code.indexOf("==/UserScript==");
416 if (start === -1 || end === -1) {
417 return null;
418 }
419 return `// ${code.substring(start, end + 15)}`;
420}
421
422export function getUserConfigStr(code: string): string | null {
423 const start = code.indexOf("==UserConfig==");

Callers 5

script.test.tsFile · 0.90
enableScriptMethod · 0.90
runScriptMethod · 0.90
parseScriptLoadInfoFunction · 0.90
getScriptsForTabMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected