diff --git a/src/babel/traversal/path/family.js b/src/babel/traversal/path/family.js index cfba7de496..4558abfaf9 100644 --- a/src/babel/traversal/path/family.js +++ b/src/babel/traversal/path/family.js @@ -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 */