Sha256: 03a541b38ba2242698574d8f7e62a0f52a664c3ae9f8a4f5dd08944ad573120d

Contents?: true

Size: 1.87 KB

Versions: 44

Compression:

Stored size: 1.87 KB

Contents

var _typeof = require("./typeof.js")["default"];
var setPrototypeOf = require("./setPrototypeOf.js");
var inherits = require("./inherits.js");
function _wrapRegExp() {
  module.exports = _wrapRegExp = function _wrapRegExp(e, r) {
    return new BabelRegExp(e, void 0, r);
  }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  var e = RegExp.prototype,
    r = new WeakMap();
  function BabelRegExp(e, t, p) {
    var o = RegExp(e, t);
    return r.set(o, p || r.get(e)), setPrototypeOf(o, BabelRegExp.prototype);
  }
  function buildGroups(e, t) {
    var p = r.get(t);
    return Object.keys(p).reduce(function (r, t) {
      var o = p[t];
      if ("number" == typeof o) r[t] = e[o];else {
        for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;
        r[t] = e[o[i]];
      }
      return r;
    }, Object.create(null));
  }
  return inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
    var t = e.exec.call(this, r);
    if (t) {
      t.groups = buildGroups(t, this);
      var p = t.indices;
      p && (p.groups = buildGroups(p, this));
    }
    return t;
  }, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
    if ("string" == typeof p) {
      var o = r.get(this);
      return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) {
        var t = o[r];
        return "$" + (Array.isArray(t) ? t.join("$") : t);
      }));
    }
    if ("function" == typeof p) {
      var i = this;
      return e[Symbol.replace].call(this, t, function () {
        var e = arguments;
        return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);
      });
    }
    return e[Symbol.replace].call(this, t, p);
  }, _wrapRegExp.apply(this, arguments);
}
module.exports = _wrapRegExp, module.exports.__esModule = true, module.exports["default"] = module.exports;

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.62 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.61 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.60 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.59 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.58 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.57 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.56 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.55 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.54 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.53 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.52 node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.51 node_modules/@babel/runtime/helpers/wrapRegExp.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/@babel/runtime/helpers/wrapRegExp.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/@babel/runtime/helpers/wrapRegExp.js
immosquare-cleaner-0.1.50 node_modules/@babel/runtime/helpers/wrapRegExp.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/@babel/runtime/helpers/wrapRegExp.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/@babel/runtime/helpers/wrapRegExp.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/@babel/runtime/helpers/wrapRegExp.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/@babel/runtime/helpers/wrapRegExp.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/@babel/runtime/helpers/wrapRegExp.js