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

Function validateSpecs

test/fixtures/snapshot/typescript.js:42112–42128  ·  view source on GitHub ↗
(specs, errors, disallowTrailingRecursion, jsonSourceFile, specKey)

Source from the content-addressed store, hash-verified

42110 return !ts.hasExtension(pathToCheck) && excludeRegex.test(ts.ensureTrailingDirectorySeparator(pathToCheck));
42111 }
42112 function validateSpecs(specs, errors, disallowTrailingRecursion, jsonSourceFile, specKey) {
42113 return specs.filter(function (spec) {
42114 if (!ts.isString(spec))
42115 return false;
42116 var diag = specToDiagnostic(spec, disallowTrailingRecursion);
42117 if (diag !== undefined) {
42118 errors.push(createDiagnostic.apply(void 0, diag));
42119 }
42120 return diag === undefined;
42121 });
42122 function createDiagnostic(message, spec) {
42123 var element = ts.getTsConfigPropArrayElementValue(jsonSourceFile, specKey, spec);
42124 return element ?
42125 ts.createDiagnosticForNodeInSourceFile(jsonSourceFile, element, message, spec) :
42126 ts.createCompilerDiagnostic(message, spec);
42127 }
42128 }
42129 function specToDiagnostic(spec, disallowTrailingRecursion) {
42130 if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
42131 return [ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];

Callers 1

getConfigFileSpecsFunction · 0.85

Calls 4

specToDiagnosticFunction · 0.85
filterMethod · 0.65
pushMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected