The keyword that declares a routine (`function`, `procedure`, `constructor`, …), lowercased, or null.
(routine: Node, context: ResolutionContext)
| 1259 | |
| 1260 | /** The keyword that declares a routine (`function`, `procedure`, `constructor`, …), lowercased, or null. */ |
| 1261 | function routineKeyword(routine: Node, context: ResolutionContext): string | null { |
| 1262 | const memo = memos(context).keywords; |
| 1263 | const hit = memo.get(routine.id); |
| 1264 | if (hit !== undefined) return hit; |
| 1265 | const line = fileLines(routine.filePath, context)[routine.startLine - 1] ?? ''; |
| 1266 | const keyword = /\b(function|procedure|constructor|destructor|operator)\s/i.exec(line)?.[1]!.toLowerCase() ?? null; |
| 1267 | memo.set(routine.id, keyword); |
| 1268 | return keyword; |
| 1269 | } |
no test coverage detected