MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / normalizeScripts

Function normalizeScripts

apps/webuiapps/src/lib/cardExtractor.ts:615–630  ·  view source on GitHub ↗
(
  rawScripts: InternalScript[],
  tagAppMap: Record<string, string[]>,
)

Source from the content-addressed store, hash-verified

613}
614
615function normalizeScripts(
616 rawScripts: InternalScript[],
617 tagAppMap: Record<string, string[]>,
618): InternalScript[] {
619 return rawScripts.map((s) => {
620 const regexTags = extractTagsFromRegex(s.findRegex || '');
621 const matchedApp = matchScriptToApp(regexTags, tagAppMap);
622 return {
623 ...s,
624 name: s.name || s.scriptName || '',
625 type: classifyScript(s, regexTags),
626 matchedApp,
627 regexTags,
628 };
629 });
630}
631
632function detectImageTagPairs(scripts: InternalScript[]): ImageTagPair[] {
633 const openScripts: Record<string, InternalScript> = {};

Callers 1

extractCardFunction · 0.85

Calls 3

extractTagsFromRegexFunction · 0.85
matchScriptToAppFunction · 0.85
classifyScriptFunction · 0.85

Tested by

no test coverage detected