Skip to content

Commit

Permalink
refactor(validate/matchers): renames some internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sverweij committed Nov 17, 2024
1 parent 8d29df3 commit 9b9ea4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/validate/matchers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,34 @@ export function matchesModulePathNot(pRule, pModule) {
);
}

function _toPath(pRule, pString, pGroups = []) {
function _matchesToPath(pRule, pString, pGroups = []) {
return Boolean(
!pRule.to.path ||
pString.match(replaceGroupPlaceholders(pRule.to.path, pGroups)),
);
}

export function matchesToPath(pRule, pDependency, pGroups) {
return _toPath(pRule, pDependency.resolved, pGroups);
return _matchesToPath(pRule, pDependency.resolved, pGroups);
}

export function matchToModulePath(pRule, pModule, pGroups) {
return _toPath(pRule, pModule.source, pGroups);
return _matchesToPath(pRule, pModule.source, pGroups);
}

function _toPathNot(pRule, pString, pGroups = []) {
function _matchesToPathNot(pRule, pString, pGroups = []) {
return (
!Boolean(pRule.to.pathNot) ||
!pString.match(replaceGroupPlaceholders(pRule.to.pathNot, pGroups))
);
}

export function matchesToPathNot(pRule, pDependency, pGroups) {
return _toPathNot(pRule, pDependency.resolved, pGroups);
return _matchesToPathNot(pRule, pDependency.resolved, pGroups);
}

export function matchToModulePathNot(pRule, pModule, pGroups) {
return _toPathNot(pRule, pModule.source, pGroups);
return _matchesToPathNot(pRule, pModule.source, pGroups);
}

export function matchesToDependencyTypes(pRule, pDependency) {
Expand Down

0 comments on commit 9b9ea4d

Please sign in to comment.