literalText
import { isNoSubstitutionTemplateLiteral, isStringLiteral } from "typescript/ast"; import type { Node } from "typescript/ast"; export const literalText = (n: Node | undefined): string | undefined => n && (isStringLiteral(n) || isNoSubstitutionTemplateLiteral(n)) ? n.text : undefined