WalkHelper
Tree walking helper
Functions
6
Functions
6Post-walks any hierarchical data structure
| Parameter | Type | Description |
|---|---|---|
data | Object | Walking starting point |
childrenFn | function | Function to return |
fn | function | Function to call on each entry |
Pre-/Post-walks any hierarchical data structure calling inFn each node when it walks in, and outFn when it walks out.
| Parameter | Type | Description |
|---|---|---|
data | Object | Walking starting point |
childrenFn | function | Function to return |
inFn | function | Function to call on each entry upon enter |
outFn | function | Function to call on each entry upon exit |
Pre-walks any hierarchical data structure
| Parameter | Type | Description |
|---|---|---|
data | Object | Walking starting point |
childrenFn | function | Function to return |
fn | function | Function to call on each entry |
Pre-walk unordered.
Like preWalk but doesn't reverse children before walk, thus children will be walked last child first - first child last
| Parameter | Type | Description |
|---|---|---|
data | Object | Walking starting point |
childrenFn | function | Function to return |
fn | function | Function to call on each entry |
Pre-walks any hierarchical data structure, passing along a link to the parent node
| Parameter | Type | Description |
|---|---|---|
data | Object | Walking starting point |
childrenFn | function | Function to return |
fn | function | Function to call on each entry, called with |
Pre-walks any hierarchical data structure while the passed fn returns true
| Parameter | Type | Description |
|---|---|---|
data | Object | Walking starting point |
childrenFn | function | Function to return |
fn | function | Function to call on each entry. If return false here, it aborts the walk. |
false if the walk was aborted.