Condition

Condition

Condition is used to check if the node matches, condition won’t change the node scope.

Constructor

new Condition(instance, nqlOrRules, options, func, elseFunc)

Create a Condition
Source:
Parameters:
Name Type Description
instance Instance
nqlOrRules string | Object nql or rules to find nodes
options ConditionOptions to do find in specific child node, e.g. `{ in: 'callee' }`
func function a function to be called if nql or rules are matched.
elseFunc function a function to be called if nql or rules are not matched.

Methods

processSync()

If condition matches, run the func.
Source: