( rawScripts: InternalScript[], tagAppMap: Record<string, string[]>, )
| 613 | } |
| 614 | |
| 615 | function 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 | |
| 632 | function detectImageTagPairs(scripts: InternalScript[]): ImageTagPair[] { |
| 633 | const openScripts: Record<string, InternalScript> = {}; |
no test coverage detected