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

Function literalString

src/extraction/languages/cfscript.ts:26–29  ·  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

24 * link.
25 */
26function 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. */
32function 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