1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/@babel/helper-regex/lib/index.js

30 lines
657 B
JavaScript
Raw Normal View History

2023-12-18 13:12:25 +08:00
"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("");
}