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

Function getCompilerOptionsDiffValue

test/fixtures/snapshot/typescript.js:41272–41296  ·  view source on GitHub ↗

* Generate a list of the compiler options whose value is not the default. * @param options compilerOptions to be evaluated. /** @internal

(options, newLine)

Source from the content-addressed store, hash-verified

41270 * @param options compilerOptions to be evaluated.
41271 /** @internal */
41272 function getCompilerOptionsDiffValue(options, newLine) {
41273 var compilerOptionsMap = getSerializedCompilerOption(options);
41274 return getOverwrittenDefaultOptions();
41275 function makePadding(paddingLength) {
41276 return Array(paddingLength + 1).join(" ");
41277 }
41278 function getOverwrittenDefaultOptions() {
41279 var result = [];
41280 var tab = makePadding(2);
41281 commandOptionsWithoutBuild.forEach(function (cmd) {
41282 if (!compilerOptionsMap.has(cmd.name)) {
41283 return;
41284 }
41285 var newValue = compilerOptionsMap.get(cmd.name);
41286 var defaultValue = getDefaultValueForOption(cmd);
41287 if (newValue !== defaultValue) {
41288 result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
41289 }
41290 else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
41291 result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
41292 }
41293 });
41294 return result.join(newLine) + newLine;
41295 }
41296 }
41297 ts.getCompilerOptionsDiffValue = getCompilerOptionsDiffValue;
41298 /**
41299 * Get the compiler options to be written into the tsconfig.json.

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected