MCPcopy Index your code
hub / github.com/nodejs/node / canUseOriginalText

Function canUseOriginalText

test/fixtures/snapshot/typescript.js:14953–14961  ·  view source on GitHub ↗
(node, flags)

Source from the content-addressed store, hash-verified

14951 }
14952 ts.getLiteralText = getLiteralText;
14953 function canUseOriginalText(node, flags) {
14954 if (nodeIsSynthesized(node) || !node.parent || (flags & 4 /* GetLiteralTextFlags.TerminateUnterminatedLiterals */ && node.isUnterminated)) {
14955 return false;
14956 }
14957 if (ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* TokenFlags.ContainsSeparator */) {
14958 return !!(flags & 8 /* GetLiteralTextFlags.AllowNumericSeparator */);
14959 }
14960 return !ts.isBigIntLiteral(node);
14961 }
14962 function getTextOfConstantValue(value) {
14963 return ts.isString(value) ? '"' + escapeNonAsciiString(value) + '"' : "" + value;
14964 }

Callers 1

getLiteralTextFunction · 0.85

Calls 1

nodeIsSynthesizedFunction · 0.85

Tested by

no test coverage detected