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

Function writeLineOrSpace

test/fixtures/snapshot/typescript.js:114064–114080  ·  view source on GitHub ↗
(parentNode, prevChildNode, nextChildNode)

Source from the content-addressed store, hash-verified

114062 return pos < 0 ? pos : pos + tokenString.length;
114063 }
114064 function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) {
114065 if (ts.getEmitFlags(parentNode) & 1 /* EmitFlags.SingleLine */) {
114066 writeSpace();
114067 }
114068 else if (preserveSourceNewlines) {
114069 var lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode);
114070 if (lines) {
114071 writeLine(lines);
114072 }
114073 else {
114074 writeSpace();
114075 }
114076 }
114077 else {
114078 writeLine();
114079 }
114080 }
114081 function writeLines(text) {
114082 var lines = text.split(/\r\n?|\n/g);
114083 var indentation = ts.guessIndentation(lines);

Callers 3

emitIfStatementFunction · 0.85
emitDoStatementFunction · 0.85
emitTryStatementFunction · 0.85

Calls 3

writeSpaceFunction · 0.85
getLinesBetweenNodesFunction · 0.85
writeLineFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…