| 91 | } |
| 92 | |
| 93 | export function isWithinKeyValue(position: number, node: NodeWithKeyAndValue): boolean { |
| 94 | let {keySpan, valueSpan} = node; |
| 95 | if (valueSpan === undefined && node instanceof TmplAstBoundEvent) { |
| 96 | valueSpan = node.handlerSpan; |
| 97 | } |
| 98 | const isWithinKeyValue = |
| 99 | isWithin(position, keySpan) || !!(valueSpan && isWithin(position, valueSpan)); |
| 100 | return isWithinKeyValue; |
| 101 | } |
| 102 | |
| 103 | export function isTemplateNode(node: TmplAstNode | AST): node is TmplAstNode { |
| 104 | // Template node implements the Node interface so we cannot use instanceof. |