@acrool/react-fetcher 0.0.4-test.2 → 0.0.4-test.4

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.
@@ -84,22 +84,22 @@ function Gt(e) {
84
84
  }
85
85
  var de = /* @__PURE__ */ ((e) => (e.formData = "multipart/form-data", e.formUrlDecode = "application/x-www-form-urlencoded", e.json = "application/json", e))(de || {}), Zt = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE", e.PATCH = "PATCH", e))(Zt || {});
86
86
  const Qt = (e, t = {}) => [de.formData, de.formUrlDecode].includes(e) ? Gt(t) : JSON.stringify(t), en = (e) => de.json, Vr = (e, t, n = en) => async (r) => {
87
- var u, p, y;
88
- const s = (t == null ? void 0 : t.method) || "", o = r == null ? void 0 : r.fetchOptions, i = (u = r == null ? void 0 : r.variables) == null ? void 0 : u.params, c = ((p = o == null ? void 0 : o.headers) == null ? void 0 : p.contentType) ?? n(s.toUpperCase()), d = {
87
+ var p;
88
+ const s = (t == null ? void 0 : t.method) || "", o = r == null ? void 0 : r.fetchOptions, i = typeof r == "object" && r !== null && "variables" in r ? r.variables : void 0, c = i == null ? void 0 : i.params, d = ((p = o == null ? void 0 : o.headers) == null ? void 0 : p.contentType) ?? n(s.toUpperCase()), l = {
89
89
  url: t.url,
90
90
  method: s,
91
- params: i,
92
- data: Qt(c, (y = r == null ? void 0 : r.variables) == null ? void 0 : y.body),
91
+ params: c,
92
+ data: Qt(d, i == null ? void 0 : i.body),
93
93
  ...o,
94
94
  headers: {
95
95
  ...o == null ? void 0 : o.headers,
96
- "Content-Type": c
96
+ "Content-Type": d
97
97
  }
98
- }, [l] = await Promise.all([
99
- e(d),
98
+ }, [u] = await Promise.all([
99
+ e(l),
100
100
  dt((o == null ? void 0 : o.leastTime) ?? pt)
101
101
  ]);
102
- return l.data;
102
+ return u.data;
103
103
  };
104
104
  var ce = { exports: {} }, Z = {};
105
105
  /**
@@ -7,5 +7,5 @@ import { IDocument, IUseRestFulFetcherArgs, TContentTypeResolver, TFileMapVariab
7
7
  * @param document
8
8
  * @param contentTypeResolver
9
9
  */
10
- declare const createRestFulFetcher: <TData, TArgs extends IUseRestFulFetcherArgs<TFileMapVariables>>(axiosInstance: AxiosInstance, document: IDocument, contentTypeResolver?: TContentTypeResolver) => ((args?: TArgs) => Promise<TData>);
10
+ declare const createRestFulFetcher: <TData, TArgs extends IUseRestFulFetcherArgs<TFileMapVariables | void>>(axiosInstance: AxiosInstance, document: IDocument, contentTypeResolver?: TContentTypeResolver) => ((args?: TArgs) => Promise<TData>);
11
11
  export default createRestFulFetcher;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrool/react-fetcher",
3
- "version": "0.0.4-test.2",
3
+ "version": "0.0.4-test.4",
4
4
  "description": "Fetcher library based for Reactjs",
5
5
  "keywords": [
6
6
  "acrool",