CoolFace
Apppublic

opusdev/vector-similarity-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
axios.js4354 linesDownload Raw Back to dist
1/*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors */2(function (global, factory) {3  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :4  typeof define === 'function' && define.amd ? define(factory) :5  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory());6})(this, (function () { 'use strict';7 8  function _OverloadYield(e, d) {9    this.v = e, this.k = d;10  }11  function _arrayLikeToArray(r, a) {12    (null == a || a > r.length) && (a = r.length);13    for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];14    return n;15  }16  function _arrayWithHoles(r) {17    if (Array.isArray(r)) return r;18  }19  function _arrayWithoutHoles(r) {20    if (Array.isArray(r)) return _arrayLikeToArray(r);21  }22  function _assertThisInitialized(e) {23    if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");24    return e;25  }26  function _asyncGeneratorDelegate(t) {27    var e = {},28      n = !1;29    function pump(e, r) {30      return n = !0, r = new Promise(function (n) {31        n(t[e](r));32      }), {33        done: !1,34        value: new _OverloadYield(r, 1)35      };36    }37    return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () {38      return this;39    }, e.next = function (t) {40      return n ? (n = !1, t) : pump("next", t);41    }, "function" == typeof t.throw && (e.throw = function (t) {42      if (n) throw n = !1, t;43      return pump("throw", t);44    }), "function" == typeof t.return && (e.return = function (t) {45      return n ? (n = !1, t) : pump("return", t);46    }), e;47  }48  function _asyncIterator(r) {49    var n,50      t,51      o,52      e = 2;53    for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) {54      if (t && null != (n = r[t])) return n.call(r);55      if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));56      t = "@@asyncIterator", o = "@@iterator";57    }58    throw new TypeError("Object is not async iterable");59  }60  function AsyncFromSyncIterator(r) {61    function AsyncFromSyncIteratorContinuation(r) {62      if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));63      var n = r.done;64      return Promise.resolve(r.value).then(function (r) {65        return {66          value: r,67          done: n68        };69      });70    }71    return AsyncFromSyncIterator = function (r) {72      this.s = r, this.n = r.next;73    }, AsyncFromSyncIterator.prototype = {74      s: null,75      n: null,76      next: function () {77        return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));78      },79      return: function (r) {80        var n = this.s.return;81        return void 0 === n ? Promise.resolve({82          value: r,83          done: !084        }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));85      },86      throw: function (r) {87        var n = this.s.return;88        return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));89      }90    }, new AsyncFromSyncIterator(r);91  }92  function asyncGeneratorStep(n, t, e, r, o, a, c) {93    try {94      var i = n[a](c),95        u = i.value;96    } catch (n) {97      return void e(n);98    }99    i.done ? t(u) : Promise.resolve(u).then(r, o);100  }101  function _asyncToGenerator(n) {102    return function () {103      var t = this,104        e = arguments;105      return new Promise(function (r, o) {106        var a = n.apply(t, e);107        function _next(n) {108          asyncGeneratorStep(a, r, o, _next, _throw, "next", n);109        }110        function _throw(n) {111          asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);112        }113        _next(void 0);114      });115    };116  }117  function _awaitAsyncGenerator(e) {118    return new _OverloadYield(e, 0);119  }120  function _callSuper(t, o, e) {121    return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));122  }123  function _classCallCheck(a, n) {124    if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");125  }126  function _construct(t, e, r) {127    if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);128    var o = [null];129    o.push.apply(o, e);130    var p = new (t.bind.apply(t, o))();131    return r && _setPrototypeOf(p, r.prototype), p;132  }133  function _defineProperties(e, r) {134    for (var t = 0; t < r.length; t++) {135      var o = r[t];136      o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);137    }138  }139  function _createClass(e, r, t) {140    return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {141      writable: !1142    }), e;143  }144  function _createForOfIteratorHelper(r, e) {145    var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];146    if (!t) {147      if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {148        t && (r = t);149        var n = 0,150          F = function () {};151        return {152          s: F,153          n: function () {154            return n >= r.length ? {155              done: !0156            } : {157              done: !1,158              value: r[n++]159            };160          },161          e: function (r) {162            throw r;163          },164          f: F165        };166      }167      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");168    }169    var o,170      a = !0,171      u = !1;172    return {173      s: function () {174        t = t.call(r);175      },176      n: function () {177        var r = t.next();178        return a = r.done, r;179      },180      e: function (r) {181        u = !0, o = r;182      },183      f: function () {184        try {185          a || null == t.return || t.return();186        } finally {187          if (u) throw o;188        }189      }190    };191  }192  function _defineProperty(e, r, t) {193    return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {194      value: t,195      enumerable: !0,196      configurable: !0,197      writable: !0198    }) : e[r] = t, e;199  }200  function _getPrototypeOf(t) {201    return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {202      return t.__proto__ || Object.getPrototypeOf(t);203    }, _getPrototypeOf(t);204  }205  function _inherits(t, e) {206    if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");207    t.prototype = Object.create(e && e.prototype, {208      constructor: {209        value: t,210        writable: !0,211        configurable: !0212      }213    }), Object.defineProperty(t, "prototype", {214      writable: !1215    }), e && _setPrototypeOf(t, e);216  }217  function _isNativeFunction(t) {218    try {219      return -1 !== Function.toString.call(t).indexOf("[native code]");220    } catch (n) {221      return "function" == typeof t;222    }223  }224  function _isNativeReflectConstruct() {225    try {226      var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));227    } catch (t) {}228    return (_isNativeReflectConstruct = function () {229      return !!t;230    })();231  }232  function _iterableToArray(r) {233    if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);234  }235  function _iterableToArrayLimit(r, l) {236    var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];237    if (null != t) {238      var e,239        n,240        i,241        u,242        a = [],243        f = !0,244        o = !1;245      try {246        if (i = (t = t.call(r)).next, 0 === l) {247          if (Object(t) !== t) return;248          f = !1;249        } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);250      } catch (r) {251        o = !0, n = r;252      } finally {253        try {254          if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;255        } finally {256          if (o) throw n;257        }258      }259      return a;260    }261  }262  function _nonIterableRest() {263    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");264  }265  function _nonIterableSpread() {266    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");267  }268  function ownKeys(e, r) {269    var t = Object.keys(e);270    if (Object.getOwnPropertySymbols) {271      var o = Object.getOwnPropertySymbols(e);272      r && (o = o.filter(function (r) {273        return Object.getOwnPropertyDescriptor(e, r).enumerable;274      })), t.push.apply(t, o);275    }276    return t;277  }278  function _objectSpread2(e) {279    for (var r = 1; r < arguments.length; r++) {280      var t = null != arguments[r] ? arguments[r] : {};281      r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {282        _defineProperty(e, r, t[r]);283      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {284        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));285      });286    }287    return e;288  }289  function _possibleConstructorReturn(t, e) {290    if (e && ("object" == typeof e || "function" == typeof e)) return e;291    if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");292    return _assertThisInitialized(t);293  }294  function _regenerator() {295    /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */296    var e,297      t,298      r = "function" == typeof Symbol ? Symbol : {},299      n = r.iterator || "@@iterator",300      o = r.toStringTag || "@@toStringTag";301    function i(r, n, o, i) {302      var c = n && n.prototype instanceof Generator ? n : Generator,303        u = Object.create(c.prototype);304      return _regeneratorDefine(u, "_invoke", function (r, n, o) {305        var i,306          c,307          u,308          f = 0,309          p = o || [],310          y = !1,311          G = {312            p: 0,313            n: 0,314            v: e,315            a: d,316            f: d.bind(e, 4),317            d: function (t, r) {318              return i = t, c = 0, u = e, G.n = r, a;319            }320          };321        function d(r, n) {322          for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {323            var o,324              i = p[t],325              d = G.p,326              l = i[2];327            r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));328          }329          if (o || r > 1) return a;330          throw y = !0, n;331        }332        return function (o, p, l) {333          if (f > 1) throw TypeError("Generator is already running");334          for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {335            i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);336            try {337              if (f = 2, i) {338                if (c || (o = "next"), t = i[o]) {339                  if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");340                  if (!t.done) return t;341                  u = t.value, c < 2 && (c = 0);342                } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);343                i = e;344              } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;345            } catch (t) {346              i = e, c = 1, u = t;347            } finally {348              f = 1;349            }350          }351          return {352            value: t,353            done: y354          };355        };356      }(r, o, i), !0), u;357    }358    var a = {};359    function Generator() {}360    function GeneratorFunction() {}361    function GeneratorFunctionPrototype() {}362    t = Object.getPrototypeOf;363    var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {364        return this;365      }), t),366      u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);367    function f(e) {368      return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;369    }370    return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {371      return this;372    }), _regeneratorDefine(u, "toString", function () {373      return "[object Generator]";374    }), (_regenerator = function () {375      return {376        w: i,377        m: f378      };379    })();380  }381  function _regeneratorDefine(e, r, n, t) {382    var i = Object.defineProperty;383    try {384      i({}, "", {});385    } catch (e) {386      i = 0;387    }388    _regeneratorDefine = function (e, r, n, t) {389      function o(r, n) {390        _regeneratorDefine(e, r, function (e) {391          return this._invoke(r, n, e);392        });393      }394      r ? i ? i(e, r, {395        value: n,396        enumerable: !t,397        configurable: !t,398        writable: !t399      }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));400    }, _regeneratorDefine(e, r, n, t);401  }402  function _regeneratorValues(e) {403    if (null != e) {404      var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],405        r = 0;406      if (t) return t.call(e);407      if ("function" == typeof e.next) return e;408      if (!isNaN(e.length)) return {409        next: function () {410          return e && r >= e.length && (e = void 0), {411            value: e && e[r++],412            done: !e413          };414        }415      };416    }417    throw new TypeError(typeof e + " is not iterable");418  }419  function _setPrototypeOf(t, e) {420    return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {421      return t.__proto__ = e, t;422    }, _setPrototypeOf(t, e);423  }424  function _slicedToArray(r, e) {425    return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();426  }427  function _toConsumableArray(r) {428    return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();429  }430  function _toPrimitive(t, r) {431    if ("object" != typeof t || !t) return t;432    var e = t[Symbol.toPrimitive];433    if (void 0 !== e) {434      var i = e.call(t, r || "default");435      if ("object" != typeof i) return i;436      throw new TypeError("@@toPrimitive must return a primitive value.");437    }438    return ("string" === r ? String : Number)(t);439  }440  function _toPropertyKey(t) {441    var i = _toPrimitive(t, "string");442    return "symbol" == typeof i ? i : i + "";443  }444  function _typeof(o) {445    "@babel/helpers - typeof";446 447    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {448      return typeof o;449    } : function (o) {450      return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;451    }, _typeof(o);452  }453  function _unsupportedIterableToArray(r, a) {454    if (r) {455      if ("string" == typeof r) return _arrayLikeToArray(r, a);456      var t = {}.toString.call(r).slice(8, -1);457      return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;458    }459  }460  function _wrapAsyncGenerator(e) {461    return function () {462      return new AsyncGenerator(e.apply(this, arguments));463    };464  }465  function AsyncGenerator(e) {466    var r, t;467    function resume(r, t) {468      try {469        var n = e[r](t),470          o = n.value,471          u = o instanceof _OverloadYield;472        Promise.resolve(u ? o.v : o).then(function (t) {473          if (u) {474            var i = "return" === r ? "return" : "next";475            if (!o.k || t.done) return resume(i, t);476            t = e[i](t).value;477          }478          settle(n.done ? "return" : "normal", t);479        }, function (e) {480          resume("throw", e);481        });482      } catch (e) {483        settle("throw", e);484      }485    }486    function settle(e, n) {487      switch (e) {488        case "return":489          r.resolve({490            value: n,491            done: !0492          });493          break;494        case "throw":495          r.reject(n);496          break;497        default:498          r.resolve({499            value: n,500            done: !1501          });502      }503      (r = r.next) ? resume(r.key, r.arg) : t = null;504    }505    this._invoke = function (e, n) {506      return new Promise(function (o, u) {507        var i = {508          key: e,509          arg: n,510          resolve: o,511          reject: u,512          next: null513        };514        t ? t = t.next = i : (r = t = i, resume(e, n));515      });516    }, "function" != typeof e.return && (this.return = void 0);517  }518  AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {519    return this;520  }, AsyncGenerator.prototype.next = function (e) {521    return this._invoke("next", e);522  }, AsyncGenerator.prototype.throw = function (e) {523    return this._invoke("throw", e);524  }, AsyncGenerator.prototype.return = function (e) {525    return this._invoke("return", e);526  };527  function _wrapNativeSuper(t) {528    var r = "function" == typeof Map ? new Map() : void 0;529    return _wrapNativeSuper = function (t) {530      if (null === t || !_isNativeFunction(t)) return t;531      if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");532      if (void 0 !== r) {533        if (r.has(t)) return r.get(t);534        r.set(t, Wrapper);535      }536      function Wrapper() {537        return _construct(t, arguments, _getPrototypeOf(this).constructor);538      }539      return Wrapper.prototype = Object.create(t.prototype, {540        constructor: {541          value: Wrapper,542          enumerable: !1,543          writable: !0,544          configurable: !0545        }546      }), _setPrototypeOf(Wrapper, t);547    }, _wrapNativeSuper(t);548  }549 550  /**551   * Create a bound version of a function with a specified `this` context552   *553   * @param {Function} fn - The function to bind554   * @param {*} thisArg - The value to be passed as the `this` parameter555   * @returns {Function} A new function that will call the original function with the specified `this` context556   */557  function bind(fn, thisArg) {558    return function wrap() {559      return fn.apply(thisArg, arguments);560    };561  }562 563  // utils is a library of generic helper functions non-specific to axios564 565  var toString = Object.prototype.toString;566  var getPrototypeOf = Object.getPrototypeOf;567  var iterator = Symbol.iterator,568    toStringTag = Symbol.toStringTag;569  var kindOf = function (cache) {570    return function (thing) {571      var str = toString.call(thing);572      return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());573    };574  }(Object.create(null));575  var kindOfTest = function kindOfTest(type) {576    type = type.toLowerCase();577    return function (thing) {578      return kindOf(thing) === type;579    };580  };581  var typeOfTest = function typeOfTest(type) {582    return function (thing) {583      return _typeof(thing) === type;584    };585  };586 587  /**588   * Determine if a value is a non-null object589   *590   * @param {Object} val The value to test591   *592   * @returns {boolean} True if value is an Array, otherwise false593   */594  var isArray = Array.isArray;595 596  /**597   * Determine if a value is undefined598   *599   * @param {*} val The value to test600   *601   * @returns {boolean} True if the value is undefined, otherwise false602   */603  var isUndefined = typeOfTest("undefined");604 605  /**606   * Determine if a value is a Buffer607   *608   * @param {*} val The value to test609   *610   * @returns {boolean} True if value is a Buffer, otherwise false611   */612  function isBuffer(val) {613    return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);614  }615 616  /**617   * Determine if a value is an ArrayBuffer618   *619   * @param {*} val The value to test620   *621   * @returns {boolean} True if value is an ArrayBuffer, otherwise false622   */623  var isArrayBuffer = kindOfTest("ArrayBuffer");624 625  /**626   * Determine if a value is a view on an ArrayBuffer627   *628   * @param {*} val The value to test629   *630   * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false631   */632  function isArrayBufferView(val) {633    var result;634    if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {635      result = ArrayBuffer.isView(val);636    } else {637      result = val && val.buffer && isArrayBuffer(val.buffer);638    }639    return result;640  }641 642  /**643   * Determine if a value is a String644   *645   * @param {*} val The value to test646   *647   * @returns {boolean} True if value is a String, otherwise false648   */649  var isString = typeOfTest("string");650 651  /**652   * Determine if a value is a Function653   *654   * @param {*} val The value to test655   * @returns {boolean} True if value is a Function, otherwise false656   */657  var isFunction$1 = typeOfTest("function");658 659  /**660   * Determine if a value is a Number661   *662   * @param {*} val The value to test663   *664   * @returns {boolean} True if value is a Number, otherwise false665   */666  var isNumber = typeOfTest("number");667 668  /**669   * Determine if a value is an Object670   *671   * @param {*} thing The value to test672   *673   * @returns {boolean} True if value is an Object, otherwise false674   */675  var isObject = function isObject(thing) {676    return thing !== null && _typeof(thing) === "object";677  };678 679  /**680   * Determine if a value is a Boolean681   *682   * @param {*} thing The value to test683   * @returns {boolean} True if value is a Boolean, otherwise false684   */685  var isBoolean = function isBoolean(thing) {686    return thing === true || thing === false;687  };688 689  /**690   * Determine if a value is a plain Object691   *692   * @param {*} val The value to test693   *694   * @returns {boolean} True if value is a plain Object, otherwise false695   */696  var isPlainObject = function isPlainObject(val) {697    if (kindOf(val) !== "object") {698      return false;699    }700    var prototype = getPrototypeOf(val);701    return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);702  };703 704  /**705   * Determine if a value is an empty object (safely handles Buffers)706   *707   * @param {*} val The value to test708   *709   * @returns {boolean} True if value is an empty object, otherwise false710   */711  var isEmptyObject = function isEmptyObject(val) {712    // Early return for non-objects or Buffers to prevent RangeError713    if (!isObject(val) || isBuffer(val)) {714      return false;715    }716    try {717      return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;718    } catch (e) {719      // Fallback for any other objects that might cause RangeError with Object.keys()720      return false;721    }722  };723 724  /**725   * Determine if a value is a Date726   *727   * @param {*} val The value to test728   *729   * @returns {boolean} True if value is a Date, otherwise false730   */731  var isDate = kindOfTest("Date");732 733  /**734   * Determine if a value is a File735   *736   * @param {*} val The value to test737   *738   * @returns {boolean} True if value is a File, otherwise false739   */740  var isFile = kindOfTest("File");741 742  /**743   * Determine if a value is a Blob744   *745   * @param {*} val The value to test746   *747   * @returns {boolean} True if value is a Blob, otherwise false748   */749  var isBlob = kindOfTest("Blob");750 751  /**752   * Determine if a value is a FileList753   *754   * @param {*} val The value to test755   *756   * @returns {boolean} True if value is a File, otherwise false757   */758  var isFileList = kindOfTest("FileList");759 760  /**761   * Determine if a value is a Stream762   *763   * @param {*} val The value to test764   *765   * @returns {boolean} True if value is a Stream, otherwise false766   */767  var isStream = function isStream(val) {768    return isObject(val) && isFunction$1(val.pipe);769  };770 771  /**772   * Determine if a value is a FormData773   *774   * @param {*} thing The value to test775   *776   * @returns {boolean} True if value is an FormData, otherwise false777   */778  var isFormData = function isFormData(thing) {779    var kind;780    return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" ||781    // detect form-data instance782    kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));783  };784 785  /**786   * Determine if a value is a URLSearchParams object787   *788   * @param {*} val The value to test789   *790   * @returns {boolean} True if value is a URLSearchParams object, otherwise false791   */792  var isURLSearchParams = kindOfTest("URLSearchParams");793  var _map = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest),794    _map2 = _slicedToArray(_map, 4),795    isReadableStream = _map2[0],796    isRequest = _map2[1],797    isResponse = _map2[2],798    isHeaders = _map2[3];799 800  /**801   * Trim excess whitespace off the beginning and end of a string802   *803   * @param {String} str The String to trim804   *805   * @returns {String} The String freed of excess whitespace806   */807  var trim = function trim(str) {808    return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");809  };810 811  /**812   * Iterate over an Array or an Object invoking a function for each item.813   *814   * If `obj` is an Array callback will be called passing815   * the value, index, and complete array for each item.816   *817   * If 'obj' is an Object callback will be called passing818   * the value, key, and complete object for each property.819   *820   * @param {Object|Array<unknown>} obj The object to iterate821   * @param {Function} fn The callback to invoke for each item822   *823   * @param {Object} [options]824   * @param {Boolean} [options.allOwnKeys = false]825   * @returns {any}826   */827  function forEach(obj, fn) {828    var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},829      _ref$allOwnKeys = _ref.allOwnKeys,830      allOwnKeys = _ref$allOwnKeys === void 0 ? false : _ref$allOwnKeys;831    // Don't bother if no value provided832    if (obj === null || typeof obj === "undefined") {833      return;834    }835    var i;836    var l;837 838    // Force an array if not already something iterable839    if (_typeof(obj) !== "object") {840      /*eslint no-param-reassign:0*/841      obj = [obj];842    }843    if (isArray(obj)) {844      // Iterate over array values845      for (i = 0, l = obj.length; i < l; i++) {846        fn.call(null, obj[i], i, obj);847      }848    } else {849      // Buffer check850      if (isBuffer(obj)) {851        return;852      }853 854      // Iterate over object keys855      var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);856      var len = keys.length;857      var key;858      for (i = 0; i < len; i++) {859        key = keys[i];860        fn.call(null, obj[key], key, obj);861      }862    }863  }864  function findKey(obj, key) {865    if (isBuffer(obj)) {866      return null;867    }868    key = key.toLowerCase();869    var keys = Object.keys(obj);870    var i = keys.length;871    var _key;872    while (i-- > 0) {873      _key = keys[i];874      if (key === _key.toLowerCase()) {875        return _key;876      }877    }878    return null;879  }880  var _global = function () {881    /*eslint no-undef:0*/882    if (typeof globalThis !== "undefined") return globalThis;883    return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;884  }();885  var isContextDefined = function isContextDefined(context) {886    return !isUndefined(context) && context !== _global;887  };888 889  /**890   * Accepts varargs expecting each argument to be an object, then891   * immutably merges the properties of each object and returns result.892   *893   * When multiple objects contain the same key the later object in894   * the arguments list will take precedence.895   *896   * Example:897   *898   * ```js899   * const result = merge({foo: 123}, {foo: 456});900   * console.log(result.foo); // outputs 456901   * ```902   *903   * @param {Object} obj1 Object to merge904   *905   * @returns {Object} Result of all merge properties906   */907  function merge(/* obj1, obj2, obj3, ... */908  ) {909    var _ref2 = isContextDefined(this) && this || {},910      caseless = _ref2.caseless,911      skipUndefined = _ref2.skipUndefined;912    var result = {};913    var assignValue = function assignValue(val, key) {914      // Skip dangerous property names to prevent prototype pollution915      if (key === "__proto__" || key === "constructor" || key === "prototype") {916        return;917      }918      var targetKey = caseless && findKey(result, key) || key;919      if (isPlainObject(result[targetKey]) && isPlainObject(val)) {920        result[targetKey] = merge(result[targetKey], val);921      } else if (isPlainObject(val)) {922        result[targetKey] = merge({}, val);923      } else if (isArray(val)) {924        result[targetKey] = val.slice();925      } else if (!skipUndefined || !isUndefined(val)) {926        result[targetKey] = val;927      }928    };929    for (var i = 0, l = arguments.length; i < l; i++) {930      arguments[i] && forEach(arguments[i], assignValue);931    }932    return result;933  }934 935  /**936   * Extends object a by mutably adding to it the properties of object b.937   *938   * @param {Object} a The object to be extended939   * @param {Object} b The object to copy properties from940   * @param {Object} thisArg The object to bind function to941   *942   * @param {Object} [options]943   * @param {Boolean} [options.allOwnKeys]944   * @returns {Object} The resulting value of object a945   */946  var extend = function extend(a, b, thisArg) {947    var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},948      allOwnKeys = _ref3.allOwnKeys;949    forEach(b, function (val, key) {950      if (thisArg && isFunction$1(val)) {951        Object.defineProperty(a, key, {952          value: bind(val, thisArg),953          writable: true,954          enumerable: true,955          configurable: true956        });957      } else {958        Object.defineProperty(a, key, {959          value: val,960          writable: true,961          enumerable: true,962          configurable: true963        });964      }965    }, {966      allOwnKeys: allOwnKeys967    });968    return a;969  };970 971  /**972   * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)973   *974   * @param {string} content with BOM975   *976   * @returns {string} content value without BOM977   */978  var stripBOM = function stripBOM(content) {979    if (content.charCodeAt(0) === 0xfeff) {980      content = content.slice(1);981    }982    return content;983  };984 985  /**986   * Inherit the prototype methods from one constructor into another987   * @param {function} constructor988   * @param {function} superConstructor989   * @param {object} [props]990   * @param {object} [descriptors]991   *992   * @returns {void}993   */994  var inherits = function inherits(constructor, superConstructor, props, descriptors) {995    constructor.prototype = Object.create(superConstructor.prototype, descriptors);996    Object.defineProperty(constructor.prototype, "constructor", {997      value: constructor,998      writable: true,999      enumerable: false,1000      configurable: true1001    });1002    Object.defineProperty(constructor, "super", {1003      value: superConstructor.prototype1004    });1005    props && Object.assign(constructor.prototype, props);1006  };1007 1008  /**1009   * Resolve object with deep prototype chain to a flat object1010   * @param {Object} sourceObj source object1011   * @param {Object} [destObj]1012   * @param {Function|Boolean} [filter]1013   * @param {Function} [propFilter]1014   *1015   * @returns {Object}1016   */1017  var toFlatObject = function toFlatObject(sourceObj, destObj, filter, propFilter) {1018    var props;1019    var i;1020    var prop;1021    var merged = {};1022    destObj = destObj || {};1023    // eslint-disable-next-line no-eq-null,eqeqeq1024    if (sourceObj == null) return destObj;1025    do {1026      props = Object.getOwnPropertyNames(sourceObj);1027      i = props.length;1028      while (i-- > 0) {1029        prop = props[i];1030        if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {1031          destObj[prop] = sourceObj[prop];1032          merged[prop] = true;1033        }1034      }1035      sourceObj = filter !== false && getPrototypeOf(sourceObj);1036    } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);1037    return destObj;1038  };1039 1040  /**1041   * Determines whether a string ends with the characters of a specified string1042   *1043   * @param {String} str1044   * @param {String} searchString1045   * @param {Number} [position= 0]1046   *1047   * @returns {boolean}1048   */1049  var endsWith = function endsWith(str, searchString, position) {1050    str = String(str);1051    if (position === undefined || position > str.length) {1052      position = str.length;1053    }1054    position -= searchString.length;1055    var lastIndex = str.indexOf(searchString, position);1056    return lastIndex !== -1 && lastIndex === position;1057  };1058 1059  /**1060   * Returns new array from array like object or null if failed1061   *1062   * @param {*} [thing]1063   *1064   * @returns {?Array}1065   */1066  var toArray = function toArray(thing) {1067    if (!thing) return null;1068    if (isArray(thing)) return thing;1069    var i = thing.length;1070    if (!isNumber(i)) return null;1071    var arr = new Array(i);1072    while (i-- > 0) {1073      arr[i] = thing[i];1074    }1075    return arr;1076  };1077 1078  /**1079   * Checking if the Uint8Array exists and if it does, it returns a function that checks if the1080   * thing passed in is an instance of Uint8Array1081   *1082   * @param {TypedArray}1083   *1084   * @returns {Array}1085   */1086  // eslint-disable-next-line func-names1087  var isTypedArray = function (TypedArray) {1088    // eslint-disable-next-line func-names1089    return function (thing) {1090      return TypedArray && thing instanceof TypedArray;1091    };1092  }(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));1093 1094  /**1095   * For each entry in the object, call the function with the key and value.1096   *1097   * @param {Object<any, any>} obj - The object to iterate over.1098   * @param {Function} fn - The function to call for each entry.1099   *1100   * @returns {void}1101   */1102  var forEachEntry = function forEachEntry(obj, fn) {1103    var generator = obj && obj[iterator];1104    var _iterator = generator.call(obj);1105    var result;1106    while ((result = _iterator.next()) && !result.done) {1107      var pair = result.value;1108      fn.call(obj, pair[0], pair[1]);1109    }1110  };1111 1112  /**1113   * It takes a regular expression and a string, and returns an array of all the matches1114   *1115   * @param {string} regExp - The regular expression to match against.1116   * @param {string} str - The string to search.1117   *1118   * @returns {Array<boolean>}1119   */1120  var matchAll = function matchAll(regExp, str) {1121    var matches;1122    var arr = [];1123    while ((matches = regExp.exec(str)) !== null) {1124      arr.push(matches);1125    }1126    return arr;1127  };1128 1129  /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */1130  var isHTMLForm = kindOfTest("HTMLFormElement");1131  var toCamelCase = function toCamelCase(str) {1132    return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {1133      return p1.toUpperCase() + p2;1134    });1135  };1136 1137  /* Creating a function that will check if an object has a property. */1138  var hasOwnProperty = function (_ref4) {1139    var hasOwnProperty = _ref4.hasOwnProperty;1140    return function (obj, prop) {1141      return hasOwnProperty.call(obj, prop);1142    };1143  }(Object.prototype);1144 1145  /**1146   * Determine if a value is a RegExp object1147   *1148   * @param {*} val The value to test1149   *1150   * @returns {boolean} True if value is a RegExp object, otherwise false1151   */1152  var isRegExp = kindOfTest("RegExp");1153  var reduceDescriptors = function reduceDescriptors(obj, reducer) {1154    var descriptors = Object.getOwnPropertyDescriptors(obj);1155    var reducedDescriptors = {};1156    forEach(descriptors, function (descriptor, name) {1157      var ret;1158      if ((ret = reducer(descriptor, name, obj)) !== false) {1159        reducedDescriptors[name] = ret || descriptor;1160      }1161    });1162    Object.defineProperties(obj, reducedDescriptors);1163  };1164 1165  /**1166   * Makes all methods read-only1167   * @param {Object} obj1168   */1169 1170  var freezeMethods = function freezeMethods(obj) {1171    reduceDescriptors(obj, function (descriptor, name) {1172      // skip restricted props in strict mode1173      if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {1174        return false;1175      }1176      var value = obj[name];1177      if (!isFunction$1(value)) return;1178      descriptor.enumerable = false;1179      if ("writable" in descriptor) {1180        descriptor.writable = false;1181        return;1182      }1183      if (!descriptor.set) {1184        descriptor.set = function () {1185          throw Error("Can not rewrite read-only method '" + name + "'");1186        };1187      }1188    });1189  };1190  var toObjectSet = function toObjectSet(arrayOrString, delimiter) {1191    var obj = {};1192    var define = function define(arr) {1193      arr.forEach(function (value) {1194        obj[value] = true;1195      });1196    };1197    isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));1198    return obj;1199  };1200  var noop = function noop() {};

Showing the first 1,200 of 4354 lines. Download the file for the rest.