@vtj/utils 0.7.29 → 0.7.31

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/utils",
3
3
  "private": false,
4
- "version": "0.7.29",
4
+ "version": "0.7.31",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vue-tsc && vite build && npm run build:umd",
@@ -11,11 +11,11 @@
11
11
  "coverage": "vitest run --coverage"
12
12
  },
13
13
  "dependencies": {
14
- "@vtj/base": "^0.7.7"
14
+ "@vtj/base": "^0.7.8"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/js-cookie": "~3.0.6",
18
- "@vtj/cli": "^0.7.19",
18
+ "@vtj/cli": "^0.7.21",
19
19
  "axios": "~1.6.8",
20
20
  "fetch-jsonp": "~1.3.0",
21
21
  "js-cookie": "~3.0.5",
@@ -35,7 +35,7 @@
35
35
  "dist",
36
36
  "types"
37
37
  ],
38
- "gitHead": "051c91898082b0e954af310f9cfcd794a2cb84c2",
38
+ "gitHead": "eec8b5817a66b57a3d068eae6a9912a9b199346e",
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  }
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  export { version as VTJ_UTILS_VERSION } from './version';
2
3
  export * from './base';
3
4
  export * from './request';
package/types/jsonp.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import fetchJsonp from 'fetch-jsonp';
1
+ import { default as fetchJsonp } from 'fetch-jsonp';
2
+
2
3
  export interface FetchJsonpOptions extends fetchJsonp.Options {
3
4
  query?: Record<string, any>;
4
5
  }
@@ -1,6 +1,6 @@
1
1
  import { Ref, UnwrapRef } from 'vue';
2
- import axios from 'axios';
3
- import type { AxiosInstance, CreateAxiosDefaults, AxiosResponse, AxiosRequestConfig, RawAxiosRequestHeaders, InternalAxiosRequestConfig, CancelTokenSource } from 'axios';
2
+ import { default as axios, AxiosInstance, CreateAxiosDefaults, AxiosResponse, AxiosRequestConfig, RawAxiosRequestHeaders, InternalAxiosRequestConfig, CancelTokenSource } from 'axios';
3
+
4
4
  declare const LOCAL_REQUEST_ID = "Local-Request-Id";
5
5
  export interface IRequestSkipWarn {
6
6
  executor: (resolve: (value: unknown) => void, reject: (reason?: any) => void) => void;
@@ -123,7 +123,7 @@ export interface IApiMap {
123
123
  }
124
124
  export declare function createApis(map: IApiMap): Record<string, (data?: unknown, opts?: IRequestConfig<any> | undefined) => Promise<unknown>>;
125
125
  export declare function useApi<R = any>(api: Promise<R>, transform?: (res: any) => R): {
126
- data: Ref<UnwrapRef<R> | null>;
126
+ data: Ref< UnwrapRef<R> | null>;
127
127
  error: Ref<any>;
128
128
  loading: Ref<boolean>;
129
129
  };
package/types/util.d.ts CHANGED
@@ -8,3 +8,9 @@ export declare const isClient: boolean;
8
8
  * @returns
9
9
  */
10
10
  export declare const fileToBase64: (file: File) => Promise<unknown>;
11
+ /**
12
+ * FormData 转换为json
13
+ * @param data
14
+ * @returns
15
+ */
16
+ export declare function formDataToJson(data: FormData): Record<string, any>;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/utils
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.7.29
5
+ * @version 0.7.31
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.7.29";
8
+ export declare const version = "0.7.31";