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

Function getOptionValueWithEmptyStrings

test/fixtures/snapshot/typescript.js:42283–42303  ·  view source on GitHub ↗
(value, option)

Source from the content-addressed store, hash-verified

42281 }
42282 ts.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry;
42283 function getOptionValueWithEmptyStrings(value, option) {
42284 switch (option.type) {
42285 case "object": // "paths". Can't get any useful information from the value since we blank out strings, so just return "".
42286 return "";
42287 case "string": // Could be any arbitrary string -- use empty string instead.
42288 return "";
42289 case "number": // Allow numbers, but be sure to check it's actually a number.
42290 return typeof value === "number" ? value : "";
42291 case "boolean":
42292 return typeof value === "boolean" ? value : "";
42293 case "list":
42294 var elementType_1 = option.element;
42295 return ts.isArray(value) ? value.map(function (v) { return getOptionValueWithEmptyStrings(v, elementType_1); }) : "";
42296 default:
42297 return ts.forEachEntry(option.type, function (optionEnumValue, optionStringValue) {
42298 if (optionEnumValue === value) {
42299 return optionStringValue;
42300 }
42301 }); // TODO: GH#18217
42302 }
42303 }
42304 function getDefaultValueForOption(option) {
42305 switch (option.type) {
42306 case "number":

Callers 1

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected