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

Function normalizeOptionValue

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

Source from the content-addressed store, hash-verified

41904 }
41905 ts.convertJsonOption = convertJsonOption;
41906 function normalizeOptionValue(option, basePath, value) {
41907 if (isNullOrUndefined(value))
41908 return undefined;
41909 if (option.type === "list") {
41910 var listOption_1 = option;
41911 if (listOption_1.element.isFilePath || !ts.isString(listOption_1.element.type)) {
41912 return ts.filter(ts.map(value, function (v) { return normalizeOptionValue(listOption_1.element, basePath, v); }), function (v) { return listOption_1.listPreserveFalsyValues ? true : !!v; });
41913 }
41914 return value;
41915 }
41916 else if (!ts.isString(option.type)) {
41917 return option.type.get(ts.isString(value) ? value.toLowerCase() : value);
41918 }
41919 return normalizeNonListOptionValue(option, basePath, value);
41920 }
41921 function normalizeNonListOptionValue(option, basePath, value) {
41922 if (option.isFilePath) {
41923 value = ts.getNormalizedAbsolutePath(value, basePath);

Callers 1

Calls 5

isNullOrUndefinedFunction · 0.85
filterMethod · 0.65
mapMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected