The class a property holds in `file`: by its own name, or by the alias a load there gave it.
(property: string, file: string, context: ResolutionContext)
| 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 { |
| 270 | const table = classTable(context); |
| 271 | const alias = table.loadable.has(property.toLowerCase()) ? undefined : aliasesIn(file, table, context).get(property); |
| 272 | const classes = table.loadable.get(alias ?? property.toLowerCase()); |
| 273 | if (!classes) return null; |
| 274 | if (classes.length === 1) return classes[0]!; |
| 275 | // One name in two HMVC modules: the caller's own, and no guess past that. |
| 276 | const module = MODULE_OF.exec(file)?.[1]; |
| 277 | const own = module ? classes.filter((c) => MODULE_OF.exec(c.filePath)?.[1] === module) : []; |
| 278 | return own.length === 1 ? own[0]! : null; |
| 279 | } |
| 280 | |
| 281 | export const codeigniterResolver: FrameworkResolver = { |
| 282 | name: 'codeigniter', |