add getOpposite path method

This commit is contained in:
Sebastian McKenzie 2015-06-13 18:50:05 +01:00
parent 1298c67949
commit ce03457b19

View File

@ -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
*/