MCPcopy Create free account
hub / github.com/nodejs/node / emitJSDoc

Function emitJSDoc

test/fixtures/snapshot/typescript.js:113310–113337  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

113308 // JSDoc
113309 //
113310 function emitJSDoc(node) {
113311 write("/**");
113312 if (node.comment) {
113313 var text = ts.getTextOfJSDocComment(node.comment);
113314 if (text) {
113315 var lines = text.split(/\r\n?|\n/g);
113316 for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {
113317 var line = lines_2[_a];
113318 writeLine();
113319 writeSpace();
113320 writePunctuation("*");
113321 writeSpace();
113322 write(line);
113323 }
113324 }
113325 }
113326 if (node.tags) {
113327 if (node.tags.length === 1 && node.tags[0].kind === 343 /* SyntaxKind.JSDocTypeTag */ && !node.comment) {
113328 writeSpace();
113329 emit(node.tags[0]);
113330 }
113331 else {
113332 emitList(node, node.tags, 33 /* ListFormat.JSDocComment */);
113333 }
113334 }
113335 writeSpace();
113336 write("*/");
113337 }
113338 function emitJSDocSimpleTypedTag(tag) {
113339 emitJSDocTagName(tag.tagName);
113340 emitJSDocTypeExpression(tag.typeExpression);

Callers 1

Calls 7

writeSpaceFunction · 0.85
writePunctuationFunction · 0.85
emitListFunction · 0.85
writeFunction · 0.70
writeLineFunction · 0.70
emitFunction · 0.70
splitMethod · 0.45

Tested by

no test coverage detected