(depFileMap: Map<string, string>, candidate: string | null, fileName: string)
| 767 | } |
| 768 | |
| 769 | function registerDependencyFile(depFileMap: Map<string, string>, candidate: string | null, fileName: string): void { |
| 770 | if (!candidate) return; |
| 771 | |
| 772 | const cleaned = candidate.replace(PAT.QUERY_PATTERN, ''); |
| 773 | const normalizedCandidate = normalizeNativeScriptCoreSpecifier(cleaned); |
| 774 | if (isCoreGlobalsReference(normalizedCandidate)) { |
| 775 | return; |
| 776 | } |
| 777 | if (isNativeScriptCoreModule(normalizedCandidate)) { |
| 778 | return; |
| 779 | } |
| 780 | if (isNativeScriptPluginModule(normalizedCandidate)) { |
| 781 | return; |
| 782 | } |
| 783 | if (resolveVendorFromCandidate(normalizedCandidate)) { |
| 784 | return; |
| 785 | } |
| 786 | if (!cleaned) return; |
| 787 | |
| 788 | const variants = new Set<string>(); |
| 789 | variants.add(normalizedCandidate); |
| 790 | variants.add(cleaned); |
| 791 | |
| 792 | const normalized = path.posix.normalize(cleaned); |
| 793 | variants.add(normalized); |
| 794 | |
| 795 | const withSlash = normalized.startsWith('/') ? normalized : `/${normalized}`; |
| 796 | variants.add(withSlash); |
| 797 | |
| 798 | const withoutExt = withSlash.replace(/\.(ts|js|mjs|tsx|jsx)$/i, ''); |
| 799 | variants.add(withoutExt); |
| 800 | variants.add(`${withoutExt}.js`); |
| 801 | variants.add(`${withoutExt}.mjs`); |
| 802 | variants.add(`${withoutExt}.ts`); |
| 803 | |
| 804 | for (const variant of variants) { |
| 805 | depFileMap.set(variant, fileName); |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | function findDependencyFileName(depFileMap: Map<string, string>, key: string): string | undefined { |
| 810 | const variants = new Set<string>(); |
nothing calls this directly
no test coverage detected