The value of a `template=…` argument or attribute, when it is a literal string.
(node: SyntaxNode, source: string)
| 30 | |
| 31 | /** The value of a `template=…` argument or attribute, when it is a literal string. */ |
| 32 | function templateArgument(node: SyntaxNode, source: string): string | null { |
| 33 | if (node.type !== 'assignment_expression') return null; |
| 34 | const left = getChildByField(node, 'left'); |
| 35 | if (left?.type !== 'identifier' || getNodeText(left, source).toLowerCase() !== 'template') return null; |
| 36 | return literalString(getChildByField(node, 'right'), source); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Whether a call is `cfinclude(…)` — the function form of `include` and of |
no test coverage detected