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

Function getRegularExpressionForWildcard

test/fixtures/snapshot/typescript.js:20527–20536  ·  view source on GitHub ↗
(specs, basePath, usage)

Source from the content-addressed store, hash-verified

20525 exclude: excludeMatcher
20526 };
20527 function getRegularExpressionForWildcard(specs, basePath, usage) {
20528 var patterns = getRegularExpressionsForWildcards(specs, basePath, usage);
20529 if (!patterns || !patterns.length) {
20530 return undefined;
20531 }
20532 var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
20533 // If excluding, match "foo/bar/baz...", but if including, only allow "foo".
20534 var terminator = usage === "exclude" ? "($|/)" : "$";
20535 return "^(".concat(pattern, ")").concat(terminator);
20536 }
20537 ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
20538 function getRegularExpressionsForWildcards(specs, basePath, usage) {
20539 if (specs === undefined || specs.length === 0) {

Callers 1

getFileMatcherPatternsFunction · 0.85

Calls 4

concatMethod · 0.80
mapMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected