just inline the type (#6271) [skip ci]
This commit is contained in:
parent
4519f95a29
commit
174eaa058a
@ -6,7 +6,6 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-types": "7.0.0-beta.0",
|
|
||||||
"lodash": "^4.2.0"
|
"lodash": "^4.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import pull from "lodash/pull";
|
import pull from "lodash/pull";
|
||||||
import * as t from "babel-types";
|
|
||||||
|
|
||||||
export function is(node: Object, flag: string): boolean {
|
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) {
|
export function pullFlag(node: Object, flag: string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user