- LEAF :
Number
Type LEAF = 1
- BRANCH :
Number
Type BRANCH = 2
- CLOSE :
Number
Type CLOSE = 3
- isLeaf ⇒
Boolean
Test if node is LEAF
- isBranch ⇒
Boolean
Test if node is BRANCH
- isClose ⇒
Boolean
Test if node is CLOSE
- isLastChild ⇒
Boolean
Test if node is last child
- isFirstChild ⇒
Boolean
Test if node is first child
- isEmptyBranch ⇒
Boolean
Test if node is empty branch
- link ⇒
Object
|void
Retrieve the branch's closer, or the closer's branch
- create([props], [type]) ⇒
Object
Create a leaf node (branches and closes are created by the implementation).
The following keys are reserved for formatting an object as a node:
Key Purpose $0 Type $1 Depth-first travsersal $2 Reversed depth-first Traversal $3 BRANCH-to-CLOSE link - next(node) ⇒
Object
|void
Get the node's next node in depth-first traversal
- previous(node) ⇒
Object
|void
Get the node's previous node in depth-first traversal
- nextSibling(node) ⇒
Object
|void
Get the node's nextSibling
- previousSibling(node) ⇒
Object
|void
Get the node's previousSibling
- traverse(node)
Traverse node
- firstChild(node) ⇒
Object
|void
Get the node's firstChild
- lastChild(node) ⇒
Object
|void
Get the node's lastChild
- appendChild(node, ref) ⇒
Object
append child to node (promotes LEAF to BRANCH if needed)
- insertBefore(node, ref) ⇒
Object
insert node before ref (sibling)
- insertAfter(node, ref) ⇒
Object
insert node after ref (sibling)
- removeChild(node, ref) ⇒
Object
remove child from node
- remove(node) ⇒
Object
remove node from its parent
- openBefore(props, ref, [lastSib]) ⇒
Object
Create a new branch before a node and add all its siblings up to lastSibling
Type LEAF = 1
Type BRANCH = 2
Type CLOSE = 3
Test if node is LEAF
Kind: global constant
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Test if node is BRANCH
Kind: global constant
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Test if node is CLOSE
Kind: global constant
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Test if node is last child
Kind: global constant
Returns: Boolean
- The inserted node
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Test if node is first child
Kind: global constant
Returns: Boolean
- The inserted node
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Test if node is empty branch
Kind: global constant
Returns: Boolean
- The inserted node
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Retrieve the branch's closer, or the closer's branch
Kind: global constant
Returns: Object
| void
- Node-formatted object (if any)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Create a leaf node (branches and closes are created by the implementation).
The following keys are reserved for formatting an object as a node:
Key | Purpose |
---|---|
$0 | Type |
$1 | Depth-first travsersal |
$2 | Reversed depth-first Traversal |
$3 | BRANCH-to-CLOSE link |
Kind: global function
Returns: Object
- node-formatted object
Param | Type | Default | Description |
---|---|---|---|
[props] | Object |
{} |
initial object |
[type] | Number |
LEAF |
node type |
Get the node's next node in depth-first traversal
Kind: global function
Returns: Object
| void
- Node (if have)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Get the node's previous node in depth-first traversal
Kind: global function
Returns: Object
| void
- Node (if have)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Get the node's nextSibling
Kind: global function
Returns: Object
| void
- Node (if have)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Get the node's previousSibling
Kind: global function
Returns: Object
| void
- Node (if have)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Traverse node
Kind: global function
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Get the node's firstChild
Kind: global function
Returns: Object
| void
- Node (if have)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Get the node's lastChild
Kind: global function
Returns: Object
| void
- Node (if have)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
append child to node (promotes LEAF to BRANCH if needed)
Kind: global function
Returns: Object
- The appended child
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
ref | Object |
Node-formatted object |
insert node before ref (sibling)
Kind: global function
Returns: Object
- The inserted node
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
ref | Object |
Node-formatted object |
insert node after ref (sibling)
Kind: global function
Returns: Object
- The inserted node
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
ref | Object |
Node-formatted object |
remove child from node
Kind: global function
Returns: Object
- The provided branch node
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
ref | Object |
Node-formatted object |
remove node from its parent
Kind: global function
Returns: Object
- The removed node-formatted object (for reuse)
Param | Type | Description |
---|---|---|
node | Object |
Node-formatted object |
Create a new branch before a node and add all its siblings up to lastSibling
Kind: global function
Returns: Object
- The new branch
Param | Type | Description |
---|---|---|
props | Object |
Initial object |
ref | Object |
Reference node |
[lastSib] | Object |
The last sibling to add to the branch |