* A string literal's text when it is written out in full, or null when a * `#…#` expression builds it at runtime (`"#dir#/x.cfm"`, `"#dir#.Batch"`): * such a path names no file, and such a name no component, the index can * link.
(node: SyntaxNode | null | undefined, source: string)
| 24 | * link. |
| 25 | */ |
| 26 | function literalString(node: SyntaxNode | null | undefined, source: string): string | null { |
| 27 | if (node?.type !== 'string' || node.namedChildren.some((c: SyntaxNode) => c.type !== 'string_fragment')) return null; |
| 28 | return getNodeText(node, source).replace(/^["']|["']$/g, '').trim() || null; |
| 29 | } |
| 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 { |
no test coverage detected