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

Function shouldDumpNodeMember

compiler/companion/src/AST.ts:481–496  ·  view source on GitHub ↗
(nodeToDump: NodeToDump, memberNode: ts.TypeElement | ts.ClassElement)

Source from the content-addressed store, hash-verified

479 // Otherwise, only interested in symbols annotated with Valdi annotations
480 if (!nodeToDump.leadingComments) {
481 return false;
482 }
483 const comments = nodeToDump.leadingComments.text;
484 const hasMatch = hasNativeExportAnnotation(comments) || !!comments.match(/@Component|@ViewModel|@Context/g);
485
486 return hasMatch;
487}
488
489function shouldDumpNodeMember(nodeToDump: NodeToDump, memberNode: ts.TypeElement | ts.ClassElement): boolean {
490 const nodeComments = nodeToDump.leadingComments?.text;
491 if (!nodeComments) {
492 return false;
493 }
494
495 if (nodeComments.match(/@NativeTemplateElement/)) {
496 return false;
497 } else if (nodeComments.match(/@Component/)) {
498 return !!(getNodeComments(memberNode)?.text ?? '').match(/@Action|@ConstructorOmitted/g);
499 } else if (hasGenerateOrExportAnnotation(nodeComments)) {

Callers 1

dumpRootNodesFunction · 0.85

Calls 2

getNodeCommentsFunction · 0.90
matchMethod · 0.45

Tested by

no test coverage detected