setup-php/node_modules/@babel/helper-regex/lib/index.js

30 lines
657 B
JavaScript
Raw Normal View History

2019-09-20 09:41:20 +07: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("");
}