@superutils/fetch 1.2.3 → 1.4.1

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.
Files changed (4) hide show
  1. package/README.md +97 -100
  2. package/dist/index.d.ts +275 -157
  3. package/dist/index.js +188 -172
  4. package/package.json +6 -5
package/dist/index.js CHANGED
@@ -1,21 +1,24 @@
1
1
  // src/createClient.ts
2
- import PromisE3 from "@superutils/promise";
2
+ import { deferredCallback } from "@superutils/promise";
3
3
 
4
4
  // src/fetch.ts
5
5
  import {
6
6
  fallbackIfFails as fallbackIfFails3,
7
+ isError,
7
8
  isFn as isFn2,
8
- isPositiveNumber,
9
9
  isPromise,
10
10
  isUrlValid
11
11
  } from "@superutils/core";
12
- import PromisE2 from "@superutils/promise";
12
+ import {
13
+ timeout as PromisE_timeout
14
+ } from "@superutils/promise";
13
15
 
14
16
  // src/executeInterceptors.ts
15
17
  import { fallbackIfFails, isFn } from "@superutils/core";
16
- var executeInterceptors = async (value, interceptors, ...args) => {
18
+ var executeInterceptors = async (value, signal, interceptors, ...args) => {
17
19
  var _a;
18
20
  for (const interceptor of [...interceptors != null ? interceptors : []].filter(isFn)) {
21
+ if (signal == null ? void 0 : signal.aborted) return value;
19
22
  value = (_a = await fallbackIfFails(
20
23
  interceptor,
21
24
  [value, ...args],
@@ -26,33 +29,15 @@ var executeInterceptors = async (value, interceptors, ...args) => {
26
29
  };
27
30
  var executeInterceptors_default = executeInterceptors;
28
31
 
29
- // src/getAbortCtrl.ts
30
- var getAbortCtrl = (options) => {
31
- options != null ? options : options = {};
32
- if (!(options.abortCtrl instanceof AbortController))
33
- options.abortCtrl = new AbortController();
34
- const { abortCtrl, signal } = options;
35
- if (signal instanceof AbortSignal && !signal.aborted) {
36
- const handleAbort = () => abortCtrl.abort();
37
- signal.addEventListener("abort", handleAbort, { once: true });
38
- abortCtrl.signal.addEventListener(
39
- "abort",
40
- () => signal.removeEventListener("abort", handleAbort),
41
- { once: true }
42
- );
43
- }
44
- return abortCtrl;
45
- };
46
-
47
32
  // src/getResponse.ts
48
33
  import { fallbackIfFails as fallbackIfFails2, isPositiveInteger } from "@superutils/core";
49
- import PromisE from "@superutils/promise";
50
- var getResponse = async (url, options = {}) => {
51
- const fetchFunc = globalThis.fetch;
52
- if (!isPositiveInteger(options.retry))
53
- return fetchFunc(url, options);
34
+ import { retry } from "@superutils/promise";
35
+ var getResponse = (url, options = {}) => {
36
+ var _a;
37
+ const fetchFunc = (_a = options.fetchFunc) != null ? _a : globalThis.fetch;
38
+ if (!isPositiveInteger(options.retry)) return fetchFunc(url, options);
54
39
  let attemptCount = 0;
55
- const response = PromisE.retry(
40
+ const response = retry(
56
41
  () => {
57
42
  attemptCount++;
58
43
  return fetchFunc(url, options);
@@ -60,13 +45,14 @@ var getResponse = async (url, options = {}) => {
60
45
  {
61
46
  ...options,
62
47
  retryIf: async (res, count, error) => {
63
- var _a, _b;
64
- const failed = !!error || !(res == null ? void 0 : res.ok);
65
- return !!((_b = await fallbackIfFails2(
66
- (_a = options == null ? void 0 : options.retryIf) != null ? _a : failed,
48
+ var _a2;
49
+ const { abortCtrl, retryIf, signal } = options;
50
+ if ((abortCtrl == null ? void 0 : abortCtrl.signal.aborted) || (signal == null ? void 0 : signal.aborted)) return false;
51
+ return !!((_a2 = await fallbackIfFails2(
52
+ retryIf,
67
53
  [res, count, error],
68
- failed
69
- )) != null ? _b : failed);
54
+ void 0
55
+ )) != null ? _a2 : !!error || !(res == null ? void 0 : res.ok));
70
56
  }
71
57
  }
72
58
  ).catch(
@@ -84,7 +70,7 @@ var getResponse_default = getResponse;
84
70
  import { isEmpty, isObj, objKeys } from "@superutils/core";
85
71
  var mergeFetchOptions = (...allOptions) => allOptions.reduce(
86
72
  (merged, next) => {
87
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
73
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
88
74
  next = isObj(next) ? next : {};
89
75
  const { errMsgs = {}, headers, interceptors: ints1 = {} } = merged;
90
76
  const { errMsgs: msgs2 = {}, interceptors: ints2 = {} } = next;
@@ -114,7 +100,7 @@ var mergeFetchOptions = (...allOptions) => allOptions.reduce(
114
100
  ...(_h = ints2 == null ? void 0 : ints2.result) != null ? _h : []
115
101
  ]
116
102
  },
117
- timeout: (_j = (_i = next.timeout) != null ? _i : merged.timeout) != null ? _j : 0
103
+ timeout: (_i = next.timeout) != null ? _i : merged.timeout
118
104
  };
119
105
  },
120
106
  { headers: new Headers() }
@@ -125,11 +111,7 @@ var mergePartialOptions = (...optionsAr) => {
125
111
  return optionsAr.length <= 1 ? optionsAr[0] : mergeFetchOptions(...optionsAr);
126
112
  };
127
113
 
128
- // src/types.ts
129
- import {
130
- ResolveError,
131
- ResolveIgnored
132
- } from "@superutils/promise";
114
+ // src/types/constants.ts
133
115
  var ContentType = {
134
116
  APPLICATION_JAVASCRIPT: "application/javascript",
135
117
  APPLICATION_JSON: "application/json",
@@ -155,54 +137,97 @@ var FetchAs = /* @__PURE__ */ ((FetchAs2) => {
155
137
  FetchAs2["text"] = "text";
156
138
  return FetchAs2;
157
139
  })(FetchAs || {});
140
+
141
+ // src/types/FetchError.ts
158
142
  var FetchError = class _FetchError extends Error {
159
143
  constructor(message, options) {
160
144
  super(message, { cause: options.cause });
161
- this.clone = (newMessage) => new _FetchError(newMessage, {
162
- cause: this.cause,
163
- options: this.options,
164
- response: this.response,
165
- url: this.url
166
- });
167
145
  this.name = "FetchError";
168
- this.options = options.options;
169
- this.response = options.response;
170
- this.url = options.url;
146
+ Object.defineProperties(this, {
147
+ clone: {
148
+ get() {
149
+ return (newMessage) => new _FetchError(newMessage, {
150
+ cause: options.cause,
151
+ options: options.options,
152
+ response: options.response,
153
+ url: options.url
154
+ });
155
+ }
156
+ },
157
+ options: {
158
+ get() {
159
+ return options.options;
160
+ }
161
+ },
162
+ response: {
163
+ get() {
164
+ return options.response;
165
+ }
166
+ },
167
+ url: {
168
+ get() {
169
+ return options.url;
170
+ }
171
+ }
172
+ });
171
173
  }
172
174
  };
173
175
 
176
+ // src/types/options.ts
177
+ import {
178
+ ResolveError,
179
+ ResolveIgnored
180
+ } from "@superutils/promise";
181
+
174
182
  // src/fetch.ts
183
+ var MAX_TIMEOUT = 2147483647;
175
184
  var fetch = (url, options = {}) => {
176
- let timeoutId;
177
- const abortCtrl = getAbortCtrl(options);
178
- const promise = new PromisE2(async (resolve, reject) => {
179
- var _a, _b, _c;
180
- let errResponse;
181
- const _options = mergeFetchOptions_default(fetch.defaults, options);
182
- (_a = _options.as) != null ? _a : _options.as = "json" /* json */;
183
- (_b = _options.method) != null ? _b : _options.method = "get";
184
- let contentType = _options.headers.get("content-type");
185
- if (!contentType) {
186
- _options.headers.set("content-type", ContentType.APPLICATION_JSON);
187
- contentType = ContentType.APPLICATION_JSON;
185
+ var _a, _b, _c;
186
+ let response;
187
+ const opts = mergeFetchOptions_default(fetch.defaults, options);
188
+ opts.abortCtrl = opts.abortCtrl instanceof AbortController ? opts.abortCtrl : new AbortController();
189
+ (_a = opts.as) != null ? _a : opts.as = "json" /* json */;
190
+ (_b = opts.method) != null ? _b : opts.method = "get";
191
+ (_c = opts.signal) != null ? _c : opts.signal = opts.abortCtrl.signal;
192
+ const { abortCtrl, as: parseAs, headers, onAbort, onTimeout } = opts;
193
+ opts.onAbort = async () => {
194
+ var _a2, _b2, _c2, _d, _e, _f;
195
+ const err = (_f = (_e = (_c2 = await fallbackIfFails3(onAbort, [], void 0)) != null ? _c2 : (_b2 = (_a2 = opts.abortCtrl) == null ? void 0 : _a2.signal) == null ? void 0 : _b2.reason) != null ? _e : (_d = opts.signal) == null ? void 0 : _d.reason) != null ? _f : opts.errMsgs.aborted;
196
+ if (isError(err) && err.name === "AbortError") {
197
+ err.message = ["This operation was aborted"].includes(err.message) ? opts.errMsgs.aborted : err.message;
188
198
  }
189
- url = await executeInterceptors_default(
199
+ return await interceptErr(
200
+ isError(err) ? err : new Error(err),
190
201
  url,
191
- _options.interceptors.request,
192
- _options
202
+ opts,
203
+ response
193
204
  );
194
- const {
195
- as: parseAs,
196
- body,
197
- errMsgs,
198
- timeout,
199
- validateUrl = true
200
- } = _options;
201
- if (isPositiveNumber(timeout)) {
202
- timeoutId = setTimeout(() => abortCtrl.abort(), timeout);
203
- }
204
- if (_options.abortCtrl) _options.signal = _options.abortCtrl.signal;
205
+ };
206
+ opts.onTimeout = async () => {
207
+ const err = await fallbackIfFails3(onTimeout, [], void 0);
208
+ return await interceptErr(
209
+ err != null ? err : new Error(opts.errMsgs.timedout),
210
+ url,
211
+ opts,
212
+ response
213
+ );
214
+ };
215
+ return PromisE_timeout(opts, async () => {
216
+ var _a2, _b2, _c2, _d;
205
217
  try {
218
+ let contentType = headers.get("content-type");
219
+ if (!contentType) {
220
+ headers.set("content-type", ContentType.APPLICATION_JSON);
221
+ contentType = ContentType.APPLICATION_JSON;
222
+ }
223
+ url = await executeInterceptors_default(
224
+ url,
225
+ abortCtrl.signal,
226
+ (_a2 = opts.interceptors) == null ? void 0 : _a2.request,
227
+ opts
228
+ );
229
+ const { body, errMsgs, validateUrl = true } = opts;
230
+ (_b2 = opts.signal) != null ? _b2 : opts.signal = abortCtrl.signal;
206
231
  if (validateUrl && !isUrlValid(url, false))
207
232
  throw new Error(errMsgs.invalidUrl);
208
233
  const shouldStringifyBody = [
@@ -210,99 +235,94 @@ var fetch = (url, options = {}) => {
210
235
  ContentType.APPLICATION_X_WWW_FORM_URLENCODED
211
236
  ].find((x) => contentType.includes(x)) && !["undefined", "string"].includes(typeof body);
212
237
  if (shouldStringifyBody)
213
- _options.body = JSON.stringify(
238
+ opts.body = JSON.stringify(
214
239
  isFn2(body) ? fallbackIfFails3(body, [], void 0) : body
215
240
  );
216
- let response = await getResponse_default(url, _options);
241
+ response = await getResponse_default(url, opts);
217
242
  response = await executeInterceptors_default(
218
243
  response,
219
- _options.interceptors.response,
244
+ abortCtrl.signal,
245
+ (_c2 = opts.interceptors) == null ? void 0 : _c2.response,
220
246
  url,
221
- _options
247
+ opts
222
248
  );
223
- errResponse = response;
224
249
  const { status = 0 } = response;
225
250
  const isSuccess = status >= 200 && status < 300;
226
251
  if (!isSuccess) {
227
- const fallbackMsg = `${errMsgs.requestFailed} ${status}`;
228
252
  const jsonError = await fallbackIfFails3(
229
253
  // try to parse error response as json first
230
254
  () => response.json(),
231
255
  [],
232
256
  void 0
233
257
  );
234
- const message = (jsonError == null ? void 0 : jsonError.message) || fallbackMsg;
235
- throw new Error(`${message}`.replace("Error: ", ""), {
236
- cause: jsonError
237
- });
258
+ throw new Error(
259
+ (jsonError == null ? void 0 : jsonError.message) || `${errMsgs.requestFailed} ${status}`,
260
+ { cause: jsonError }
261
+ );
238
262
  }
239
- let result = response;
240
263
  const parseFunc = response[parseAs];
241
- if (isFn2(parseFunc)) {
242
- const handleErr = (err) => {
243
- err = new Error(
244
- `${errMsgs.parseFailed} ${parseAs}. ${err == null ? void 0 : err.message}`,
245
- { cause: err }
246
- );
247
- return Promise.reject(err);
248
- };
249
- result = parseFunc.bind(response)();
250
- if (isPromise(result)) result = result.catch(handleErr);
251
- }
264
+ let result = !isFn2(parseFunc) ? response : parseFunc.bind(response)();
265
+ if (isPromise(result))
266
+ result = await result.catch(
267
+ (err) => Promise.reject(
268
+ new Error(
269
+ `${errMsgs.parseFailed} ${parseAs}. ${err == null ? void 0 : err.message}`,
270
+ { cause: err }
271
+ )
272
+ )
273
+ );
252
274
  result = await executeInterceptors_default(
253
275
  result,
254
- _options.interceptors.result,
276
+ abortCtrl.signal,
277
+ (_d = opts.interceptors) == null ? void 0 : _d.result,
255
278
  url,
256
- _options
279
+ opts
257
280
  );
258
- resolve(result);
259
- } catch (err) {
260
- const errX = err;
261
- const msg = (errX == null ? void 0 : errX.name) === "AbortError" ? errMsgs.reqTimedout : err == null ? void 0 : err.message;
262
- let error = new FetchError(msg, {
263
- cause: (_c = errX == null ? void 0 : errX.cause) != null ? _c : err,
264
- response: errResponse,
265
- options: _options,
266
- url
267
- });
268
- error = await executeInterceptors_default(
269
- error,
270
- _options.interceptors.error,
271
- url,
272
- _options
273
- );
274
- reject(error);
281
+ return result;
282
+ } catch (_err) {
283
+ let err = _err;
284
+ err = await interceptErr(_err, url, opts, response);
285
+ return Promise.reject(err);
275
286
  }
276
- timeoutId && clearTimeout(timeoutId);
277
287
  });
278
- promise.onEarlyFinalize.push(() => abortCtrl.abort());
279
- return promise;
280
288
  };
281
289
  fetch.defaults = {
290
+ abortOnEarlyFinalize: true,
282
291
  errMsgs: {
292
+ aborted: "Request aborted",
283
293
  invalidUrl: "Invalid URL",
284
294
  parseFailed: "Failed to parse response as",
285
- reqTimedout: "Request timed out",
295
+ timedout: "Request timed out",
286
296
  requestFailed: "Request failed with status code:"
287
297
  },
288
298
  // all error messages must be defined here
289
299
  headers: new Headers(),
290
- /** Global interceptors for fetch requests */
291
300
  interceptors: {
292
- /**
293
- * Global error interceptors to be invoked whenever an exception occurs
294
- * Returning an
295
- */
296
301
  error: [],
297
- /** Interceptors to be invoked before making fetch requests */
298
302
  request: [],
299
303
  response: [],
300
304
  result: []
301
305
  },
302
- /** Request timeout duration in milliseconds. Default: `0` */
303
- timeout: 0,
306
+ timeout: 3e4,
304
307
  validateUrl: true
305
308
  };
309
+ var interceptErr = async (err, url, options, response) => {
310
+ var _a, _b, _c;
311
+ const fErr = await executeInterceptors_default(
312
+ new FetchError((_a = err == null ? void 0 : err.message) != null ? _a : err, {
313
+ cause: (_b = err == null ? void 0 : err.cause) != null ? _b : err,
314
+ response,
315
+ options,
316
+ url
317
+ }),
318
+ void 0,
319
+ // should execute regardless of abort status
320
+ (_c = options.interceptors) == null ? void 0 : _c.error,
321
+ url,
322
+ options
323
+ );
324
+ return fErr;
325
+ };
306
326
  var fetch_default = fetch;
307
327
 
308
328
  // src/createClient.ts
@@ -320,23 +340,22 @@ var createClient = (fixedOptions, commonOptions, commonDeferOptions) => {
320
340
  func.deferred = (deferOptions = {}, defaultUrl, defaultOptions) => {
321
341
  let _abortCtrl;
322
342
  const fetchCb = (...args) => {
323
- var _a, _b;
324
- const options = mergePartialOptions(
343
+ var _a, _b, _c;
344
+ const options = (_a = mergePartialOptions(
325
345
  commonOptions,
326
346
  defaultOptions,
327
347
  defaultUrl === void 0 ? args[1] : args[0],
328
348
  fixedOptions
329
- );
330
- ((_a = _abortCtrl == null ? void 0 : _abortCtrl.signal) == null ? void 0 : _a.aborted) === false && ((_b = _abortCtrl == null ? void 0 : _abortCtrl.abort) == null ? void 0 : _b.call(_abortCtrl));
331
- _abortCtrl = getAbortCtrl(options);
349
+ )) != null ? _a : {};
350
+ ((_b = _abortCtrl == null ? void 0 : _abortCtrl.signal) == null ? void 0 : _b.aborted) === false && ((_c = _abortCtrl == null ? void 0 : _abortCtrl.abort) == null ? void 0 : _c.call(_abortCtrl));
351
+ _abortCtrl = new AbortController();
332
352
  const promise = fetch_default(
333
353
  defaultUrl != null ? defaultUrl : args[0],
334
354
  options
335
355
  );
336
- promise.onEarlyFinalize.push(() => _abortCtrl == null ? void 0 : _abortCtrl.abort());
337
356
  return promise;
338
357
  };
339
- return PromisE3.deferredCallback(fetchCb, {
358
+ return deferredCallback(fetchCb, {
340
359
  ...commonDeferOptions,
341
360
  ...deferOptions
342
361
  });
@@ -346,9 +365,9 @@ var createClient = (fixedOptions, commonOptions, commonDeferOptions) => {
346
365
  var createClient_default = createClient;
347
366
 
348
367
  // src/createPostClient.ts
349
- import PromisE4 from "@superutils/promise";
368
+ import { deferredCallback as deferredCallback2 } from "@superutils/promise";
350
369
  var createPostClient = (fixedOptions, commonOptions, commonDeferOptions) => {
351
- const client2 = (url, data, options) => {
370
+ const client = (url, data, options) => {
352
371
  var _a;
353
372
  const _options = mergePartialOptions(
354
373
  commonOptions,
@@ -359,36 +378,33 @@ var createPostClient = (fixedOptions, commonOptions, commonDeferOptions) => {
359
378
  (_a = _options.method) != null ? _a : _options.method = "post";
360
379
  return fetch_default(url, _options);
361
380
  };
362
- client2.deferred = (deferOptions = {}, defaultUrl, defaultData, defaultOptions) => {
381
+ client.deferred = (deferOptions = {}, defaultUrl, defaultData, defaultOptions) => {
363
382
  let _abortCtrl;
364
383
  const postCb = (...args) => {
365
- var _a, _b, _c, _d;
384
+ var _a, _b, _c, _d, _e;
366
385
  if (defaultUrl !== void 0) args.splice(0, 0, defaultUrl);
367
386
  if (defaultData !== void 0) args.splice(1, 0, defaultData);
368
- const options = mergePartialOptions(
387
+ const options = (_a = mergePartialOptions(
369
388
  commonOptions,
370
389
  defaultOptions,
371
390
  args[2],
372
391
  fixedOptions
373
- );
374
- ((_a = _abortCtrl == null ? void 0 : _abortCtrl.signal) == null ? void 0 : _a.aborted) === false && ((_b = _abortCtrl == null ? void 0 : _abortCtrl.abort) == null ? void 0 : _b.call(_abortCtrl));
375
- _abortCtrl = getAbortCtrl(options);
376
- options.body = (_c = args[1]) != null ? _c : options.body;
377
- (_d = options.method) != null ? _d : options.method = "post";
392
+ )) != null ? _a : {};
393
+ ((_b = _abortCtrl == null ? void 0 : _abortCtrl.signal) == null ? void 0 : _b.aborted) === false && ((_c = _abortCtrl == null ? void 0 : _abortCtrl.abort) == null ? void 0 : _c.call(_abortCtrl));
394
+ _abortCtrl = new AbortController();
395
+ options.body = (_d = args[1]) != null ? _d : options.body;
396
+ (_e = options.method) != null ? _e : options.method = "post";
378
397
  const promise = fetch_default(args[0], options);
379
- promise.onEarlyFinalize.push(() => _abortCtrl == null ? void 0 : _abortCtrl.abort());
380
398
  return promise;
381
399
  };
382
- return PromisE4.deferredCallback(postCb, {
400
+ return deferredCallback2(postCb, {
383
401
  ...commonDeferOptions,
384
402
  ...deferOptions
385
403
  });
386
404
  };
387
- return client2;
405
+ return client;
388
406
  };
389
407
  var createPostClient_default = createPostClient;
390
- var client = createPostClient();
391
- client.deferred();
392
408
 
393
409
  // src/fetchResponse.ts
394
410
  var fetchResponse = (url, options) => {
@@ -397,9 +413,18 @@ var fetchResponse = (url, options) => {
397
413
  (_a = options.as) != null ? _a : options.as = "response" /* response */;
398
414
  return fetch_default(url, options);
399
415
  };
416
+ fetchResponse.defaults = fetch_default.defaults;
417
+ Object.defineProperty(fetchResponse, "defaults", {
418
+ get() {
419
+ return fetch_default.defaults;
420
+ },
421
+ set(newDefaults) {
422
+ fetch_default.defaults = newDefaults;
423
+ }
424
+ });
400
425
  var fetchResponse_default = fetchResponse;
401
426
 
402
- // src/fetchDefault.ts
427
+ // src/defaultFetch.ts
403
428
  var methods = {
404
429
  /** Make HTTP requests with method GET */
405
430
  get: createClient_default({ method: "get" }),
@@ -416,31 +441,23 @@ var methods = {
416
441
  /** Make HTTP requests with method PUT */
417
442
  put: createPostClient_default({ method: "put" })
418
443
  };
419
- var fetchDefault = fetchResponse_default;
420
- Object.defineProperty(fetchDefault, "defaults", {
421
- get() {
422
- return fetch_default.defaults;
423
- },
424
- set(newDefaults) {
425
- fetch_default.defaults = newDefaults;
426
- }
427
- });
428
- fetchDefault.delete = methods.delete;
429
- fetchDefault.get = methods.get;
430
- fetchDefault.head = methods.head;
431
- fetchDefault.options = methods.options;
432
- fetchDefault.patch = methods.patch;
433
- fetchDefault.post = methods.post;
434
- fetchDefault.put = methods.put;
435
- var fetchDefault_default = fetchDefault;
444
+ var defaultFetch = fetchResponse_default;
445
+ defaultFetch.delete = methods.delete;
446
+ defaultFetch.get = methods.get;
447
+ defaultFetch.head = methods.head;
448
+ defaultFetch.options = methods.options;
449
+ defaultFetch.patch = methods.patch;
450
+ defaultFetch.post = methods.post;
451
+ defaultFetch.put = methods.put;
452
+ var defaultFetch_default = defaultFetch;
436
453
 
437
454
  // src/index.ts
438
- var index_default = fetchDefault_default;
439
- fetchDefault_default.get;
455
+ var index_default = defaultFetch_default;
440
456
  export {
441
457
  ContentType,
442
458
  FetchAs,
443
459
  FetchError,
460
+ MAX_TIMEOUT,
444
461
  ResolveError,
445
462
  ResolveIgnored,
446
463
  createClient,
@@ -449,7 +466,6 @@ export {
449
466
  executeInterceptors,
450
467
  fetch,
451
468
  fetchResponse,
452
- getAbortCtrl,
453
469
  getResponse,
454
470
  mergeFetchOptions,
455
471
  mergePartialOptions
package/package.json CHANGED
@@ -5,8 +5,8 @@
5
5
  },
6
6
  "description": "A lightweight `fetch` wrapper for browsers and Node.js, designed to simplify data fetching and reduce boilerplate.",
7
7
  "dependencies": {
8
- "@superutils/core": "^1.1.6",
9
- "@superutils/promise": "^1.1.6"
8
+ "@superutils/core": "^1.2.1",
9
+ "@superutils/promise": "^1.2.1"
10
10
  },
11
11
  "files": [
12
12
  "dist",
@@ -24,8 +24,8 @@
24
24
  "main": "dist/index.js",
25
25
  "name": "@superutils/fetch",
26
26
  "peerDependencies": {
27
- "@superutils/core": "^1.1.6",
28
- "@superutils/promise": "^1.1.6"
27
+ "@superutils/core": "^1.2.0",
28
+ "@superutils/promise": "^1.2.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"
@@ -45,5 +45,6 @@
45
45
  "sideEffects": false,
46
46
  "type": "module",
47
47
  "types": "dist/index.d.ts",
48
- "version": "1.2.3"
48
+ "version": "1.4.1",
49
+ "gitHead": "a26f4b1bb701d99d4cb71443e18680ee3ea52974"
49
50
  }