eslint-plugin-vue-scoped-css
Version:
ESLint plugin for Scoped CSS in Vue.js
19 lines (18 loc) • 520 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.toRegExp = toRegExp;
const RE_REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;
function toRegExp(string, flags) {
const parts = RE_REGEXP_STR.exec(string);
if (parts) {
let flagArgs;
if (flags) {
flagArgs = [...new Set(parts[2] + flags)].join("");
}
else {
flagArgs = parts[2];
}
return new RegExp(parts[1], flagArgs);
}
return new RegExp(string, flags);
}
;