The keyword that declares a routine (`function`, `procedure`, `constructor`, …), lowercased, or null.
(routine: Node, context: ResolutionContext)
| 2795 | |
| 2796 | /** The keyword that declares a routine (`function`, `procedure`, `constructor`, …), lowercased, or null. */ |
| 2797 | function routineKeyword(routine: Node, context: ResolutionContext): string | null { |
| 2798 | const memo = memos(context).keywords; |
| 2799 | const hit = memo.get(routine.id); |
| 2800 | if (hit !== undefined) return hit; |
| 2801 | const line = fileLines(routine.filePath, context)[routine.startLine - 1] ?? ''; |
| 2802 | const keyword = /\b(function|procedure|constructor|destructor|operator)\s/i.exec(line)?.[1]!.toLowerCase() ?? null; |
| 2803 | memo.set(routine.id, keyword); |
| 2804 | return keyword; |
| 2805 | } |
no test coverage detected