Methods
(inner) asList(input) → {List}
Accepts an Array, List or null and returns an equivalent List. Passing in null will return an empty List.
Parameters:
Name | Type | Description |
---|---|---|
input |
Array | List | null | The input to be convert to a List. List items will pass through unchanged, all others will be passed into a List constructor. |
Returns:
The equivalent List.
- Type
- List
(inner) isLeaf(node, childPathopt) → {boolean}
Accepts a node and returns a boolean indicating if the node is a leaf node (i.e. it has no children).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
node |
* | The node to check. | ||
childPath |
Array | List |
<optional> |
null
|
An {Array} or {List} of the key path to each node's children. |
Returns:
A boolean indicating if the node is a leaf node.
- Type
- boolean
(inner) keysToPath(keys, childPathopt) → {List}
Turns a node's keys and its childPath into a full path.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
keys |
Array | List | An {Array} or {List} of keys used to identify a node. | ||
childPath |
Array | List |
<optional> |
null
|
An {Array} or {List} of the key path to each node's children. |
Returns:
- Type
- List
(inner) keysToPathChildren(keys, childPathopt) → {List}
Turns a node's keys and its childPath into a full path to the node's children.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
keys |
Array | List | An {Array} or {List} of keys used to identify a node. | ||
childPath |
Array | List |
<optional> |
null
|
An {Array} or {List} of the key path to each node's children. |
Returns:
- Type
- List