Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function skipTrailingLine() {
// skip first line of the block as the comment there is likely to describe the header
if (pos === 0)
return;
let lineEnd = StringUtils.getLineEndFromPos(sourceFileText, pos);
while (pos < lineEnd) {
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 skipTrailingLine() {
// skip first line of the block as the comment there is likely to describe the header
if (pos === 0)
return;
let lineEnd = StringUtils.getLineEndFromPos(sourceFileText, pos);
while (pos < lineEnd) {
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++;
}