@seayoo-web/request 3.5.1 → 3.5.2

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { h as m, r as q, R as T, c as x, H as R, a as w, v as E, b as C, N as H, X as L } from "./retry-DodVI8cA.js";
2
- import { g as Q } from "./retry-DodVI8cA.js";
3
- import { f as v } from "./request.fetch-BHmmkAon.js";
1
+ import { h as m, r as q, R as T, c as x, H as R, a as w, v as E, b as C, N as H, X as L } from "./retry-Cxkf8ke1.js";
2
+ import { g as Q } from "./retry-Cxkf8ke1.js";
3
+ import { f as v } from "./request.fetch-Jj3A4PnG.js";
4
4
  const j = async function(t, s, e) {
5
5
  return m(await q(y, t, s, e), t, s, e);
6
6
  };
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- import { h as b, r as q, c as w, n as g, a as d, f as E, N as f, X as x } from "./retry-DodVI8cA.js";
2
- import { g as z } from "./retry-DodVI8cA.js";
3
- import { f as C } from "./request.fetch-BHmmkAon.js";
1
+ import { h as b, r as q, c as w, n as g, a as d, f as E, N as f, X as x } from "./retry-Cxkf8ke1.js";
2
+ import { g as z } from "./retry-Cxkf8ke1.js";
3
+ import { f as C } from "./request.fetch-Jj3A4PnG.js";
4
4
  import N from "node:http";
5
5
  import T from "node:https";
