WithinScope

WithinScope

WithinScope finds out nodes which match rules, then changes its scope to matching node.

Constructor

new WithinScope(instance, nqlOrRules, options, func)

Create a WithinScope
Source:
Parameters:
Name Type Description
instance Instance
nqlOrRules string | Object nql or rules to find nodes.
options QueryOptions
func function a function to be called if rules are matched.

Extends

Methods

processSync()

Find out the matching nodes. It checks the current node and iterates all child nodes, then run the function code on each matching node.
Source: