A module providing common utilites for sniffers
- Source:
Classes
Methods
-
<inner> define(factory)
-
Override AMD `define` function for RequireJS
Parameters:
Name Type Description factory
function - Source:
-
<inner> matchesFor(ruleProp, type) → {boolean}
-
Check if a given type matches defined set or set is not defined
Parameters:
Name Type Description ruleProp
Object `rule.exceptions.firstArg`.for type
string node type - Source:
Returns:
- Type
- boolean
-
<inner> sniffExcerpt(lToken, rToken, expected, errorCode, where)
-
Report to the mediator if the fragment between lPos and rPos doesn't match expected if it's not multiline
Parameters:
Name Type Argument Default Description lToken
number rToken
number expected
number errorCode
string where
string <optional>
'' - Source:
-
<inner> validateRule(rule, prop, type, isRequired)
-
Throw exception if the rule is invalid (TypeError)
Parameters:
Name Type Description rule
object prop
string type
string isRequired
boolean - Source: