Module: matcher

Classes

CombinedMatcher
Matcher

Members

(static) defaultMatcher :module:matcher.CombinedMatcher

Shared CombinedMatcher instance that should usually be used.

Type:
Source:

Methods

(static) isSlowFilter(filter) → {boolean}

Checks whether a particular filter is slow.

Parameters:
Name Type Description
filter module:filterClasses.URLFilter
Source:
Returns:
Type
boolean

(inner) addFilterByKeyword(filter, keyword, map)

Adds a filter by a given keyword to a map.

Parameters:
Name Type Description
filter module:filterClasses.URLFilter
keyword string
map Map.<string, (module:filterClasses.URLFilter|Array.<module:filterClasses.URLFilter>)>
Source:

(inner) countFilters(map, keyword) → {number}

Returns the amount of filters per map.

Parameters:
Name Type Description
map Map
keyword string
Source:
Returns:
Type
number

(inner) getFilters(map, keyword) → {Array.<module:filterClasses.URLFilter>}

Returns a list of filters, if any, or an empty list.

Parameters:
Name Type Description
map Map
keyword string
Source:
Returns:
Type
Array.<module:filterClasses.URLFilter>

(inner) isBadKeyword(keyword) → {boolean}

Checks if the keyword is bad for use.

Parameters:
Name Type Description
keyword string
Source:
Returns:
Type
boolean

(inner) matchFilter(filter, request, typeMask, sitekeyopt, nullable, collectionopt, nullable) → (nullable) {module:filterClasses.URLFilter}

Checks whether a filter matches a given URL request.

Parameters:
Name Type Attributes Description
filter module:filterClasses.URLFilter

The filter.

request module:url.URLRequest

The URL request.

typeMask number

A mask specifying the content type of the URL request.

sitekey string <optional>
<nullable>

An optional public key associated with the URL request.

collection Array <optional>
<nullable>

An optional list to which to append the filter if it matches. If omitted, the function directly returns the filter if it matches.

Source:
Returns:

The filter if it matches and collection is omitted; otherwise null.

Type
module:filterClasses.URLFilter

(inner) removeFilterByKeyword(filter, keyword, map)

Removes a filter by a given keyword from a map.

Parameters:
Name Type Description
filter module:filterClasses.URLFilter
keyword string
map Map.<string, (module:filterClasses.URLFilter|Array.<module:filterClasses.URLFilter>)>
Source:

Type Definitions

MatcherSearchResults

Type:
  • Object
Properties:
Name Type Attributes Description
blocking Array.<module:filterClasses.BlockingFilter> <optional>

List of blocking filters found.

allowing Array.<module:filterClasses.AllowingFilter> <optional>

List of allowing filters found.

Source: