Module: common

Methods

(static) makeRegExpParameter(text) → (nullable) {RegExp}

Make a regular expression from a text argument.

If it can be parsed as a regular expression, parse it and the flags.

Parameters:
Name Type Description
text string

the text argument.

Source:
Returns:

a RegExp object or null in case of error.

Type
RegExp

(package, static) qualifySelector(selector, qualifier) → {string}

Qualifies a CSS selector with a qualifier, which may be another CSS selector or an empty string. For example, given the selector "div.bar" and the qualifier "#foo", this function returns "div#foo.bar".

Parameters:
Name Type Description
selector string

The selector to qualify.

qualifier string

The qualifier with which to qualify the selector.

Source:
Returns:

The qualified selector.

Type
string

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

Converts raw text into a regular expression string

Parameters:
Name Type Description
text string

the string to convert

Source:
Returns:

regular expression representation of the text

Type
string