Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
feat(node.js): add getter for parent node
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Mar 27, 2017
1 parent 62d9fc9 commit b834c46
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ class Node {
return this.get().name
}

/**
* Returns the parent node of this node
* @returns {Node}
*/
parent() {

return new Node(this.get().parent)
}

/**
* Returns or sets the attribute for the given key and value
* @param {string|Attribute} attr a key for getting an attribute or an attribute for setting the attribute on this node
Expand Down

0 comments on commit b834c46

Please sign in to comment.