routie dev init since i didn't adhere to any proper guidance up until now
This commit is contained in:
Generated
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
import { RegexOption } from '../../types/common-options.js'
|
||||
/**
|
||||
* Checks if all node names match the specified pattern.
|
||||
*
|
||||
* @param params - The parameters object.
|
||||
* @param params.allNamesMatchPattern - The pattern to match against all node
|
||||
* names.
|
||||
* @param params.nodeNames - Array of node names to test against patterns.
|
||||
* @returns True if all node names match the specified pattern, or if no pattern
|
||||
* is specified; otherwise, false.
|
||||
*/
|
||||
export declare function passesAllNamesMatchPatternFilter({
|
||||
allNamesMatchPattern,
|
||||
nodeNames,
|
||||
}: {
|
||||
allNamesMatchPattern?: RegexOption
|
||||
nodeNames: string[]
|
||||
}): boolean
|
||||
Generated
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
import { matches } from '../matches.js'
|
||||
/**
|
||||
* Checks if all node names match the specified pattern.
|
||||
*
|
||||
* @param params - The parameters object.
|
||||
* @param params.allNamesMatchPattern - The pattern to match against all node
|
||||
* names.
|
||||
* @param params.nodeNames - Array of node names to test against patterns.
|
||||
* @returns True if all node names match the specified pattern, or if no pattern
|
||||
* is specified; otherwise, false.
|
||||
*/
|
||||
function passesAllNamesMatchPatternFilter({ allNamesMatchPattern, nodeNames }) {
|
||||
if (!allNamesMatchPattern) {
|
||||
return true
|
||||
}
|
||||
return nodeNames.every(nodeName => matches(nodeName, allNamesMatchPattern))
|
||||
}
|
||||
export { passesAllNamesMatchPatternFilter }
|
||||
Generated
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Checks if the given AST selector matches the expected AST selector.
|
||||
*
|
||||
* @param params - The parameters object.
|
||||
* @param params.matchesAstSelector - The AST selector to match against, or
|
||||
* undefined if no selector is specified.
|
||||
* @param params.matchedAstSelectors - The matched AST selectors for a node.
|
||||
* @returns True if the given AST selector matches the expected AST selector, or
|
||||
* if no selector is specified; otherwise, false.
|
||||
*/
|
||||
export declare function passesAstSelectorFilter({
|
||||
matchedAstSelectors,
|
||||
matchesAstSelector,
|
||||
}: {
|
||||
matchedAstSelectors: ReadonlySet<string>
|
||||
matchesAstSelector: undefined | string
|
||||
}): boolean
|
||||
Generated
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Checks if the given AST selector matches the expected AST selector.
|
||||
*
|
||||
* @param params - The parameters object.
|
||||
* @param params.matchesAstSelector - The AST selector to match against, or
|
||||
* undefined if no selector is specified.
|
||||
* @param params.matchedAstSelectors - The matched AST selectors for a node.
|
||||
* @returns True if the given AST selector matches the expected AST selector, or
|
||||
* if no selector is specified; otherwise, false.
|
||||
*/
|
||||
function passesAstSelectorFilter({ matchedAstSelectors, matchesAstSelector }) {
|
||||
if (!matchesAstSelector) {
|
||||
return true
|
||||
}
|
||||
return matchedAstSelectors.has(matchesAstSelector)
|
||||
}
|
||||
export { passesAstSelectorFilter }
|
||||
Reference in New Issue
Block a user