1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.is = is;
|
7 | exports.pullFlag = pullFlag;
|
8 |
|
9 | var _pull = _interopRequireDefault(require("lodash/pull"));
|
10 |
|
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12 |
|
13 | function is(node, flag) {
|
14 | return node.type === "RegExpLiteral" && node.flags.indexOf(flag) >= 0;
|
15 | }
|
16 |
|
17 | function pullFlag(node, flag) {
|
18 | const flags = node.flags.split("");
|
19 | if (node.flags.indexOf(flag) < 0) return;
|
20 | (0, _pull.default)(flags, flag);
|
21 | node.flags = flags.join("");
|
22 | } |
\ | No newline at end of file |