Remove dependency on barely-used package.

This commit is contained in:
Logan Smyth 2018-07-14 12:41:17 -07:00
parent 62ee1adc85
commit 2854a187be
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,6 @@
"@babel/types": "7.0.0-beta.53", "@babel/types": "7.0.0-beta.53",
"debug": "^3.1.0", "debug": "^3.1.0",
"globals": "^11.1.0", "globals": "^11.1.0",
"invariant": "^2.2.0",
"lodash": "^4.17.5" "lodash": "^4.17.5"
}, },
"devDependencies": { "devDependencies": {

View File

@ -2,7 +2,6 @@ import type Hub from "../hub";
import type TraversalContext from "../context"; import type TraversalContext from "../context";
import * as virtualTypes from "./lib/virtual-types"; import * as virtualTypes from "./lib/virtual-types";
import buildDebug from "debug"; import buildDebug from "debug";
import invariant from "invariant";
import traverse from "../index"; import traverse from "../index";
import Scope from "../scope"; import Scope from "../scope";
import * as t from "@babel/types"; import * as t from "@babel/types";
@ -76,7 +75,9 @@ export default class NodePath {
hub = parentPath.hub; hub = parentPath.hub;
} }
invariant(parent, "To get a node path the parent needs to exist"); if (!parent) {
throw new Error("To get a node path the parent needs to exist");
}
const targetNode = container[key]; const targetNode = container[key];