* Validates that a node matches the pattern for the corresponding modifier. * @param node Node to be validated. * @param modifier Modifier to validate against.
(
node: ts.Node & {name: ts.PropertyName | ts.BindingName},
modifier: 'public' | 'private' | 'protected',
)
| 89 | * @param modifier Modifier to validate against. |
| 90 | */ |
| 91 | private _validateNode( |
| 92 | node: ts.Node & {name: ts.PropertyName | ts.BindingName}, |
| 93 | modifier: 'public' | 'private' | 'protected', |
| 94 | ) { |
| 95 | const pattern = this._config[modifier]; |
| 96 | |
| 97 | if (pattern) { |
| 98 | const failureMessage = `${modifier} modifier name has to match the pattern ${pattern}`; |
| 99 | |
| 100 | if (!pattern.test(node.name.getText())) { |
| 101 | this.addFailureAtNode(node.name, failureMessage); |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | /** Checks if a node has a specific modifier. */ |
| 107 | private _hasModifier( |
no test coverage detected