The element a binding at `at` is written on: the last opening tag before it.
(text: string, at: number)
| 160 | |
| 161 | /** The element a binding at `at` is written on: the last opening tag before it. */ |
| 162 | function elementAt(text: string, at: number): string | null { |
| 163 | const open = text.lastIndexOf('<', at); |
| 164 | if (open < 0) return null; |
| 165 | const tag = /^<([a-zA-Z][\w-]*)/.exec(text.slice(open, open + 64)); |
| 166 | return tag ? tag[1]! : null; |
| 167 | } |
| 168 | |
| 169 | /** A `routerLink:` field of an object literal written in a class. */ |
| 170 | const ROUTER_LINK_FIELD = /(?<![\w$.])routerLink\s*:\s*/g; |
no test coverage detected