MCPcopy
hub / github.com/angular/components / _validateNode

Method _validateNode

tools/tslint-rules/memberNamingRule.ts:91–104  ·  view source on GitHub ↗

* 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',
  )

Source from the content-addressed store, hash-verified

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(

Callers 2

_validateMemberMethod · 0.95

Calls 1

getTextMethod · 0.45

Tested by

no test coverage detected