Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const commentKind = getCommentKind();
if (commentKind != null) {
const comment = parseForComment(commentKind);
if (comment.kind === SyntaxKind.SingleLineCommentTrivia)
return;
else
lineEnd = StringUtils.getLineEndFromPos(sourceFileText, pos);
}
// skip any trailing comments too
else if (!StringUtils.isWhitespace(sourceFileText[pos]) && sourceFileText[pos] !== ",")
return;
else
pos++;
}
while (StringUtils.startsWithNewLine(sourceFileText[pos]))
pos++;
}
function getText(tagPrinter: JSDocTagStructurePrinter) {
if (typeof structure === "string")
return structure;
const tempWriter = tagPrinter.getNewWriter(writer);
if (typeof structure === "function")
structure(tempWriter);
else {
if (structure.text)
printTextFromStringOrWriter(tempWriter, structure.text);
const currentText = tempWriter.toString();
tempWriter.unsafeInsert(0, `@${structure.tagName}` + (currentText.length > 0 && !StringUtils.startsWithNewLine(currentText) ? " " : ""));
}
return tempWriter.toString();
}
}
function prependSeparator() {
if (!StringUtils.startsWithNewLine(newText))
newText = separator + newText;
}