just inline the type (#6271) [skip ci]

This commit is contained in:
Henry Zhu 2017-09-19 15:14:12 -04:00 committed by GitHub
parent 4519f95a29
commit 174eaa058a
2 changed files with 1 additions and 3 deletions

View File

@ -6,7 +6,6 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"babel-types": "7.0.0-beta.0",
"lodash": "^4.2.0"
}
}

View File

@ -1,8 +1,7 @@
import pull from "lodash/pull";
import * as t from "babel-types";
export function is(node: Object, flag: string): boolean {
return t.isRegExpLiteral(node) && node.flags.indexOf(flag) >= 0;
return node.type === "RegExpLiteral" && node.flags.indexOf(flag) >= 0;
}
export function pullFlag(node: Object, flag: string) {