MCPcopy Create free account
hub / github.com/LambdaNote/support-ts-tapl / getIdentifier

Function getIdentifier

book/tiny-ts-parser.ts:525–528  ·  view source on GitHub ↗
(node: p.TSESTree.Expression | p.TSESTree.PrivateIdentifier | p.TSESTree.TSQualifiedName)

Source from the content-addressed store, hash-verified

523// Helper functions to get properties of estree nodes
524
525function getIdentifier(node: p.TSESTree.Expression | p.TSESTree.PrivateIdentifier | p.TSESTree.TSQualifiedName) {
526 if (node.type !== "Identifier") error("identifier expected", node);
527 return node.name;
528}
529
530function getLiteralString(node: p.TSESTree.Expression) {
531 if (node.type !== "Literal" || typeof node.value !== "string") error("", node);

Callers 5

getPropFunction · 0.70
getSwitchVarNameFunction · 0.70
convertTypeFunction · 0.70
convertExprFunction · 0.70
convertStmtFunction · 0.70

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected