multilineRegex.js 507 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = multilineRegexp;
  6. /**
  7. * Build RegExp object from an array
  8. * of multiple/multi-line regexp parts
  9. *
  10. * @param {string[]} parts
  11. * @param {string} flags
  12. * @return {object} - RegExp object
  13. */
  14. function multilineRegexp(parts, flags) {
  15. var regexpAsStringLiteral = parts.join('');
  16. return new RegExp(regexpAsStringLiteral, flags);
  17. }
  18. module.exports = exports.default;
  19. module.exports.default = exports.default;