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

Function createSingleLineStringWriter

test/fixtures/snapshot/typescript.js:14313–14349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14311 ts.isTransientSymbol = isTransientSymbol;
14312 var stringWriter = createSingleLineStringWriter();
14313 function createSingleLineStringWriter() {
14314 var str = "";
14315 var writeText = function (text) { return str += text; };
14316 return {
14317 getText: function () { return str; },
14318 write: writeText,
14319 rawWrite: writeText,
14320 writeKeyword: writeText,
14321 writeOperator: writeText,
14322 writePunctuation: writeText,
14323 writeSpace: writeText,
14324 writeStringLiteral: writeText,
14325 writeLiteral: writeText,
14326 writeParameter: writeText,
14327 writeProperty: writeText,
14328 writeSymbol: function (s, _) { return writeText(s); },
14329 writeTrailingSemicolon: writeText,
14330 writeComment: writeText,
14331 getTextPos: function () { return str.length; },
14332 getLine: function () { return 0; },
14333 getColumn: function () { return 0; },
14334 getIndent: function () { return 0; },
14335 isAtStartOfLine: function () { return false; },
14336 hasTrailingComment: function () { return false; },
14337 hasTrailingWhitespace: function () { return !!str.length && ts.isWhiteSpaceLike(str.charCodeAt(str.length - 1)); },
14338 // Completely ignore indentation for string writers. And map newlines to
14339 // a single space.
14340 writeLine: function () { return str += " "; },
14341 increaseIndent: ts.noop,
14342 decreaseIndent: ts.noop,
14343 clear: function () { return str = ""; },
14344 trackSymbol: function () { return false; },
14345 reportInaccessibleThisError: ts.noop,
14346 reportInaccessibleUniqueSymbolError: ts.noop,
14347 reportPrivateInBaseOfClassExpression: ts.noop,
14348 };
14349 }
14350 function changesAffectModuleResolution(oldOptions, newOptions) {
14351 return oldOptions.configFilePath !== newOptions.configFilePath ||
14352 optionsHaveModuleResolutionChanges(oldOptions, newOptions);

Callers 1

typescript.jsFile · 0.85

Calls 1

writeTextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…