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

Function convertJsonOptionOfCustomType

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

Source from the content-addressed store, hash-verified

41938 return undefined;
41939 }
41940 function convertJsonOptionOfCustomType(opt, value, errors) {
41941 if (isNullOrUndefined(value))
41942 return undefined;
41943 var key = value.toLowerCase();
41944 var val = opt.type.get(key);
41945 if (val !== undefined) {
41946 return validateJsonOptionValue(opt, val, errors);
41947 }
41948 else {
41949 errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
41950 }
41951 }
41952 function convertJsonOptionOfListType(option, values, basePath, errors) {
41953 return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return option.listPreserveFalsyValues ? true : !!v; });
41954 }

Callers 2

parseCustomTypeOptionFunction · 0.85
convertJsonOptionFunction · 0.85

Calls 5

isNullOrUndefinedFunction · 0.85
validateJsonOptionValueFunction · 0.85
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected