1 | function filenameMatchesPattern(pFullPathToFile, pPattern) {
|
2 | return RegExp(pPattern, "g").test(pFullPathToFile);
|
3 | }
|
4 |
|
5 | function moduleMatchesFilter(pModule, pFilter) {
|
6 | return filenameMatchesPattern(pModule.source, pFilter.path);
|
7 | }
|
8 |
|
9 | function dependencyMatchesFilter(pDependency, pFilter) {
|
10 | return filenameMatchesPattern(pDependency.resolved, pFilter.path);
|
11 | }
|
12 |
|
13 | module.exports = {
|
14 | moduleMatchesFilter,
|
15 | dependencyMatchesFilter,
|
16 | filenameMatchesPattern,
|
17 | };
|