MCPcopy
hub / github.com/angular/angular / matches

Function matches

packages/service-worker/config/src/generator.ts:165–173  ·  view source on GitHub ↗
(file: string, patterns: {positive: boolean; regex: RegExp}[])

Source from the content-addressed store, hash-verified

163}
164
165function matches(file: string, patterns: {positive: boolean; regex: RegExp}[]): boolean {
166 return patterns.reduce((isMatch, pattern) => {
167 if (pattern.positive) {
168 return isMatch || pattern.regex.test(file);
169 } else {
170 return isMatch && !pattern.regex.test(file);
171 }
172 }, false);
173}
174
175function urlToRegex(url: string, baseHref: string, literalQuestionMark?: boolean): string {
176 if (!url.startsWith('/') && url.indexOf('://') === -1) {

Callers 1

globListToMatcherFunction · 0.70

Calls 2

reduceMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…