(file: string, table: ClassTable, context: ResolutionContext)
| 252 | } |
| 253 | |
| 254 | function aliasesIn(file: string, table: ClassTable, context: ResolutionContext): Map<string, string> { |
| 255 | const known = table.aliases.get(file); |
| 256 | if (known) return known; |
| 257 | const aliases = new Map<string, string>(); |
| 258 | const source = context.readFile(file) ?? ''; |
| 259 | for (const re of [MODEL_ALIAS_RE, LIBRARY_ALIAS_RE]) { |
| 260 | re.lastIndex = 0; |
| 261 | let m: RegExpExecArray | null; |
| 262 | while ((m = re.exec(source)) !== null) aliases.set(m[2]!, m[1]!.split('/').pop()!.toLowerCase()); |
| 263 | } |
| 264 | table.aliases.set(file, aliases); |
| 265 | return aliases; |
| 266 | } |
| 267 | |
| 268 | /** The class a property holds in `file`: by its own name, or by the alias a load there gave it. */ |
| 269 | function propertyClass(property: string, file: string, context: ResolutionContext): Node | null { |
no test coverage detected