Module: patterns

Classes

Pattern
CompiledPatterns

Members

(inner) allKeywordsRegExp :RegExp

Regular expression for matching all keywords in a filter.

Type:
  • RegExp
Source:

(inner, constant) COMPILE_PATTERNS_MAX :number

The maximum number of patterns that compilePatterns() will compile into regular expressions.

Type:
  • number
Source:

(inner) extendedAnchorRegExp :RegExp

Regular expression used to match the || prefix in an otherwise literal pattern.

Type:
  • RegExp
Source:

(inner) keywordRegExp :RegExp

Regular expression for matching a keyword in a filter.

Type:
  • RegExp
Source:

(inner) separatorRegExp :RegExp

Regular expression used to match the ^ suffix in an otherwise literal pattern.

Type:
  • RegExp
Source:

Methods

(package, static) compilePatterns(filters) → (nullable) {module:patterns~CompiledPatterns}

Compiles patterns from the given filters into a single CompiledPatterns object.

Parameters:
Name Type Description
filters module:filterClasses.URLFilter | Set.<module:filterClasses.URLFilter>

The filters. If the number of filters exceeds COMPILE_PATTERNS_MAX, the function returns null.

Source:
Returns:
Type
module:patterns~CompiledPatterns

(package, static) filterToRegExp(text) → {string}

Converts filter text into regular expression string

Parameters:
Name Type Description
text string

as in Filter()

Source:
Returns:

regular expression representation of filter text

Type
string