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

Function convertJsonOption

test/fixtures/snapshot/typescript.js:41889–41904  ·  view source on GitHub ↗
(opt, value, basePath, errors)

Source from the content-addressed store, hash-verified

41887 }
41888 /*@internal*/
41889 function convertJsonOption(opt, value, basePath, errors) {
41890 if (isCompilerOptionsValue(opt, value)) {
41891 var optType = opt.type;
41892 if (optType === "list" && ts.isArray(value)) {
41893 return convertJsonOptionOfListType(opt, value, basePath, errors);
41894 }
41895 else if (!ts.isString(optType)) {
41896 return convertJsonOptionOfCustomType(opt, value, errors);
41897 }
41898 var validatedValue = validateJsonOptionValue(opt, value, errors);
41899 return isNullOrUndefined(validatedValue) ? validatedValue : normalizeNonListOptionValue(opt, basePath, validatedValue);
41900 }
41901 else {
41902 errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, getCompilerOptionValueTypeString(opt)));
41903 }
41904 }
41905 ts.convertJsonOption = convertJsonOption;
41906 function normalizeOptionValue(option, basePath, value) {
41907 if (isNullOrUndefined(value))

Callers 3

convertOptionsFromJsonFunction · 0.85

Calls 8

isCompilerOptionsValueFunction · 0.85
validateJsonOptionValueFunction · 0.85
isNullOrUndefinedFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected