@vtj/utils 0.6.18 → 0.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +15 -15
- package/lib/index.js +74 -77
- package/package.json +3 -3
- package/types/Request.d.ts +7 -3
- package/types/version.d.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const g0 = "0.6.
|
|
1
|
+
const g0 = "0.6.21";
|
|
2
2
|
var $s = typeof global == "object" && global && global.Object === Object && global;
|
|
3
3
|
const kn = $s;
|
|
4
4
|
var Bs = typeof self == "object" && self && self.Object === Object && self, Cs = kn || Bs || Function("return this")();
|
|
@@ -296,7 +296,7 @@ function qo() {
|
|
|
296
296
|
return !1;
|
|
297
297
|
}
|
|
298
298
|
var ni = typeof exports == "object" && exports && !exports.nodeType && exports, zr = ni && typeof module == "object" && module && !module.nodeType && module, zo = zr && zr.exports === ni, kr = zo ? st.Buffer : void 0, ko = kr ? kr.isBuffer : void 0, Ko = ko || qo;
|
|
299
|
-
const
|
|
299
|
+
const Jt = Ko;
|
|
300
300
|
var Wo = "[object Arguments]", Go = "[object Array]", Yo = "[object Boolean]", Jo = "[object Date]", Zo = "[object Error]", Xo = "[object Function]", Qo = "[object Map]", ta = "[object Number]", ea = "[object Object]", ra = "[object RegExp]", na = "[object Set]", ia = "[object String]", sa = "[object WeakMap]", oa = "[object ArrayBuffer]", aa = "[object DataView]", ua = "[object Float32Array]", fa = "[object Float64Array]", ca = "[object Int8Array]", la = "[object Int16Array]", ha = "[object Int32Array]", da = "[object Uint8Array]", pa = "[object Uint8ClampedArray]", ga = "[object Uint16Array]", ma = "[object Uint32Array]", k = {};
|
|
301
301
|
k[ua] = k[fa] = k[ca] = k[la] = k[ha] = k[da] = k[pa] = k[ga] = k[ma] = !0;
|
|
302
302
|
k[Wo] = k[Go] = k[oa] = k[Yo] = k[aa] = k[Jo] = k[Zo] = k[Xo] = k[Qo] = k[ta] = k[ea] = k[ra] = k[na] = k[ia] = k[sa] = !1;
|
|
@@ -308,9 +308,9 @@ function br(e) {
|
|
|
308
308
|
return e(t);
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
var ii = typeof exports == "object" && exports && !exports.nodeType && exports,
|
|
311
|
+
var ii = typeof exports == "object" && exports && !exports.nodeType && exports, Yt = ii && typeof module == "object" && module && !module.nodeType && module, va = Yt && Yt.exports === ii, Me = va && kn.process, ba = function() {
|
|
312
312
|
try {
|
|
313
|
-
var e =
|
|
313
|
+
var e = Yt && Yt.require && Yt.require("util").types;
|
|
314
314
|
return e || Me && Me.binding && Me.binding("util");
|
|
315
315
|
} catch {
|
|
316
316
|
}
|
|
@@ -320,7 +320,7 @@ var Kr = Mt && Mt.isTypedArray, wa = Kr ? br(Kr) : ya;
|
|
|
320
320
|
const wr = wa;
|
|
321
321
|
var Sa = Object.prototype, Ta = Sa.hasOwnProperty;
|
|
322
322
|
function si(e, t) {
|
|
323
|
-
var r = ft(e), n = !r && Je(e), i = !r && !n &&
|
|
323
|
+
var r = ft(e), n = !r && Je(e), i = !r && !n && Jt(e), s = !r && !n && !i && wr(e), o = r || n || i || s, a = o ? jo(e.length, String) : [], c = a.length;
|
|
324
324
|
for (var u in e)
|
|
325
325
|
(t || Ta.call(e, u)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
326
326
|
(u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
@@ -379,9 +379,9 @@ function Ia(e, t) {
|
|
|
379
379
|
return r == "number" || r == "symbol" || r == "boolean" || e == null || Ee(e) ? !0 : Na.test(e) || !Pa.test(e) || t != null && e in Object(t);
|
|
380
380
|
}
|
|
381
381
|
var Ma = Rt(Object, "create");
|
|
382
|
-
const
|
|
382
|
+
const Zt = Ma;
|
|
383
383
|
function Fa() {
|
|
384
|
-
this.__data__ =
|
|
384
|
+
this.__data__ = Zt ? Zt(null) : {}, this.size = 0;
|
|
385
385
|
}
|
|
386
386
|
function ja(e) {
|
|
387
387
|
var t = this.has(e) && delete this.__data__[e];
|
|
@@ -390,7 +390,7 @@ function ja(e) {
|
|
|
390
390
|
var La = "__lodash_hash_undefined__", Ua = Object.prototype, Ha = Ua.hasOwnProperty;
|
|
391
391
|
function Va(e) {
|
|
392
392
|
var t = this.__data__;
|
|
393
|
-
if (
|
|
393
|
+
if (Zt) {
|
|
394
394
|
var r = t[e];
|
|
395
395
|
return r === La ? void 0 : r;
|
|
396
396
|
}
|
|
@@ -399,12 +399,12 @@ function Va(e) {
|
|
|
399
399
|
var qa = Object.prototype, za = qa.hasOwnProperty;
|
|
400
400
|
function ka(e) {
|
|
401
401
|
var t = this.__data__;
|
|
402
|
-
return
|
|
402
|
+
return Zt ? t[e] !== void 0 : za.call(t, e);
|
|
403
403
|
}
|
|
404
404
|
var Ka = "__lodash_hash_undefined__";
|
|
405
405
|
function Wa(e, t) {
|
|
406
406
|
var r = this.__data__;
|
|
407
|
-
return this.size += this.has(e) ? 0 : 1, r[e] =
|
|
407
|
+
return this.size += this.has(e) ? 0 : 1, r[e] = Zt && t === void 0 ? Ka : t, this;
|
|
408
408
|
}
|
|
409
409
|
function Ot(e) {
|
|
410
410
|
var t = -1, r = e == null ? 0 : e.length;
|
|
@@ -459,11 +459,11 @@ dt.prototype.get = Xa;
|
|
|
459
459
|
dt.prototype.has = Qa;
|
|
460
460
|
dt.prototype.set = tu;
|
|
461
461
|
var eu = Rt(st, "Map");
|
|
462
|
-
const
|
|
462
|
+
const Xt = eu;
|
|
463
463
|
function ru() {
|
|
464
464
|
this.size = 0, this.__data__ = {
|
|
465
465
|
hash: new Ot(),
|
|
466
|
-
map: new (
|
|
466
|
+
map: new (Xt || dt)(),
|
|
467
467
|
string: new Ot()
|
|
468
468
|
};
|
|
469
469
|
}
|
|
@@ -883,7 +883,7 @@ function Jf(e, t) {
|
|
|
883
883
|
var r = this.__data__;
|
|
884
884
|
if (r instanceof dt) {
|
|
885
885
|
var n = r.__data__;
|
|
886
|
-
if (!
|
|
886
|
+
if (!Xt || n.length < Yf - 1)
|
|
887
887
|
return n.push([e, t]), this.size = ++r.size, this;
|
|
888
888
|
r = this.__data__ = new pt(n);
|
|
889
889
|
}
|
|
@@ -955,8 +955,8 @@ var cc = Rt(st, "Promise");
|
|
|
955
955
|
const er = cc;
|
|
956
956
|
var lc = Rt(st, "Set");
|
|
957
957
|
const rr = lc;
|
|
958
|
-
var rn = "[object Map]", hc = "[object Object]", nn = "[object Promise]", sn = "[object Set]", on = "[object WeakMap]", an = "[object DataView]", dc = At(tr), pc = At(
|
|
959
|
-
(tr && _t(new tr(new ArrayBuffer(1))) != an ||
|
|
958
|
+
var rn = "[object Map]", hc = "[object Object]", nn = "[object Promise]", sn = "[object Set]", on = "[object WeakMap]", an = "[object DataView]", dc = At(tr), pc = At(Xt), gc = At(er), mc = At(rr), yc = At(Ye), _t = St;
|
|
959
|
+
(tr && _t(new tr(new ArrayBuffer(1))) != an || Xt && _t(new Xt()) != rn || er && _t(er.resolve()) != nn || rr && _t(new rr()) != sn || Ye && _t(new Ye()) != on) && (_t = function(e) {
|
|
960
960
|
var t = St(e), r = t == hc ? e.constructor : void 0, n = r ? At(r) : "";
|
|
961
961
|
if (n)
|
|
962
962
|
switch (n) {
|
|
@@ -973,7 +973,7 @@ var rn = "[object Map]", hc = "[object Object]", nn = "[object Promise]", sn = "
|
|
|
973
973
|
}
|
|
974
974
|
return t;
|
|
975
975
|
});
|
|
976
|
-
const
|
|
976
|
+
const Qt = _t;
|
|
977
977
|
var vc = Object.prototype, bc = vc.hasOwnProperty;
|
|
978
978
|
function wc(e) {
|
|
979
979
|
var t = e.length, r = new e.constructor(t);
|
|
@@ -1041,13 +1041,13 @@ function qi(e) {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
var Kc = "[object Map]";
|
|
1043
1043
|
function Wc(e) {
|
|
1044
|
-
return it(e) &&
|
|
1044
|
+
return it(e) && Qt(e) == Kc;
|
|
1045
1045
|
}
|
|
1046
1046
|
var cn = Mt && Mt.isMap, Gc = cn ? br(cn) : Wc;
|
|
1047
1047
|
const Yc = Gc;
|
|
1048
1048
|
var Jc = "[object Set]";
|
|
1049
1049
|
function Zc(e) {
|
|
1050
|
-
return it(e) &&
|
|
1050
|
+
return it(e) && Qt(e) == Jc;
|
|
1051
1051
|
}
|
|
1052
1052
|
var ln = Mt && Mt.isSet, Xc = ln ? br(ln) : Zc;
|
|
1053
1053
|
const Qc = Xc;
|
|
@@ -1065,8 +1065,8 @@ function pe(e, t, r, n, i, s) {
|
|
|
1065
1065
|
if (o = wc(e), !a)
|
|
1066
1066
|
return Zn(e, o);
|
|
1067
1067
|
} else {
|
|
1068
|
-
var l =
|
|
1069
|
-
if (
|
|
1068
|
+
var l = Qt(e), p = l == ki || l == al;
|
|
1069
|
+
if (Jt(e))
|
|
1070
1070
|
return ji(e, a);
|
|
1071
1071
|
if (l == Ki || l == zi || p && !i) {
|
|
1072
1072
|
if (o = c || p ? {} : qi(e), !a)
|
|
@@ -1232,13 +1232,13 @@ function th(e, t, r, n, i, s) {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
return s.delete(e), s.delete(t), g;
|
|
1234
1234
|
}
|
|
1235
|
-
var eh = 1, dn = "[object Arguments]", pn = "[object Array]",
|
|
1235
|
+
var eh = 1, dn = "[object Arguments]", pn = "[object Array]", se = "[object Object]", rh = Object.prototype, gn = rh.hasOwnProperty;
|
|
1236
1236
|
function nh(e, t, r, n, i, s) {
|
|
1237
|
-
var o = ft(e), a = ft(t), c = o ? pn :
|
|
1238
|
-
c = c == dn ?
|
|
1239
|
-
var f = c ==
|
|
1240
|
-
if (p &&
|
|
1241
|
-
if (!
|
|
1237
|
+
var o = ft(e), a = ft(t), c = o ? pn : Qt(e), u = a ? pn : Qt(t);
|
|
1238
|
+
c = c == dn ? se : c, u = u == dn ? se : u;
|
|
1239
|
+
var f = c == se, l = u == se, p = c == u;
|
|
1240
|
+
if (p && Jt(e)) {
|
|
1241
|
+
if (!Jt(t))
|
|
1242
1242
|
return !1;
|
|
1243
1243
|
o = !0, f = !1;
|
|
1244
1244
|
}
|
|
@@ -1341,7 +1341,7 @@ function dh(e, t, r, n, i, s, o) {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
var f = s ? s(a, c, r + "", e, t, o) : void 0, l = f === void 0;
|
|
1343
1343
|
if (l) {
|
|
1344
|
-
var p = ft(c), h = !p &&
|
|
1344
|
+
var p = ft(c), h = !p && Jt(c), d = !p && !h && wr(c);
|
|
1345
1345
|
f = c, p || h || d ? ft(a) ? f = a : lh(a) ? f = Zn(a) : h ? (l = !1, f = ji(c, !0)) : d ? (l = !1, f = Vi(c, !0)) : f = [] : li(c) || Je(c) ? (f = a, Je(a) ? f = hh(a) : (!Q(a) || pr(a)) && (f = qi(c))) : l = !1;
|
|
1346
1346
|
}
|
|
1347
1347
|
l && (o.set(c, f), i(f, c, n, s, o), o.delete(c)), nr(e, r, f);
|
|
@@ -1385,7 +1385,7 @@ const w0 = Sh;
|
|
|
1385
1385
|
var Th = ei(function(e, t, r) {
|
|
1386
1386
|
Ji(e, t, r);
|
|
1387
1387
|
});
|
|
1388
|
-
const
|
|
1388
|
+
const Wt = Th;
|
|
1389
1389
|
function xh(e, t, r, n) {
|
|
1390
1390
|
if (!Q(e))
|
|
1391
1391
|
return e;
|
|
@@ -1524,13 +1524,13 @@ function Vh(e, t, r) {
|
|
|
1524
1524
|
trailing: i
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
1527
|
-
const
|
|
1528
|
-
function
|
|
1527
|
+
const te = typeof window < "u", T0 = (e) => typeof e < "u", x0 = () => Date.now(), E0 = () => +Date.now(), _0 = (e, t) => (e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1)) + e);
|
|
1528
|
+
function O0() {
|
|
1529
1529
|
return Number(Math.random().toString().substring(2, 5) + Date.now()).toString(
|
|
1530
1530
|
36
|
|
1531
1531
|
);
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1533
|
+
function qh(e = !0) {
|
|
1534
1534
|
const t = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
|
|
1535
1535
|
/[xy]/g,
|
|
1536
1536
|
function(r) {
|
|
@@ -1636,9 +1636,9 @@ function es(e, t) {
|
|
|
1636
1636
|
const { toString: kh } = Object.prototype, { getPrototypeOf: _r } = Object, De = ((e) => (t) => {
|
|
1637
1637
|
const r = kh.call(t);
|
|
1638
1638
|
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
|
|
1639
|
-
})(/* @__PURE__ */ Object.create(null)), ct = (e) => (e = e.toLowerCase(), (t) => De(t) === e), $e = (e) => (t) => typeof t === e, { isArray: Ht } = Array,
|
|
1639
|
+
})(/* @__PURE__ */ Object.create(null)), ct = (e) => (e = e.toLowerCase(), (t) => De(t) === e), $e = (e) => (t) => typeof t === e, { isArray: Ht } = Array, ee = $e("undefined");
|
|
1640
1640
|
function Kh(e) {
|
|
1641
|
-
return e !== null && !
|
|
1641
|
+
return e !== null && !ee(e) && e.constructor !== null && !ee(e.constructor) && rt(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
1642
1642
|
}
|
|
1643
1643
|
const rs = ct("ArrayBuffer");
|
|
1644
1644
|
function Wh(e) {
|
|
@@ -1655,7 +1655,7 @@ const Gh = $e("string"), rt = $e("function"), ns = $e("number"), Be = (e) => e !
|
|
|
1655
1655
|
return e && (typeof FormData == "function" && e instanceof FormData || rt(e.append) && ((t = De(e)) === "formdata" || // detect form-data instance
|
|
1656
1656
|
t === "object" && rt(e.toString) && e.toString() === "[object FormData]"));
|
|
1657
1657
|
}, rd = ct("URLSearchParams"), nd = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1658
|
-
function
|
|
1658
|
+
function re(e, t, { allOwnKeys: r = !1 } = {}) {
|
|
1659
1659
|
if (e === null || typeof e > "u")
|
|
1660
1660
|
return;
|
|
1661
1661
|
let n, i;
|
|
@@ -1678,17 +1678,17 @@ function is(e, t) {
|
|
|
1678
1678
|
return i;
|
|
1679
1679
|
return null;
|
|
1680
1680
|
}
|
|
1681
|
-
const ss = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), os = (e) => !
|
|
1681
|
+
const ss = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), os = (e) => !ee(e) && e !== ss;
|
|
1682
1682
|
function sr() {
|
|
1683
1683
|
const { caseless: e } = os(this) && this || {}, t = {}, r = (n, i) => {
|
|
1684
1684
|
const s = e && is(t, i) || i;
|
|
1685
1685
|
ge(t[s]) && ge(n) ? t[s] = sr(t[s], n) : ge(n) ? t[s] = sr({}, n) : Ht(n) ? t[s] = n.slice() : t[s] = n;
|
|
1686
1686
|
};
|
|
1687
1687
|
for (let n = 0, i = arguments.length; n < i; n++)
|
|
1688
|
-
arguments[n] &&
|
|
1688
|
+
arguments[n] && re(arguments[n], r);
|
|
1689
1689
|
return t;
|
|
1690
1690
|
}
|
|
1691
|
-
const id = (e, t, r, { allOwnKeys: n } = {}) => (
|
|
1691
|
+
const id = (e, t, r, { allOwnKeys: n } = {}) => (re(t, (i, s) => {
|
|
1692
1692
|
r && rt(i) ? e[s] = es(i, r) : e[s] = i;
|
|
1693
1693
|
}, { allOwnKeys: n }), e), sd = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), od = (e, t, r, n) => {
|
|
1694
1694
|
e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
@@ -1741,7 +1741,7 @@ const id = (e, t, r, { allOwnKeys: n } = {}) => (ee(t, (i, s) => {
|
|
|
1741
1741
|
}
|
|
1742
1742
|
), wn = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), gd = ct("RegExp"), as = (e, t) => {
|
|
1743
1743
|
const r = Object.getOwnPropertyDescriptors(e), n = {};
|
|
1744
|
-
|
|
1744
|
+
re(r, (i, s) => {
|
|
1745
1745
|
let o;
|
|
1746
1746
|
(o = t(i, s, e)) !== !1 && (n[s] = o || i);
|
|
1747
1747
|
}), Object.defineProperties(e, n);
|
|
@@ -1790,9 +1790,9 @@ const Td = (e) => {
|
|
|
1790
1790
|
if (!("toJSON" in n)) {
|
|
1791
1791
|
t[i] = n;
|
|
1792
1792
|
const s = Ht(n) ? [] : {};
|
|
1793
|
-
return
|
|
1793
|
+
return re(n, (o, a) => {
|
|
1794
1794
|
const c = r(o, i + 1);
|
|
1795
|
-
!
|
|
1795
|
+
!ee(c) && (s[a] = c);
|
|
1796
1796
|
}), t[i] = void 0, s;
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
@@ -1810,7 +1810,7 @@ const Td = (e) => {
|
|
|
1810
1810
|
isBoolean: Yh,
|
|
1811
1811
|
isObject: Be,
|
|
1812
1812
|
isPlainObject: ge,
|
|
1813
|
-
isUndefined:
|
|
1813
|
+
isUndefined: ee,
|
|
1814
1814
|
isDate: Jh,
|
|
1815
1815
|
isFile: Zh,
|
|
1816
1816
|
isBlob: Xh,
|
|
@@ -1820,7 +1820,7 @@ const Td = (e) => {
|
|
|
1820
1820
|
isURLSearchParams: rd,
|
|
1821
1821
|
isTypedArray: cd,
|
|
1822
1822
|
isFileList: Qh,
|
|
1823
|
-
forEach:
|
|
1823
|
+
forEach: re,
|
|
1824
1824
|
merge: sr,
|
|
1825
1825
|
extend: id,
|
|
1826
1826
|
trim: nd,
|
|
@@ -2404,10 +2404,10 @@ function Ve(e, t) {
|
|
|
2404
2404
|
function ms(e) {
|
|
2405
2405
|
return !!(e && e.__CANCEL__);
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function ne(e, t, r) {
|
|
2408
2408
|
q.call(this, e ?? "canceled", q.ERR_CANCELED, t, r), this.name = "CanceledError";
|
|
2409
2409
|
}
|
|
2410
|
-
v.inherits(
|
|
2410
|
+
v.inherits(ne, q, {
|
|
2411
2411
|
__CANCEL__: !0
|
|
2412
2412
|
});
|
|
2413
2413
|
function kd(e, t, r) {
|
|
@@ -2588,7 +2588,7 @@ const Xd = typeof XMLHttpRequest < "u", Qd = Xd && function(e) {
|
|
|
2588
2588
|
i === void 0 && s.setContentType(null), "setRequestHeader" in f && v.forEach(s.toJSON(), function(g, y) {
|
|
2589
2589
|
f.setRequestHeader(y, g);
|
|
2590
2590
|
}), v.isUndefined(e.withCredentials) || (f.withCredentials = !!e.withCredentials), o && o !== "json" && (f.responseType = e.responseType), typeof e.onDownloadProgress == "function" && f.addEventListener("progress", On(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && f.upload && f.upload.addEventListener("progress", On(e.onUploadProgress)), (e.cancelToken || e.signal) && (a = (d) => {
|
|
2591
|
-
f && (n(!d || d.type ? new
|
|
2591
|
+
f && (n(!d || d.type ? new ne(null, e, f) : d), f.abort(), f = null);
|
|
2592
2592
|
}, e.cancelToken && e.cancelToken.subscribe(a), e.signal && (e.signal.aborted ? a() : e.signal.addEventListener("abort", a)));
|
|
2593
2593
|
const h = Jd(l);
|
|
2594
2594
|
if (h && ot.protocols.indexOf(h) === -1) {
|
|
@@ -2643,7 +2643,7 @@ const An = (e) => `- ${e}`, tp = (e) => v.isFunction(e) || e === null || e === !
|
|
|
2643
2643
|
};
|
|
2644
2644
|
function qe(e) {
|
|
2645
2645
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
2646
|
-
throw new
|
|
2646
|
+
throw new ne(null, e);
|
|
2647
2647
|
}
|
|
2648
2648
|
function Rn(e) {
|
|
2649
2649
|
return qe(e), e.headers = ht.from(e.headers), e.data = Ve.call(
|
|
@@ -2905,7 +2905,7 @@ class $r {
|
|
|
2905
2905
|
n.unsubscribe(s);
|
|
2906
2906
|
}, o;
|
|
2907
2907
|
}, t(function(s, o, a) {
|
|
2908
|
-
n.reason || (n.reason = new
|
|
2908
|
+
n.reason || (n.reason = new ne(s, o, a), r(n.reason));
|
|
2909
2909
|
});
|
|
2910
2910
|
}
|
|
2911
2911
|
/**
|
|
@@ -3034,7 +3034,7 @@ function ws(e) {
|
|
|
3034
3034
|
}
|
|
3035
3035
|
const Y = ws(Rr);
|
|
3036
3036
|
Y.Axios = ye;
|
|
3037
|
-
Y.CanceledError =
|
|
3037
|
+
Y.CanceledError = ne;
|
|
3038
3038
|
Y.CancelToken = rp;
|
|
3039
3039
|
Y.isCancel = ms;
|
|
3040
3040
|
Y.VERSION = bs;
|
|
@@ -3071,7 +3071,7 @@ class cp {
|
|
|
3071
3071
|
"settings"
|
|
3072
3072
|
]);
|
|
3073
3073
|
this.axios = Bn.create(
|
|
3074
|
-
|
|
3074
|
+
Wt(
|
|
3075
3075
|
{
|
|
3076
3076
|
headers: {
|
|
3077
3077
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -3086,11 +3086,11 @@ class cp {
|
|
|
3086
3086
|
});
|
|
3087
3087
|
}
|
|
3088
3088
|
setConfig(t = {}) {
|
|
3089
|
-
this.settings =
|
|
3089
|
+
this.settings = Wt(this.settings, t.settings || {});
|
|
3090
3090
|
const r = Le(t, [
|
|
3091
3091
|
"settings"
|
|
3092
3092
|
]);
|
|
3093
|
-
this.axios.defaults =
|
|
3093
|
+
this.axios.defaults = Wt(this.axios.defaults, r), this.setupSkipWarn(this.settings);
|
|
3094
3094
|
}
|
|
3095
3095
|
cancel(t, r = "请求已取消") {
|
|
3096
3096
|
if (t) {
|
|
@@ -3103,7 +3103,7 @@ class cp {
|
|
|
3103
3103
|
n.source.cancel(r);
|
|
3104
3104
|
}
|
|
3105
3105
|
createHeaders(t, r, n) {
|
|
3106
|
-
const i = typeof r.headers == "function" ? r.headers(t, n, r) : r.headers || {}, s = {
|
|
3106
|
+
const i = r.injectHeaders ? typeof r.headers == "function" ? r.headers(t, n, r) : r.headers || {} : {}, s = {
|
|
3107
3107
|
"Content-Type": op[r.type || "form"],
|
|
3108
3108
|
...n.headers,
|
|
3109
3109
|
...i
|
|
@@ -3165,9 +3165,9 @@ class cp {
|
|
|
3165
3165
|
return !!t.promise;
|
|
3166
3166
|
}
|
|
3167
3167
|
send(t = {}, r = !1) {
|
|
3168
|
-
const n =
|
|
3168
|
+
const n = Wt({}, this.settings, t.settings || {}), i = Le(t, [
|
|
3169
3169
|
"settings"
|
|
3170
|
-
]), s = qh(), o = Bn.CancelToken.source();
|
|
3170
|
+
]), s = qh(!1), o = Bn.CancelToken.source();
|
|
3171
3171
|
this.records[s] = { settings: n, config: i, source: o };
|
|
3172
3172
|
const a = this.createUrl(i), c = this.createHeaders(s, n, i), { data: u, params: f } = this.createSendData(
|
|
3173
3173
|
n,
|
|
@@ -3238,17 +3238,14 @@ function lp(e = {}) {
|
|
|
3238
3238
|
}
|
|
3239
3239
|
const hp = lp({
|
|
3240
3240
|
settings: {
|
|
3241
|
+
injectHeaders: !0,
|
|
3241
3242
|
loading: !0,
|
|
3242
3243
|
originResponse: !0
|
|
3243
3244
|
}
|
|
3244
3245
|
});
|
|
3245
3246
|
function dp(e) {
|
|
3246
3247
|
const t = typeof e == "string" ? { url: e } : e;
|
|
3247
|
-
return (r, n) => hp.send({
|
|
3248
|
-
...t,
|
|
3249
|
-
...n,
|
|
3250
|
-
data: r
|
|
3251
|
-
});
|
|
3248
|
+
return (r, n) => hp.send(Wt(t, n || {}, { data: r }));
|
|
3252
3249
|
}
|
|
3253
3250
|
function L0(e) {
|
|
3254
3251
|
const t = {};
|
|
@@ -3256,7 +3253,7 @@ function L0(e) {
|
|
|
3256
3253
|
t[r] = dp(n);
|
|
3257
3254
|
return t;
|
|
3258
3255
|
}
|
|
3259
|
-
const U0 = (e) =>
|
|
3256
|
+
const U0 = (e) => te ? window.requestAnimationFrame(e) : setTimeout(e, 16), H0 = (e) => te ? window.cancelAnimationFrame(e) : clearTimeout(e);
|
|
3260
3257
|
var vt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3261
3258
|
function Br(e) {
|
|
3262
3259
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -3443,13 +3440,13 @@ function Ss() {
|
|
|
3443
3440
|
var C = this, $ = this.$locale();
|
|
3444
3441
|
if (!this.isValid())
|
|
3445
3442
|
return $.invalidDate || g;
|
|
3446
|
-
var F = D || "YYYY-MM-DDTHH:mm:ssZ", j = N.z(this), S = this.$H, x = this.$m, E = this.$M, _ = $.weekdays, tt = $.months, $t = $.meridiem, Tt = function(X, gt, zt,
|
|
3447
|
-
return X && (X[gt] || X(C, F)) || zt[gt].slice(0,
|
|
3443
|
+
var F = D || "YYYY-MM-DDTHH:mm:ssZ", j = N.z(this), S = this.$H, x = this.$m, E = this.$M, _ = $.weekdays, tt = $.months, $t = $.meridiem, Tt = function(X, gt, zt, ie) {
|
|
3444
|
+
return X && (X[gt] || X(C, F)) || zt[gt].slice(0, ie);
|
|
3448
3445
|
}, qt = function(X) {
|
|
3449
3446
|
return N.s(S % 12 || 12, X, "0");
|
|
3450
3447
|
}, xt = $t || function(X, gt, zt) {
|
|
3451
|
-
var
|
|
3452
|
-
return zt ?
|
|
3448
|
+
var ie = X < 12 ? "AM" : "PM";
|
|
3449
|
+
return zt ? ie.toLowerCase() : ie;
|
|
3453
3450
|
};
|
|
3454
3451
|
return F.replace(A, function(X, gt) {
|
|
3455
3452
|
return gt || function(zt) {
|
|
@@ -4030,8 +4027,8 @@ class bp {
|
|
|
4030
4027
|
types;
|
|
4031
4028
|
constructor(t = {}) {
|
|
4032
4029
|
this.types = {
|
|
4033
|
-
local:
|
|
4034
|
-
session:
|
|
4030
|
+
local: te ? window.localStorage : this.caches,
|
|
4031
|
+
session: te ? window.sessionStorage : this.caches,
|
|
4035
4032
|
cache: this.caches
|
|
4036
4033
|
}, this.config(t);
|
|
4037
4034
|
}
|
|
@@ -4864,7 +4861,7 @@ var Bt, Hp = {
|
|
|
4864
4861
|
throw new Error("RegExp out of sync");
|
|
4865
4862
|
return lr.decode(e);
|
|
4866
4863
|
}
|
|
4867
|
-
}, Ct = 1e13,
|
|
4864
|
+
}, Ct = 1e13, Gt = (
|
|
4868
4865
|
/** @class */
|
|
4869
4866
|
function() {
|
|
4870
4867
|
function e(t) {
|
|
@@ -4963,7 +4960,7 @@ var Ke = (
|
|
|
4963
4960
|
`;
|
|
4964
4961
|
}
|
|
4965
4962
|
i && (n = n - 256);
|
|
4966
|
-
for (var c = new
|
|
4963
|
+
for (var c = new Gt(n), u = t + 1; u < r; ++u)
|
|
4967
4964
|
c.mulAdd(256, this.get(u));
|
|
4968
4965
|
return a + c.toString();
|
|
4969
4966
|
}, e.prototype.parseBitString = function(t, r, n) {
|
|
@@ -4985,11 +4982,11 @@ var Ke = (
|
|
|
4985
4982
|
s += this.hexByte(this.get(o));
|
|
4986
4983
|
return i > n && (s += Os), s;
|
|
4987
4984
|
}, e.prototype.parseOID = function(t, r, n) {
|
|
4988
|
-
for (var i = "", s = new
|
|
4985
|
+
for (var i = "", s = new Gt(), o = 0, a = t; a < r; ++a) {
|
|
4989
4986
|
var c = this.get(a);
|
|
4990
4987
|
if (s.mulAdd(128, c & 127), o += 7, !(c & 128)) {
|
|
4991
4988
|
if (i === "")
|
|
4992
|
-
if (s = s.simplify(), s instanceof
|
|
4989
|
+
if (s = s.simplify(), s instanceof Gt)
|
|
4993
4990
|
s.sub(80), i = "2." + s.toString();
|
|
4994
4991
|
else {
|
|
4995
4992
|
var u = s < 80 ? s < 40 ? 0 : 1 : 2;
|
|
@@ -4999,7 +4996,7 @@ var Ke = (
|
|
|
4999
4996
|
i += "." + s.toString();
|
|
5000
4997
|
if (i.length > n)
|
|
5001
4998
|
return It(i, n);
|
|
5002
|
-
s = new
|
|
4999
|
+
s = new Gt(), o = 0;
|
|
5003
5000
|
}
|
|
5004
5001
|
}
|
|
5005
5002
|
return o > 0 && (i += ".incomplete"), i;
|
|
@@ -5203,7 +5200,7 @@ var Ke = (
|
|
|
5203
5200
|
function e(t) {
|
|
5204
5201
|
var r = t.get();
|
|
5205
5202
|
if (this.tagClass = r >> 6, this.tagConstructed = (r & 32) !== 0, this.tagNumber = r & 31, this.tagNumber == 31) {
|
|
5206
|
-
var n = new
|
|
5203
|
+
var n = new Gt();
|
|
5207
5204
|
do
|
|
5208
5205
|
r = t.get(), n.mulAdd(128, r & 127);
|
|
5209
5206
|
while (r & 128);
|
|
@@ -6724,7 +6721,7 @@ function f0(e) {
|
|
|
6724
6721
|
return Nr.test(e);
|
|
6725
6722
|
}
|
|
6726
6723
|
function c0(e) {
|
|
6727
|
-
if (
|
|
6724
|
+
if (te) {
|
|
6728
6725
|
const { protocol: t, host: r, pathname: n } = location;
|
|
6729
6726
|
return `${t}//${r}${e ? n : ""}`;
|
|
6730
6727
|
} else
|
|
@@ -6833,7 +6830,7 @@ export {
|
|
|
6833
6830
|
N0 as delay,
|
|
6834
6831
|
m0 as get,
|
|
6835
6832
|
Y0 as isCarNo,
|
|
6836
|
-
|
|
6833
|
+
te as isClient,
|
|
6837
6834
|
T0 as isDef,
|
|
6838
6835
|
K0 as isEmail,
|
|
6839
6836
|
v0 as isEqual,
|
|
@@ -6849,7 +6846,7 @@ export {
|
|
|
6849
6846
|
b0 as kebabCase,
|
|
6850
6847
|
w0 as lowerFirst,
|
|
6851
6848
|
I0 as mapToObject,
|
|
6852
|
-
|
|
6849
|
+
Wt as merge,
|
|
6853
6850
|
x0 as now,
|
|
6854
6851
|
q0 as numberFormat,
|
|
6855
6852
|
vp as numeral,
|
|
@@ -6866,10 +6863,10 @@ export {
|
|
|
6866
6863
|
F0 as toArray,
|
|
6867
6864
|
P0 as toFixed,
|
|
6868
6865
|
bn as trim,
|
|
6869
|
-
|
|
6866
|
+
O0 as uid,
|
|
6870
6867
|
Si as upperFirst,
|
|
6871
6868
|
B0 as upperFirstCamelCase,
|
|
6872
6869
|
X0 as url,
|
|
6873
|
-
|
|
6870
|
+
qh as uuid,
|
|
6874
6871
|
g0 as version
|
|
6875
6872
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtj/utils",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.21",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"numeral": "~2.0.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@vtj/cli": "^0.6.
|
|
27
|
+
"@vtj/cli": "^0.6.21"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"lib",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"main": "./lib/index.js",
|
|
35
35
|
"module": "./lib/index.js",
|
|
36
36
|
"types": "./types/index.d.ts",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "670f86a8e75176ed36aff20f1d1f14756bbe4c8b",
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
}
|
package/types/Request.d.ts
CHANGED
|
@@ -23,7 +23,11 @@ export interface IRequestSettings {
|
|
|
23
23
|
*/
|
|
24
24
|
type?: 'form' | 'json' | 'data';
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* 是否注入自定义的请求头
|
|
27
|
+
*/
|
|
28
|
+
injectHeaders?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 自定义请求头
|
|
27
31
|
*/
|
|
28
32
|
headers?: RawAxiosRequestHeaders | ((id: string, config: AxiosRequestConfig, settings: IRequestSettings) => RawAxiosRequestHeaders);
|
|
29
33
|
/**
|
|
@@ -63,7 +67,7 @@ export interface IRequestSettings {
|
|
|
63
67
|
*/
|
|
64
68
|
skipWarn?: IRequestSkipWarn;
|
|
65
69
|
/**
|
|
66
|
-
*
|
|
70
|
+
* 其他自定义扩展参数
|
|
67
71
|
*/
|
|
68
72
|
[index: string]: any;
|
|
69
73
|
}
|
|
@@ -116,4 +120,4 @@ export interface IApiMap {
|
|
|
116
120
|
[name: string]: string | IRequestConfig;
|
|
117
121
|
}
|
|
118
122
|
export declare function createApis(map: IApiMap): Record<string, (data?: unknown, opts?: IRequestConfig<any> | undefined) => Promise<unknown>>;
|
|
119
|
-
export { LOCAL_REQUEST_ID };
|
|
123
|
+
export { LOCAL_REQUEST_ID, type AxiosRequestConfig, type AxiosResponse, type RawAxiosRequestHeaders };
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.6.
|
|
1
|
+
export declare const version = "0.6.21";
|