You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
657 B
30 lines
657 B
"use strict"; |
|
|
|
Object.defineProperty(exports, "__esModule", { |
|
value: true |
|
}); |
|
exports.is = is; |
|
exports.pullFlag = pullFlag; |
|
|
|
function _pull() { |
|
const data = _interopRequireDefault(require("lodash/pull")); |
|
|
|
_pull = function () { |
|
return data; |
|
}; |
|
|
|
return data; |
|
} |
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
|
|
|
function is(node, flag) { |
|
return node.type === "RegExpLiteral" && node.flags.indexOf(flag) >= 0; |
|
} |
|
|
|
function pullFlag(node, flag) { |
|
const flags = node.flags.split(""); |
|
if (node.flags.indexOf(flag) < 0) return; |
|
(0, _pull().default)(flags, flag); |
|
node.flags = flags.join(""); |
|
} |