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

Function getTrailingWhitespaceStartPosition

test/fixtures/snapshot/typescript.js:147842–147851  ·  view source on GitHub ↗

* @param start The position of the first character in range * @param end The position of the last character in range

(start, end)

Source from the content-addressed store, hash-verified

147840 * @param end The position of the last character in range
147841 */
147842 function getTrailingWhitespaceStartPosition(start, end) {
147843 var pos = end;
147844 while (pos >= start && ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) {
147845 pos--;
147846 }
147847 if (pos !== end) {
147848 return pos + 1;
147849 }
147850 return -1;
147851 }
147852 /**
147853 * Trimming will be done for lines after the previous range.
147854 * Exclude comments as they had been previously processed.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected