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

Function getDefaultValueForOption

test/fixtures/snapshot/typescript.js:42304–42323  ·  view source on GitHub ↗
(option)

Source from the content-addressed store, hash-verified

42302 }
42303 }
42304 function getDefaultValueForOption(option) {
42305 switch (option.type) {
42306 case "number":
42307 return 1;
42308 case "boolean":
42309 return true;
42310 case "string":
42311 var defaultValue = option.defaultValueDescription;
42312 return option.isFilePath ? "./".concat(defaultValue && typeof defaultValue === "string" ? defaultValue : "") : "";
42313 case "list":
42314 return [];
42315 case "object":
42316 return {};
42317 default:
42318 var iterResult = option.type.keys().next();
42319 if (!iterResult.done)
42320 return iterResult.value;
42321 return ts.Debug.fail("Expected 'option.type' to have entries.");
42322 }
42323 }
42324})(ts || (ts = {}));
42325var ts;
42326(function (ts) {

Callers 2

writeConfigurationsFunction · 0.85

Calls 4

concatMethod · 0.80
nextMethod · 0.65
keysMethod · 0.65
failMethod · 0.45

Tested by

no test coverage detected