code: function regexify(val) {
    if (!val) return new RegExp;
    if (Array.isArray(val)) val = val.join("|");
    if (isString(val)) return new RegExp(val || "");
    if (isRegExp(val)) return val;
    throw new TypeError("illegal type for regexify");
  }
docs: Plucked directly from old Babel Core https://github.com/babel/babel/commit/0df0c696a93889f029982bf36d34346a039b1920