6
6
  const j = async function(o, a, u) {
@@ -1,4 +1,4 @@
1
- import { h as w, r as y, c as E, d as T, f as g, a as c } from "./retry-DodVI8cA.js";
1
+ import { h as w, r as y, c as E, d as T, f as g, a as c } from "./retry-Cxkf8ke1.js";
2
2
  const x = async function(o, a, s) {
3
3
  return w(await y(R, o, a, s), o, a, s);
4
4
  }, R = async function(o, a, s) {
@@ -1,5 +1,5 @@
1
1
  const l = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")();
2
- function D() {
2
+ function x() {
3
3
  return l;
4
4
  }
5
5
  function p(t) {
@@ -8,14 +8,14 @@ function p(t) {
8
8
  function F(t) {
9
9
  return typeof t == "object" && t !== null;
10
10
  }
11
- function P() {
11
+ function D() {
12
12
  return "wx" in l && F(l.wx) && "getSystemInfo" in l.wx && p(l.wx.getSystemInfo);
13
13
  }
14
14
  function pe() {
15
15
  return "fetch" in l && p(l.fetch);
16
16
  }
17
17
  function ye() {
18
- return "window" in l && F(l.window) && !P();
18
+ return "window" in l && F(l.window) && !D();
19
19
  }
20
20
  function M() {
21
21
  return "Blob" in l && p(l.Blob);
@@ -29,14 +29,14 @@ function be() {
29
29
  function we() {
30
30
  return "AbortController" in l && p(l.AbortController);
31
31
  }
32
- function q() {
32
+ function P() {
33
33
  return "URLSearchParams" in l && p(l.URLSearchParams);
34
34
  }
35
- function H(t) {
35
+ function q(t) {
36
36
  return new Promise((e) => setTimeout(e, Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, t))));
37
37
  }
38
38
  // @__NO_SIDE_EFFECTS__
39
- function B(t) {
39
+ function H(t) {
40
40
  const e = t || "CustomError";
41
41
  return class extends Error {
42
42
  constructor(s) {
@@ -48,22 +48,22 @@ function B(t) {
48
48
  }
49
49
  };
50
50
  }
51
- const I = /^(?:https?:)?\/\/.+$/i, N = /^https?:\/\/.+$/i, G = /^\{[\d\D]*\}$/, K = /^\[[\d\D]*\]$/;
52
- function T(t, e = !1) {
53
- return e ? I.test(t) : N.test(t);
51
+ const N = /^(?:https?:)?\/\/.+$/i, B = /^https?:\/\/.+$/i, I = /^\{[\d\D]*\}$/, G = /^\[[\d\D]*\]$/;
52
+ function $(t, e = !1) {
53
+ return e ? N.test(t) : B.test(t);
54
54
  }
55
- function _(t) {
55
+ function K(t) {
56
56
  return t == null;
57
57
  }
58
- function A(t, ...e) {
58
+ function v(t, ...e) {
59
59
  if (!t || typeof t != "object") return !1;
60
60
  const s = Object.getPrototypeOf(t);
61
61
  return s !== Object.prototype && s !== null ? !1 : e.every((n) => n in t);
62
62
  }
63
- function v(t) {
64
- return G.test(t) || K.test(t);
63
+ function A(t) {
64
+ return I.test(t) || G.test(t);
65
65
  }
66
- function R(t, e) {
66
+ function k(t, e) {
67
67
  try {
68
68
  const s = JSON.parse(t);
69
69
  return e ? e(s) ? s : null : s;
@@ -81,7 +81,7 @@ async function Ee(t) {
81
81
  }, n.setAttribute("src", t), s.appendChild(n);
82
82
  });
83
83
  }
84
- function J(t, e = "数据未能正确识别") {
84
+ function _(t, e = "数据未能正确识别") {
85
85
  return typeof t == "function" ? {
86
86
  guard: t,
87
87
  message: e
@@ -90,21 +90,21 @@ function J(t, e = "数据未能正确识别") {
90
90
  message: t.message || e
91
91
  };
92
92
  }
93
- function V(t, e = "") {
94
- return !e || T(t, !0) ? $(t) : ($(e) + "/" + t).replace(/\/{2,}/g, "/").replace(/:\//, "://");
93
+ function J(t, e = "") {
94
+ return !e || $(t, !0) ? T(t) : (T(e) + "/" + t).replace(/\/{2,}/g, "/").replace(/:\//, "://");
95
95
  }
96
- function $(t) {
97
- const e = D();
98
- return T(t, !0) ? t.startsWith("http") ? t : ("location" in e ? location.protocol : "https:") + t : ("location" in e ? location.origin : "http://127.0.0.1") + "/" + t.replace(/^\/+/, "");
96
+ function T(t) {
97
+ const e = x();
98
+ return $(t, !0) ? t.startsWith("http") ? t : ("location" in e ? location.protocol : "https:") + t : ("location" in e ? location.origin : "http://127.0.0.1") + "/" + t.replace(/^\/+/, "");
99
99
  }
100
- function W(t, e) {
100
+ function V(t, e) {
101
101
  const s = {};
102
102
  return (t.match(/([^=&#?]+)=[^&#]*/g) || []).forEach(function(n) {
103
103
  const r = n.split("="), o = r[0], a = decodeURIComponent(r[1] || "");
104
104
  s[o] !== void 0 ? s[o] += "," + a : s[o] = a;
105
105
  }), e !== !0 ? s[e] || "" : s;
106
106
  }
107
- function X(t, e) {
107
+ function W(t, e) {
108
108
  if (e) {
109
109
  if (e === !0)
110
110
  return t.replace(/\?[^#]*/, "");
@@ -112,23 +112,23 @@ function X(t, e) {
112
112
  const s = t.split("#"), n = s[0].split("?"), r = n[0], o = n.length > 1 ? n[1] : "", a = s.length > 1 ? "#" + s[1] : "", i = typeof e == "string" ? [e] : Array.isArray(e) ? e : [];
113
113
  return !i.length || !o ? s[0] + a : (i.map((c) => c.replace(/([\\(){}[\]^$+\-*?|])/g, "\\$1")), (r + "?" + o.replace(new RegExp("(?:^|&)(?:" + i.join("|") + ")=[^&$]+", "g"), "").replace(/^&/, "")).replace(/\?$/, "") + a);
114
114
  }
115
- function Re(t, e, s = !1) {
115
+ function ke(t, e, s = !1) {
116
116
  const n = typeof e == "string" ? e : Object.keys(e).map((a) => `${a}=${encodeURIComponent(e[a])}`).join("&");
117
117
  if (!n)
118
118
  return t;
119
119
  const r = t.split("#");
120
- s && (r[0] = X(
120
+ s && (r[0] = W(
121
121
  r[0],
122
122
  (n.match(/([^=&#?]+)=[^&#]+/g) || []).map((a) => a.replace(/=.+$/, ""))
123
123
  ));
124
124
  const o = r[0].indexOf("?") + 1 ? "&" : "?";
125
125
  return (r[0] + o + n + (r.length > 1 ? "#" + r[1] : "")).replace(/\?&/, "?");
126
126
  }
127
- function z(t) {
127
+ function X(t) {
128
128
  const e = t.match(/(?:\?|&)([^=]+)(?:&|$)/g);
129
129
  return e ? e.join("").replace(/(?:\?|^&+|&+$)/g, "").replace(/&{2}/g, "&").split("&").sort() : [];
130
130
  }
131
- class Q {
131
+ class z {
132
132
  ttl;
133
133
  cache;
134
134
  timer = null;
@@ -156,7 +156,7 @@ class Q {
156
156
  } catch (h) {
157
157
  return console.warn("[RequestCache] cacheResolve error", s, n, h), "";
158
158
  }
159
- const c = Object.assign(W(a, !0), n), g = z(a), u = Object.keys(c).sort().map((h) => `${h}#${c[h]}`);
159
+ const c = Object.assign(V(a, !0), n), g = X(a), u = Object.keys(c).sort().map((h) => `${h}#${c[h]}`);
160
160
  return `${i}_${o}_${u.join(",")}_${g.join(",")}`;
161
161
  }
162
162
  updateTTL(e) {
@@ -179,7 +179,7 @@ class Q {
179
179
  this.cache[e] && delete this.cache[e];
180
180
  }
181
181
  }
182
- class Y {
182
+ class Q {
183
183
  // 保存的配置需要部分字段强制设置默认值
184
184
  config = {
185
185
  baseURL: "/",
@@ -204,7 +204,7 @@ class Y {
204
204
  e && this.set(e);
205
205
  }
206
206
  set(e) {
207
- if (e.baseURL && !/^\/.+/.test(e.baseURL) && !T(e.baseURL))
207
+ if (e.baseURL && !/^\/.+/.test(e.baseURL) && !$(e.baseURL))
208
208
  throw console.warn("baseURL 需要以 / 开头,或者是完整的 url 地址"), new Error("BaseURLError");
209
209
  Object.assign(this.config, e);
210
210
  }
@@ -213,7 +213,7 @@ class Y {
213
213
  }
214
214
  /** 基于 baseURL 返回完整的 url 地址 */
215
215
  getFullUrl(e) {
216
- return V(e, this.config.baseURL);
216
+ return J(e, this.config.baseURL);
217
217
  }
218
218
  /** 提示消息 */
219
219
  showMessage(e, s, n, r) {
@@ -236,19 +236,19 @@ const w = {
236
236
  /** url 格式错误 */
237
237
  URLFormatError: "URLFormatError"
238
238
  };
239
- function Z(t, e, s, n) {
240
- if (e.ok && !_(e.data) && n) {
241
- const r = J(n, s.get("defaultTypeGuardMessage"));
239
+ function Y(t, e, s, n) {
240
+ if (e.ok && !K(e.data) && n) {
241
+ const r = _(n, s.get("defaultTypeGuardMessage"));
242
242
  return r.guard(e.data) || (e.code = w.UnexpectResponse, s.showMessage(!0, `${t} ${r.message}`, e.code, e.status), console.error(e.code, t, e.data), e.data = null, e.message = r.message), e;
243
243
  }
244
244
  return e;
245
245
  }
246
- class ke {
246
+ class Re {
247
247
  agent;
248
248
  config;
249
249
  cache;
250
250
  constructor(e, s) {
251
- this.config = new Y(s), this.agent = e, this.cache = new Q(this.config.get("cacheTTL")), this.setConfig = this.setConfig.bind(this), this.getConfig = this.getConfig.bind(this), this.request = this.request.bind(this), this.get = this.get.bind(this), this.post = this.post.bind(this), this.del = this.del.bind(this), this.patch = this.patch.bind(this), this.put = this.put.bind(this), this.head = this.head.bind(this);
251
+ this.config = new Q(s), this.agent = e, this.cache = new z(this.config.get("cacheTTL")), this.setConfig = this.setConfig.bind(this), this.getConfig = this.getConfig.bind(this), this.request = this.request.bind(this), this.get = this.get.bind(this), this.post = this.post.bind(this), this.del = this.del.bind(this), this.patch = this.patch.bind(this), this.put = this.put.bind(this), this.head = this.head.bind(this);
252
252
  }
253
253
  /**
254
254
  * 执行网络请求
@@ -281,7 +281,7 @@ ${r.stack || ""}` : String(r),
281
281
  * 检查响应的数据类型
282
282
  */
283
283
  async guard(e, s, n) {
284
- return Z(e, s, this.config, n);
284
+ return Y(e, s, this.config, n);
285
285
  }
286
286
  /**
287
287
  * 修改默认请求配置: baseURL / timeout / credentials / errorHandler / messageHandler / responseHandler / logHandler / responseRule
@@ -335,9 +335,9 @@ async function je(t, e, s) {
335
335
  n.headers
336
336
  ), c = n.params || {}, g = {};
337
337
  Object.keys(c).forEach((y) => {
338
- c[y] !== void 0 && (g[y] = ee(c[y]));
338
+ c[y] !== void 0 && (g[y] = Z(c[y]));
339
339
  });
340
- const u = e.getFullUrl(t), h = te(n.body), f = n.timeout || e.get("timeout"), d = await (async function() {
340
+ const u = e.getFullUrl(t), h = ee(n.body), f = n.timeout || e.get("timeout"), d = await (async function() {
341
341
  const y = e.get("requestTransformer");
342
342
  if (y)
343
343
  return await y({ headers: i, params: g, method: o, url: u, body: h });
@@ -353,21 +353,21 @@ async function je(t, e, s) {
353
353
  credentials: n.credentials || e.get("credentials")
354
354
  };
355
355
  }
356
- function ee(t) {
356
+ function Z(t) {
357
357
  return t == null ? "" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : Array.isArray(t) ? t.filter(
358
358
  (s) => s != null && typeof s != "object" && typeof s != "function"
359
359
  ).join(",") : (console.warn("参数类型不支持,已被过滤", typeof t), "");
360
360
  }
361
- function te(t) {
361
+ function ee(t) {
362
362
  if (t)
363
- return typeof t == "string" || q() && t instanceof URLSearchParams || t instanceof ArrayBuffer || M() && t instanceof Blob || U() && t instanceof FormData ? t : JSON.stringify(t);
363
+ return typeof t == "string" || P() && t instanceof URLSearchParams || t instanceof ArrayBuffer || M() && t instanceof Blob || U() && t instanceof FormData ? t : JSON.stringify(t);
364
364
  }
365
- const x = "data", b = "message";
366
- function se(t, e, s, n, r) {
365
+ const L = "data", b = "message";
366
+ function te(t, e, s, n, r) {
367
367
  const o = r || n;
368
- return L(t) ? ie(o.ok || n.ok, t, e, s) : ne(o.failed || n.failed, e, s);
368
+ return S(t) ? ce(o.ok || n.ok, t, e, s) : se(o.failed || n.failed, e, s);
369
369
  }
370
- const Te = function(t) {
370
+ const $e = function(t) {
371
371
  const e = [], s = t.failed || { resolve: "json" };
372
372
  switch (e.push("- 当http状态码 <200 或者 >=400 时"), s.resolve) {
373
373
  case "body":
@@ -384,7 +384,7 @@ const Te = function(t) {
384
384
  break;
385
385
  case "json":
386
386
  e.push(
387
- " 将响应解析为 json,读取 " + (n.dataField || x) + " 作为响应数据,读取 " + (n.messageField || b) + " 作为提示消息"
387
+ " 将响应解析为 json,读取 " + (n.dataField || L) + " 作为响应数据,读取 " + (n.messageField || b) + " 作为提示消息"
388
388
  ), n.statusField && e.push(
389
389
  " 当 " + n.statusField + " 为 " + (n.statusOKValue || "空值") + " 时是成功提示,否则是错误消息"
390
390
  ), n.ignoreMessage && e.push(" 并忽略以下消息:" + n.ignoreMessage);
@@ -393,7 +393,7 @@ const Te = function(t) {
393
393
  return e.join(`
394
394
  `);
395
395
  };
396
- function ne(t, e, s) {
396
+ function se(t, e, s) {
397
397
  const n = t || { resolve: "json", messageField: b }, r = {
398
398
  ok: !1,
399
399
  code: e,
@@ -405,40 +405,40 @@ function ne(t, e, s) {
405
405
  r.message = O(s) || s;
406
406
  break;
407
407
  case "json":
408
- const { code: o, message: a } = re(s, n.converter, n.statusField, n.messageField);
408
+ const { code: o, message: a } = ne(s, n.converter, n.statusField, n.messageField);
409
409
  r.code = o || e, r.message = O(s) || a;
410
410
  break;
411
411
  }
412
412
  return r;
413
413
  }
414
- function re(t, e, s, n = b) {
415
- if (!v(t))
414
+ function ne(t, e, s, n = b) {
415
+ if (!A(t))
416
416
  return { message: "" };
417
- const r = j(R(t), e);
418
- return !r || !A(r) ? { message: t } : {
419
- code: s ? k(r, s) : "",
420
- message: k(r, n) || t
417
+ const r = j(k(t), e);
418
+ return !r || !v(r) ? { message: t } : {
419
+ code: s ? R(r, s) : "",
420
+ message: R(r, n) || t
421
421
  };
422
422
  }
423
- function k(t, e) {
423
+ function R(t, e) {
424
424
  const s = Array.isArray(e) ? e : [e];
425
425
  for (const n of s)
426
426
  if (n in t)
427
- return oe(t[n]);
427
+ return re(t[n]);
428
428
  return "";
429
429
  }
430
- function oe(t) {
430
+ function re(t) {
431
431
  return t ? typeof t == "string" ? t : JSON.stringify(t) : "";
432
432
  }
433
- const ae = /<title>([^<]+)<\/title>/i, ce = /<message>([^<]+)<\/message>/i;
433
+ const oe = /<title>([^<]+)<\/title>/i, ae = /<message>([^<]+)<\/message>/i;
434
434
  function O(t) {
435
- const e = t.match(ae);
435
+ const e = t.match(oe);
436
436
  if (e)
437
437
  return e[1];
438
- const s = t.match(ce);
438
+ const s = t.match(ae);
439
439
  return s ? s[1] : "";
440
440
  }
441
- function ie(t, e, s, n) {
441
+ function ce(t, e, s, n) {
442
442
  const r = t || { resolve: "body" }, o = {
443
443
  ok: !0,
444
444
  code: s,
@@ -448,33 +448,33 @@ function ie(t, e, s, n) {
448
448
  if (e === 204 || !n)
449
449
  return o;
450
450
  if (r.resolve === "body")
451
- return o.data = v(n) ? j(R(n), t.converter) : n, o;
452
- const a = R(n);
451
+ return o.data = A(n) ? j(k(n), t.converter) : n, o;
452
+ const a = k(n);
453
453
  if (!a)
454
454
  return o.ok = !1, o.code = "ResponseFormatError", o.message = "响应内容无法安全解析", o;
455
455
  const i = j(a, t.converter);
456
- if (!i || !A(i))
456
+ if (!i || !v(i))
457
457
  return o.ok = !1, o.code = "ResponseFormatError", o.message = "响应内容无法格式化为 Object", o;
458
- const c = r.statusField, g = r.statusOKValue || "", u = r.dataField || x, h = r.messageField || b, f = r.ignoreMessage || "";
458
+ const c = r.statusField, g = r.statusOKValue || "", u = r.dataField || L, h = r.messageField || b, f = r.ignoreMessage || "";
459
459
  if (c && !(c in i))
460
460
  return o.ok = !1, o.code = "ResponseFieldMissing", o.message = "响应内容找不到状态字段 " + c, o;
461
- const d = c ? i[c] + "" : "";
462
- return o.ok = c ? d === g : !0, o.code = d || s, o.data = u === !0 ? i : u in i ? i[u] : null, o.message = k(i, h), f && o.message && (Array.isArray(f) && f.includes(o.message) || typeof f == "string" && o.message === f) && (o.message = ""), o;
461
+ const d = c ? String(i[c] ?? "") : "";
462
+ return o.ok = c ? d === g : !0, o.code = d || s, o.data = u === !0 ? i : u in i ? i[u] : null, o.message = R(i, h), f && o.message && (Array.isArray(f) && f.includes(o.message) || typeof f == "string" && o.message === f) && (o.message = ""), o;
463
463
  }
464
- function L(t) {
464
+ function S(t) {
465
465
  return t >= 200 && t < 400;
466
466
  }
467
467
  function j(t, e) {
468
468
  return e && typeof e == "function" ? e(t) : t;
469
469
  }
470
- const ue = /* @__PURE__ */ B("APIError");
471
- function he(t) {
470
+ const ie = /* @__PURE__ */ H("APIError");
471
+ function ue(t) {
472
472
  const e = {};
473
473
  for (const r in t.headers)
474
474
  (r.startsWith("x-") || r.includes("trace") || r.includes("server") || /\b(?:id|uuid)\b/.test(r)) && (e[r] = t.headers[r]);
475
475
  const s = t.url.replace(/^(?:https?:)?\/*/i, "").replace(/\?.+/, ""), n = t.status < 0 ? "unknown" : t.status;
476
476
  return {
477
- sentryError: new ue(`${s} | ${n}${t.code ? ` | ${t.code}` : ""}`),
477
+ sentryError: new ie(`${s} | ${n}${t.code ? ` | ${t.code}` : ""}`),
478
478
  sentryTags: {
479
479
  ...e,
480
480
  status: n,
@@ -490,38 +490,35 @@ function he(t) {
490
490
  }
491
491
  };
492
492
  }
493
- function le(t) {
493
+ function he(t) {
494
494
  const e = {};
495
495
  for (const [s, n] of t)
496
496
  s && typeof s == "string" && (e[s] = n || "");
497
497
  return e;
498
498
  }
499
- function fe(t) {
499
+ function le(t) {
500
500
  return typeof t == "function" ? t : Array.isArray(t) && t.length > 0 ? function(e) {
501
501
  return t.includes(e.status);
502
- } : t === "network" ? S : de;
502
+ } : t === "network" ? fe : de;
503
503
  }
504
- function S(t) {
505
- return t.status < 0 && t.statusText !== w.Timeout && t.statusText !== w.Aborted;
504
+ function fe({ statusText: t }) {
505
+ return t == w.NetworkError;
506
506
  }
507
- function de(t) {
508
- if (S(t))
509
- return !0;
510
- const { status: e, headers: s } = t;
511
- return s?.server === "TencentEdgeOne" ? e === 522 || e === 552 : !1;
507
+ function de({ status: t, headers: e, statusText: s }) {
508
+ return s == w.NetworkError ? !0 : e?.server === "TencentEdgeOne" ? t === 522 || t === 552 : !1;
512
509
  }
513
- function $e(t, e, s, n) {
514
- const r = t.status, o = t.method, a = le(
510
+ function Te(t, e, s, n) {
511
+ const r = t.status, o = t.method, a = he(
515
512
  Object.entries(t.headers || {}).map(([d, m]) => [d.toLowerCase(), m])
516
- ), { ok: i, code: c, data: g, message: u } = se(
513
+ ), { ok: i, code: c, data: g, message: u } = te(
517
514
  r,
518
515
  t.statusText,
519
516
  t.body,
520
517
  s.get("responseRule"),
521
518
  n?.responseRule
522
519
  );
523
- if (!L(r)) {
524
- const d = he({
520
+ if (!S(r)) {
521
+ const d = ue({
525
522
  url: t.url,
526
523
  method: t.method,
527
524
  status: r,
@@ -575,7 +572,7 @@ function E(t) {
575
572
  return t.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/<[^>]+>/g, "").trim();
576
573
  }
577
574
  async function me(t, e, s, n, r) {
578
- const o = r || 0, a = Math.max(0, Math.min(10, n?.maxRetry ?? s.get("maxRetry") ?? 0)), i = fe(n?.retryResolve ?? s.get("retryResolve")), c = s.get("logHandler");
575
+ const o = r || 0, a = Math.max(0, Math.min(10, n?.maxRetry ?? s.get("maxRetry") ?? 0)), i = le(n?.retryResolve ?? s.get("retryResolve")), c = s.get("logHandler");
579
576
  c?.({
580
577
  type: "prepare",
581
578
  url: e,
@@ -600,7 +597,7 @@ async function me(t, e, s, n, r) {
600
597
  }), !a || o >= a || i(u, o) !== !0)
601
598
  return u;
602
599
  const m = n?.retryInterval ?? s.get("retryInterval") ?? 100;
603
- return await H(
600
+ return await q(
604
601
  Math.max(
605
602
  100,
606
603
  m === "2EB" ? Math.pow(2, o) * 100 : typeof m == "function" ? m(o + 1, { url: e, status: h, method: u.method }) || 0 : m
@@ -608,20 +605,20 @@ async function me(t, e, s, n, r) {
608
605
  ), await me(t, e, s, n, o + 1);
609
606
  }
610
607
  export {
611
- P as E,
612
- Re as H,
613
- ke as N,
614
- Y as R,
608
+ D as E,
609
+ ke as H,
610
+ Re as N,
611
+ Q as R,
615
612
  pe as X,
616
613
  w as a,
617
614
  ye as b,
618
615
  je as c,
619
616
  we as d,
620
- le as f,
621
- Te as g,
622
- $e as h,
617
+ he as f,
618
+ $e as g,
619
+ Te as h,
623
620
  be as i,
624
- T as n,
621
+ $ as n,
625
622
  me as r,
626
623
  Ee as v
627
624
  };
package/dist/wx.js CHANGED
@@ -1,5 +1,5 @@
1
- import { h as i, r as p, c as f, H as l, E as h, a as d, i as y, N as g } from "./retry-DodVI8cA.js";
2
- import { g as E } from "./retry-DodVI8cA.js";
1
+ import { h as i, r as p, c as f, H as l, E as h, a as d, i as y, N as g } from "./retry-Cxkf8ke1.js";
2
+ import { g as E } from "./retry-Cxkf8ke1.js";
3
3
  const m = async function(t, n, r) {
4
4
  return i(await p(x, t, n, r), t, n, r);
5
5
  }, x = async function(t, n, r) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/request",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "description": "request tools for seayoo web",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",