add getOpposite path method
This commit is contained in:
parent
1298c67949
commit
ce03457b19
@ -23,6 +23,18 @@ export function getStatementParent(): ?NodePath {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description
|
||||
*/
|
||||
|
||||
export function getOpposite() {
|
||||
if (this.key === "left") {
|
||||
return this.getSibling("right");
|
||||
} else if (this.key === "right") {
|
||||
return this.getSibling("left");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Description
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user