MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / literalString

Function literalString

src/extraction/languages/cfscript.ts:25–28  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

23 * link.
24 */
25function literalString(node: SyntaxNode | null | undefined, source: string): string | null {
26 if (node?.type !== 'string' || node.namedChildren.some((c: SyntaxNode) => c.type !== 'string_fragment')) return null;
27 return getNodeText(node, source).replace(/^["']|["']$/g, '').trim() || null;
28}
29
30/** The value of a `template=…` argument or attribute, when it is a literal string. */
31function templateArgument(node: SyntaxNode, source: string): string | null {

Callers 4

templateArgumentFunction · 0.85
cfIncludeCallTemplateFunction · 0.85
cfmlCreatedComponentFunction · 0.85
cfscript.tsFile · 0.85

Calls 1

getNodeTextFunction · 0.90

Tested by

no test coverage detected