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

Function serializeTypeOfNode

test/fixtures/snapshot/typescript.js:92730–92745  ·  view source on GitHub ↗

* Serializes the type of a node for use with decorator type metadata. * * @param node The node that should have its type serialized.

(node)

Source from the content-addressed store, hash-verified

92728 * @param node The node that should have its type serialized.
92729 */
92730 function serializeTypeOfNode(node) {
92731 switch (node.kind) {
92732 case 167 /* SyntaxKind.PropertyDeclaration */:
92733 case 164 /* SyntaxKind.Parameter */:
92734 return serializeTypeNode(node.type);
92735 case 173 /* SyntaxKind.SetAccessor */:
92736 case 172 /* SyntaxKind.GetAccessor */:
92737 return serializeTypeNode(getAccessorTypeNode(node));
92738 case 257 /* SyntaxKind.ClassDeclaration */:
92739 case 226 /* SyntaxKind.ClassExpression */:
92740 case 169 /* SyntaxKind.MethodDeclaration */:
92741 return factory.createIdentifier("Function");
92742 default:
92743 return factory.createVoidZero();
92744 }
92745 }
92746 /**
92747 * Serializes the types of the parameters of a node for use with decorator type metadata.
92748 *

Callers 3

addOldTypeMetadataFunction · 0.85
addNewTypeMetadataFunction · 0.85

Calls 2

serializeTypeNodeFunction · 0.85
getAccessorTypeNodeFunction · 0.85

Tested by

no test coverage detected