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

Function shouldAddParamTypesMetadata

test/fixtures/snapshot/typescript.js:92708–92719  ·  view source on GitHub ↗

* Determines whether to emit the "design:paramtypes" metadata based on the node's kind. * The caller should have already tested whether the node has decorators and whether the * emitDecoratorMetadata compiler option is set. * * @param node The node to test.

(node)

Source from the content-addressed store, hash-verified

92706 * @param node The node to test.
92707 */
92708 function shouldAddParamTypesMetadata(node) {
92709 switch (node.kind) {
92710 case 257 /* SyntaxKind.ClassDeclaration */:
92711 case 226 /* SyntaxKind.ClassExpression */:
92712 return ts.getFirstConstructorWithBody(node) !== undefined;
92713 case 169 /* SyntaxKind.MethodDeclaration */:
92714 case 172 /* SyntaxKind.GetAccessor */:
92715 case 173 /* SyntaxKind.SetAccessor */:
92716 return true;
92717 }
92718 return false;
92719 }
92720 function getAccessorTypeNode(node) {
92721 var accessors = resolver.getAllAccessorDeclarations(node);
92722 return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)

Callers 2

addOldTypeMetadataFunction · 0.85
addNewTypeMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…