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

Function writeTrimmedCurrentLine

test/fixtures/snapshot/typescript.js:18847–18861  ·  view source on GitHub ↗
(text, commentEnd, writer, newLine, pos, nextLineStart)

Source from the content-addressed store, hash-verified

18845 }
18846 ts.writeCommentRange = writeCommentRange;
18847 function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) {
18848 var end = Math.min(commentEnd, nextLineStart - 1);
18849 var currentLineText = ts.trimString(text.substring(pos, end));
18850 if (currentLineText) {
18851 // trimmed forward and ending spaces text
18852 writer.writeComment(currentLineText);
18853 if (end !== commentEnd) {
18854 writer.writeLine();
18855 }
18856 }
18857 else {
18858 // Empty string - make sure we write empty line
18859 writer.rawWrite(newLine);
18860 }
18861 }
18862 function calculateIndent(text, pos, end) {
18863 var currentLineIndent = 0;
18864 for (; pos < end && ts.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) {

Callers 1

writeCommentRangeFunction · 0.85

Calls 1

minMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…