MCPcopy Create free account
hub / github.com/Snapchat/Valdi / dumpVariable

Function dumpVariable

compiler/companion/src/AST.ts:777–790  ·  view source on GitHub ↗
(node: ts.VariableStatement, references: AST.TypeReferences)

Source from the content-addressed store, hash-verified

775}
776
777export function dumpVariable(node: ts.VariableStatement, references: AST.TypeReferences): AST.Variable {
778 if (node.declarationList.declarations.length !== 1) {
779 throw new Error('Only declaration of single variables are currently supported');
780 }
781
782 const declaration = node.declarationList.declarations[0];
783 return {
784 start: node.getStart(),
785 end: node.getEnd(),
786 name: getIdentifierString(declaration.name),
787 type: parseType(declaration.type, references),
788 leadingComments: getNodeComments(node),
789 };
790}
791
792export function dumpEnum(node: ts.EnumDeclaration): AST.Enum {
793 const members: AST.EnumMember[] = [];

Callers 1

dumpRootNodesFunction · 0.85

Calls 4

getNodeCommentsFunction · 0.90
getIdentifierStringFunction · 0.85
parseTypeFunction · 0.85
getEndMethod · 0.80

Tested by

no test coverage detected