@fangzhongya/utils 0.0.74 → 0.0.77

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 (61) hide show
  1. package/dist/basic/index.cjs +6 -5
  2. package/dist/basic/index.d.cts +2 -1
  3. package/dist/basic/index.d.ts +2 -1
  4. package/dist/basic/index.js +5 -4
  5. package/dist/basic/string/getExports.cjs +12 -0
  6. package/dist/basic/string/getExports.d.cts +16 -0
  7. package/dist/basic/string/getExports.d.ts +16 -0
  8. package/dist/basic/string/getExports.js +12 -0
  9. package/dist/basic/string/index.cjs +10 -2
  10. package/dist/basic/string/index.d.cts +1 -0
  11. package/dist/basic/string/index.d.ts +1 -0
  12. package/dist/basic/string/index.js +9 -1
  13. package/dist/{chunk-MKAI4SMJ.cjs → chunk-2IDKKVEA.cjs} +2 -2
  14. package/dist/chunk-4KYAGDPN.js +150 -0
  15. package/dist/chunk-ASGZ2VD6.cjs +150 -0
  16. package/dist/{chunk-WWAVGLQE.js → chunk-CY2RRXP5.js} +8 -0
  17. package/dist/chunk-EFP5GI25.cjs +186 -0
  18. package/dist/chunk-FDAJOMW5.js +186 -0
  19. package/dist/{chunk-2AZDXCHJ.js → chunk-FXZQXYYH.js} +37 -15
  20. package/dist/{chunk-BV6LMCAF.cjs → chunk-G6O3Z6MX.cjs} +8 -0
  21. package/dist/{chunk-YQETDPCJ.js → chunk-NGZ6KFQR.js} +1 -1
  22. package/dist/{chunk-FL2HPQ66.cjs → chunk-UHKL2RG3.cjs} +5 -5
  23. package/dist/{chunk-MDSCUXDF.cjs → chunk-UPW5FHFQ.cjs} +30 -8
  24. package/dist/{chunk-X44UO4CZ.js → chunk-YKNGDK4I.js} +4 -4
  25. package/dist/{index-CGsG3tMc.d.ts → index-BKbw-_J6.d.ts} +1 -1
  26. package/dist/{index-CRh3wZkY.d.ts → index-BkNPwlhS.d.ts} +5 -1
  27. package/dist/{index-BMhmeVcw.d.cts → index-C1ttB6pd.d.cts} +1 -1
  28. package/dist/index-DK_46i9o.d.ts +41 -0
  29. package/dist/index-DfCeIUKr.d.cts +41 -0
  30. package/dist/{index-BmGaGt2M.d.cts → index-JauNNBr7.d.cts} +5 -1
  31. package/dist/index.cjs +34 -33
  32. package/dist/index.d.cts +4 -3
  33. package/dist/index.d.ts +4 -3
  34. package/dist/index.js +35 -34
  35. package/dist/judge/index.cjs +6 -6
  36. package/dist/judge/index.js +5 -5
  37. package/dist/judge/matchs.cjs +3 -3
  38. package/dist/judge/matchs.js +2 -2
  39. package/dist/tree/index.cjs +3 -3
  40. package/dist/tree/index.js +6 -6
  41. package/dist/urls/index.cjs +13 -13
  42. package/dist/urls/index.js +16 -16
  43. package/dist/window/getParam.cjs +24 -2
  44. package/dist/window/getParam.d.cts +73 -2
  45. package/dist/window/getParam.d.ts +73 -2
  46. package/dist/window/getParam.js +25 -3
  47. package/dist/window/index.cjs +28 -6
  48. package/dist/window/index.d.cts +1 -1
  49. package/dist/window/index.d.ts +1 -1
  50. package/dist/window/index.js +38 -16
  51. package/package.json +6 -1
  52. package/dist/chunk-MCT2IB67.js +0 -35
  53. package/dist/chunk-ZRO5GHYV.cjs +0 -35
  54. package/dist/index-B8ZJILol.d.cts +0 -30
  55. package/dist/index-DGgeqhym.d.ts +0 -30
  56. package/dist/{chunk-PV2N6PF2.cjs → chunk-APRM3ELY.cjs} +2 -2
  57. package/dist/{chunk-7GCUYESU.cjs → chunk-AU3BKC3U.cjs} +12 -12
  58. package/dist/{chunk-OVHYLUAS.js → chunk-QUIZWAFR.js} +5 -5
  59. package/dist/{chunk-3YUI42XN.cjs → chunk-T22I7TJQ.cjs} +3 -3
  60. package/dist/{chunk-33X65PQS.js → chunk-T2QKEABG.js} +3 -3
  61. package/dist/{chunk-3DUFQKFF.js → chunk-UIVSKRGG.js} +15 -15
@@ -1,23 +1,8 @@
1
- import "../chunk-3DUFQKFF.js";
2
- import {
3
- getSuffix
4
- } from "../chunk-Z7NTQAAJ.js";
5
- import {
6
- getUrlCatalogue
7
- } from "../chunk-WZUEX7IR.js";
8
- import {
9
- getUrlCatalogueLast
10
- } from "../chunk-7KGS6354.js";
1
+ import "../chunk-UIVSKRGG.js";
11
2
  import {
12
3
  toUrlParam,
13
4
  toUrlParams
14
5
  } from "../chunk-I5IL3OO7.js";
15
- import {
16
- getImportUrlSuffix
17
- } from "../chunk-NWIJYHAJ.js";
18
- import {
19
- getImportUrl
20
- } from "../chunk-KDOS4NFR.js";
21
6
  import {
22
7
  getNewFileName
23
8
  } from "../chunk-GHTDWIJ5.js";
@@ -36,6 +21,21 @@ import {
36
21
  import {
37
22
  getReplaceUrls
38
23
  } from "../chunk-GHJWTV6H.js";
24
+ import {
25
+ getSuffix
26
+ } from "../chunk-Z7NTQAAJ.js";
27
+ import {
28
+ getUrlCatalogue
29
+ } from "../chunk-WZUEX7IR.js";
30
+ import {
31
+ getUrlCatalogueLast
32
+ } from "../chunk-7KGS6354.js";
33
+ import {
34
+ getImportUrlSuffix
35
+ } from "../chunk-NWIJYHAJ.js";
36
+ import {
37
+ getImportUrl
38
+ } from "../chunk-KDOS4NFR.js";
39
39
  import "../chunk-USIMBBLW.js";
40
40
  import "../chunk-P7AWHISY.js";
41
41
  import "../chunk-LPMR5W6M.js";
@@ -3,11 +3,33 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkZRO5GHYVcjs = require('../chunk-ZRO5GHYV.cjs');
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkEFP5GI25cjs = require('../chunk-EFP5GI25.cjs');
7
18
  require('../chunk-75ZPJI57.cjs');
8
19
 
9
20
 
10
21
 
11
22
 
12
23
 
13
- exports.getAllParams = _chunkZRO5GHYVcjs.getAllParams; exports.getParam = _chunkZRO5GHYVcjs.getParam; exports.getUrlParam = _chunkZRO5GHYVcjs.getUrlParam; exports.getUrlParams = _chunkZRO5GHYVcjs.getUrlParams;
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+ exports.buildQueryString = _chunkEFP5GI25cjs.buildQueryString; exports.buildUrl = _chunkEFP5GI25cjs.buildUrl; exports.getAllParams = _chunkEFP5GI25cjs.getAllParams; exports.getCurrentUrlParam = _chunkEFP5GI25cjs.getCurrentUrlParam; exports.getCurrentUrlParams = _chunkEFP5GI25cjs.getCurrentUrlParams; exports.getHashParam = _chunkEFP5GI25cjs.getHashParam; exports.getParam = _chunkEFP5GI25cjs.getParam; exports.getQueryParam = _chunkEFP5GI25cjs.getQueryParam; exports.getUrlParam = _chunkEFP5GI25cjs.getUrlParam; exports.getUrlParams = _chunkEFP5GI25cjs.getUrlParams; exports.isQueryString = _chunkEFP5GI25cjs.isQueryString; exports.isValidUrl = _chunkEFP5GI25cjs.isValidUrl; exports.parseHashParams = _chunkEFP5GI25cjs.parseHashParams; exports.parseQueryString = _chunkEFP5GI25cjs.parseQueryString; exports.parseUrlParams = _chunkEFP5GI25cjs.parseUrlParams;
@@ -1,9 +1,80 @@
1
+ /**
2
+ * 从完整URL中解析查询参数
3
+ * @param url - 完整的URL字符串
4
+ * @returns 解析后的参数对象
5
+ */
6
+ declare function parseUrlParams(url: string): Record<string, string>;
7
+ /**
8
+ * 从完整URL中获取指定参数
9
+ * @param url - 完整的URL字符串
10
+ * @param name - 参数名
11
+ * @returns 参数值或null
12
+ */
13
+ declare function getUrlParam(url: string, name: string): string | null;
14
+ /**
15
+ * 构建带查询参数的URL
16
+ * @param baseUrl - 基础URL
17
+ * @param params - 参数对象
18
+ * @returns 构建后的完整URL
19
+ */
20
+ declare function buildUrl(baseUrl: string, params: Record<string, string | number>): string;
21
+ /**
22
+ * 解析查询字符串(可以是 ?id=1&name=test 或 id=1&name=test 格式)
23
+ * @param queryString - 查询字符串
24
+ * @returns 解析后的参数对象
25
+ */
26
+ declare function parseQueryString(queryString: string): Record<string, string>;
27
+ /**
28
+ * 从查询字符串中获取指定参数
29
+ * @param queryString - 查询字符串
30
+ * @param name - 参数名
31
+ * @returns 参数值或null
32
+ */
33
+ declare function getQueryParam(queryString: string, name: string): string | null;
34
+ /**
35
+ * 将参数对象转换为查询字符串
36
+ * @param params - 参数对象
37
+ * @param includeQuestionMark - 是否包含开头的 ? 符号
38
+ * @returns 查询字符串
39
+ */
40
+ declare function buildQueryString(params: Record<string, string | number | boolean>, includeQuestionMark?: boolean): string;
41
+ /**
42
+ * 解析hash字符串中的参数
43
+ * @param hash - hash字符串
44
+ * @returns 解析后的参数对象
45
+ */
46
+ declare function parseHashParams(hash: string): Record<string, string>;
47
+ /**
48
+ * 从hash字符串中获取指定参数
49
+ * @param hash - hash字符串
50
+ * @param name - 参数名
51
+ * @returns 参数值或null
52
+ */
53
+ declare function getHashParam(hash: string, name: string): string | null;
54
+ /**
55
+ * 获取当前页面的所有参数(包括查询参数和hash参数)
56
+ * @returns 合并后的参数对象(hash参数优先)
57
+ */
58
+ declare function getCurrentUrlParams(): Record<string, string>;
59
+ /**
60
+ * 获取当前页面的指定参数(优先从hash中获取)
61
+ * @param name - 参数名
62
+ * @returns 参数值或null
63
+ */
64
+ declare function getCurrentUrlParam(name: string): string | null;
65
+ /**
66
+ * 检查字符串是否为有效的URL
67
+ */
68
+ declare function isValidUrl(url: string): boolean;
69
+ /**
70
+ * 检查字符串是否为查询字符串格式
71
+ */
72
+ declare function isQueryString(str: string): boolean;
1
73
  /**
2
74
  * 获取url中参数
3
75
  */
4
76
  declare function getParam(URL: string): string;
5
77
  declare function getUrlParams(): URLSearchParams;
6
- declare function getUrlParam(name: string): string | null;
7
78
  declare function getAllParams(): Record<string, string>;
8
79
 
9
- export { getAllParams, getParam, getUrlParam, getUrlParams };
80
+ export { buildQueryString, buildUrl, getAllParams, getCurrentUrlParam, getCurrentUrlParams, getHashParam, getParam, getQueryParam, getUrlParam, getUrlParams, isQueryString, isValidUrl, parseHashParams, parseQueryString, parseUrlParams };
@@ -1,9 +1,80 @@
1
+ /**
2
+ * 从完整URL中解析查询参数
3
+ * @param url - 完整的URL字符串
4
+ * @returns 解析后的参数对象
5
+ */
6
+ declare function parseUrlParams(url: string): Record<string, string>;
7
+ /**
8
+ * 从完整URL中获取指定参数
9
+ * @param url - 完整的URL字符串
10
+ * @param name - 参数名
11
+ * @returns 参数值或null
12
+ */
13
+ declare function getUrlParam(url: string, name: string): string | null;
14
+ /**
15
+ * 构建带查询参数的URL
16
+ * @param baseUrl - 基础URL
17
+ * @param params - 参数对象
18
+ * @returns 构建后的完整URL
19
+ */
20
+ declare function buildUrl(baseUrl: string, params: Record<string, string | number>): string;
21
+ /**
22
+ * 解析查询字符串(可以是 ?id=1&name=test 或 id=1&name=test 格式)
23
+ * @param queryString - 查询字符串
24
+ * @returns 解析后的参数对象
25
+ */
26
+ declare function parseQueryString(queryString: string): Record<string, string>;
27
+ /**
28
+ * 从查询字符串中获取指定参数
29
+ * @param queryString - 查询字符串
30
+ * @param name - 参数名
31
+ * @returns 参数值或null
32
+ */
33
+ declare function getQueryParam(queryString: string, name: string): string | null;
34
+ /**
35
+ * 将参数对象转换为查询字符串
36
+ * @param params - 参数对象
37
+ * @param includeQuestionMark - 是否包含开头的 ? 符号
38
+ * @returns 查询字符串
39
+ */
40
+ declare function buildQueryString(params: Record<string, string | number | boolean>, includeQuestionMark?: boolean): string;
41
+ /**
42
+ * 解析hash字符串中的参数
43
+ * @param hash - hash字符串
44
+ * @returns 解析后的参数对象
45
+ */
46
+ declare function parseHashParams(hash: string): Record<string, string>;
47
+ /**
48
+ * 从hash字符串中获取指定参数
49
+ * @param hash - hash字符串
50
+ * @param name - 参数名
51
+ * @returns 参数值或null
52
+ */
53
+ declare function getHashParam(hash: string, name: string): string | null;
54
+ /**
55
+ * 获取当前页面的所有参数(包括查询参数和hash参数)
56
+ * @returns 合并后的参数对象(hash参数优先)
57
+ */
58
+ declare function getCurrentUrlParams(): Record<string, string>;
59
+ /**
60
+ * 获取当前页面的指定参数(优先从hash中获取)
61
+ * @param name - 参数名
62
+ * @returns 参数值或null
63
+ */
64
+ declare function getCurrentUrlParam(name: string): string | null;
65
+ /**
66
+ * 检查字符串是否为有效的URL
67
+ */
68
+ declare function isValidUrl(url: string): boolean;
69
+ /**
70
+ * 检查字符串是否为查询字符串格式
71
+ */
72
+ declare function isQueryString(str: string): boolean;
1
73
  /**
2
74
  * 获取url中参数
3
75
  */
4
76
  declare function getParam(URL: string): string;
5
77
  declare function getUrlParams(): URLSearchParams;
6
- declare function getUrlParam(name: string): string | null;
7
78
  declare function getAllParams(): Record<string, string>;
8
79
 
9
- export { getAllParams, getParam, getUrlParam, getUrlParams };
80
+ export { buildQueryString, buildUrl, getAllParams, getCurrentUrlParam, getCurrentUrlParams, getHashParam, getParam, getQueryParam, getUrlParam, getUrlParams, isQueryString, isValidUrl, parseHashParams, parseQueryString, parseUrlParams };
@@ -1,13 +1,35 @@
1
1
  import {
2
+ buildQueryString,
3
+ buildUrl,
2
4
  getAllParams,
5
+ getCurrentUrlParam,
6
+ getCurrentUrlParams,
7
+ getHashParam,
3
8
  getParam,
9
+ getQueryParam,
4
10
  getUrlParam,
5
- getUrlParams
6
- } from "../chunk-MCT2IB67.js";
11
+ getUrlParams,
12
+ isQueryString,
13
+ isValidUrl,
14
+ parseHashParams,
15
+ parseQueryString,
16
+ parseUrlParams
17
+ } from "../chunk-FDAJOMW5.js";
7
18
  import "../chunk-MLKGABMK.js";
8
19
  export {
20
+ buildQueryString,
21
+ buildUrl,
9
22
  getAllParams,
23
+ getCurrentUrlParam,
24
+ getCurrentUrlParams,
25
+ getHashParam,
10
26
  getParam,
27
+ getQueryParam,
11
28
  getUrlParam,
12
- getUrlParams
29
+ getUrlParams,
30
+ isQueryString,
31
+ isValidUrl,
32
+ parseHashParams,
33
+ parseQueryString,
34
+ parseUrlParams
13
35
  };
@@ -1,22 +1,21 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MDSCUXDF.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-UPW5FHFQ.cjs');
2
2
 
3
3
 
4
+ var _chunkVYOTXPMMcjs = require('../chunk-VYOTXPMM.cjs');
4
5
 
5
6
 
6
7
 
7
- var _chunkZRO5GHYVcjs = require('../chunk-ZRO5GHYV.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
+ var _chunkPW76Z25Dcjs = require('../chunk-PW76Z25D.cjs');
14
15
 
15
16
 
16
- var _chunk2HQDHQFPcjs = require('../chunk-2HQDHQFP.cjs');
17
17
 
18
18
 
19
- var _chunkVYOTXPMMcjs = require('../chunk-VYOTXPMM.cjs');
20
19
 
21
20
 
22
21
 
@@ -26,7 +25,19 @@ var _chunkVYOTXPMMcjs = require('../chunk-VYOTXPMM.cjs');
26
25
 
27
26
 
28
27
 
29
- var _chunkPW76Z25Dcjs = require('../chunk-PW76Z25D.cjs');
28
+
29
+
30
+
31
+ var _chunkEFP5GI25cjs = require('../chunk-EFP5GI25.cjs');
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+ var _chunk2HQDHQFPcjs = require('../chunk-2HQDHQFP.cjs');
30
41
  require('../chunk-75ZPJI57.cjs');
31
42
 
32
43
 
@@ -49,4 +60,15 @@ require('../chunk-75ZPJI57.cjs');
49
60
 
50
61
 
51
62
 
52
- exports.cleanupExpired = _chunk2HQDHQFPcjs.cleanupExpired; exports.clearLocal = _chunk2HQDHQFPcjs.clearLocal; exports.clearSession = _chunk2HQDHQFPcjs.clearSession; exports.copy = _chunkVYOTXPMMcjs.copy; exports.downloadCSV = _chunkPW76Z25Dcjs.downloadCSV; exports.downloadFile = _chunkPW76Z25Dcjs.downloadFile; exports.downloadFromURL = _chunkPW76Z25Dcjs.downloadFromURL; exports.downloadImage = _chunkPW76Z25Dcjs.downloadImage; exports.downloadJSON = _chunkPW76Z25Dcjs.downloadJSON; exports.downloadMultipleFiles = _chunkPW76Z25Dcjs.downloadMultipleFiles; exports.downloadText = _chunkPW76Z25Dcjs.downloadText; exports.downloadViaAJAX = _chunkPW76Z25Dcjs.downloadViaAJAX; exports.getAllParams = _chunkZRO5GHYVcjs.getAllParams; exports.getLocal = _chunk2HQDHQFPcjs.getLocal; exports.getParam = _chunkZRO5GHYVcjs.getParam; exports.getSession = _chunk2HQDHQFPcjs.getSession; exports.getUrlParam = _chunkZRO5GHYVcjs.getUrlParam; exports.getUrlParams = _chunkZRO5GHYVcjs.getUrlParams; exports.setLocal = _chunk2HQDHQFPcjs.setLocal; exports.setSession = _chunk2HQDHQFPcjs.setSession;
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ exports.buildQueryString = _chunkEFP5GI25cjs.buildQueryString; exports.buildUrl = _chunkEFP5GI25cjs.buildUrl; exports.cleanupExpired = _chunk2HQDHQFPcjs.cleanupExpired; exports.clearLocal = _chunk2HQDHQFPcjs.clearLocal; exports.clearSession = _chunk2HQDHQFPcjs.clearSession; exports.copy = _chunkVYOTXPMMcjs.copy; exports.downloadCSV = _chunkPW76Z25Dcjs.downloadCSV; exports.downloadFile = _chunkPW76Z25Dcjs.downloadFile; exports.downloadFromURL = _chunkPW76Z25Dcjs.downloadFromURL; exports.downloadImage = _chunkPW76Z25Dcjs.downloadImage; exports.downloadJSON = _chunkPW76Z25Dcjs.downloadJSON; exports.downloadMultipleFiles = _chunkPW76Z25Dcjs.downloadMultipleFiles; exports.downloadText = _chunkPW76Z25Dcjs.downloadText; exports.downloadViaAJAX = _chunkPW76Z25Dcjs.downloadViaAJAX; exports.getAllParams = _chunkEFP5GI25cjs.getAllParams; exports.getCurrentUrlParam = _chunkEFP5GI25cjs.getCurrentUrlParam; exports.getCurrentUrlParams = _chunkEFP5GI25cjs.getCurrentUrlParams; exports.getHashParam = _chunkEFP5GI25cjs.getHashParam; exports.getLocal = _chunk2HQDHQFPcjs.getLocal; exports.getParam = _chunkEFP5GI25cjs.getParam; exports.getQueryParam = _chunkEFP5GI25cjs.getQueryParam; exports.getSession = _chunk2HQDHQFPcjs.getSession; exports.getUrlParam = _chunkEFP5GI25cjs.getUrlParam; exports.getUrlParams = _chunkEFP5GI25cjs.getUrlParams; exports.isQueryString = _chunkEFP5GI25cjs.isQueryString; exports.isValidUrl = _chunkEFP5GI25cjs.isValidUrl; exports.parseHashParams = _chunkEFP5GI25cjs.parseHashParams; exports.parseQueryString = _chunkEFP5GI25cjs.parseQueryString; exports.parseUrlParams = _chunkEFP5GI25cjs.parseUrlParams; exports.setLocal = _chunk2HQDHQFPcjs.setLocal; exports.setSession = _chunk2HQDHQFPcjs.setSession;
@@ -1,4 +1,4 @@
1
1
  export { copy } from './copy.cjs';
2
2
  export { downloadCSV, downloadFile, downloadFromURL, downloadImage, downloadJSON, downloadMultipleFiles, downloadText, downloadViaAJAX } from './download.cjs';
3
- export { getAllParams, getParam, getUrlParam, getUrlParams } from './getParam.cjs';
3
+ export { buildQueryString, buildUrl, getAllParams, getCurrentUrlParam, getCurrentUrlParams, getHashParam, getParam, getQueryParam, getUrlParam, getUrlParams, isQueryString, isValidUrl, parseHashParams, parseQueryString, parseUrlParams } from './getParam.cjs';
4
4
  export { cleanupExpired, clearLocal, clearSession, getLocal, getSession, setLocal, setSession } from './storage.cjs';
@@ -1,4 +1,4 @@
1
1
  export { copy } from './copy.js';
2
2
  export { downloadCSV, downloadFile, downloadFromURL, downloadImage, downloadJSON, downloadMultipleFiles, downloadText, downloadViaAJAX } from './download.js';
3
- export { getAllParams, getParam, getUrlParam, getUrlParams } from './getParam.js';
3
+ export { buildQueryString, buildUrl, getAllParams, getCurrentUrlParam, getCurrentUrlParams, getHashParam, getParam, getQueryParam, getUrlParam, getUrlParams, isQueryString, isValidUrl, parseHashParams, parseQueryString, parseUrlParams } from './getParam.js';
4
4
  export { cleanupExpired, clearLocal, clearSession, getLocal, getSession, setLocal, setSession } from './storage.js';
@@ -1,19 +1,4 @@
1
- import "../chunk-2AZDXCHJ.js";
2
- import {
3
- getAllParams,
4
- getParam,
5
- getUrlParam,
6
- getUrlParams
7
- } from "../chunk-MCT2IB67.js";
8
- import {
9
- cleanupExpired,
10
- clearLocal,
11
- clearSession,
12
- getLocal,
13
- getSession,
14
- setLocal,
15
- setSession
16
- } from "../chunk-LJVOVGGV.js";
1
+ import "../chunk-FXZQXYYH.js";
17
2
  import {
18
3
  copy
19
4
  } from "../chunk-W45DTA4D.js";
@@ -27,8 +12,36 @@ import {
27
12
  downloadText,
28
13
  downloadViaAJAX
29
14
  } from "../chunk-ZLEU2YQ2.js";
15
+ import {
16
+ buildQueryString,
17
+ buildUrl,
18
+ getAllParams,
19
+ getCurrentUrlParam,
20
+ getCurrentUrlParams,
21
+ getHashParam,
22
+ getParam,
23
+ getQueryParam,
24
+ getUrlParam,
25
+ getUrlParams,
26
+ isQueryString,
27
+ isValidUrl,
28
+ parseHashParams,
29
+ parseQueryString,
30
+ parseUrlParams
31
+ } from "../chunk-FDAJOMW5.js";
32
+ import {
33
+ cleanupExpired,
34
+ clearLocal,
35
+ clearSession,
36
+ getLocal,
37
+ getSession,
38
+ setLocal,
39
+ setSession
40
+ } from "../chunk-LJVOVGGV.js";
30
41
  import "../chunk-MLKGABMK.js";
31
42
  export {
43
+ buildQueryString,
44
+ buildUrl,
32
45
  cleanupExpired,
33
46
  clearLocal,
34
47
  clearSession,
@@ -42,11 +55,20 @@ export {
42
55
  downloadText,
43
56
  downloadViaAJAX,
44
57
  getAllParams,
58
+ getCurrentUrlParam,
59
+ getCurrentUrlParams,
60
+ getHashParam,
45
61
  getLocal,
46
62
  getParam,
63
+ getQueryParam,
47
64
  getSession,
48
65
  getUrlParam,
49
66
  getUrlParams,
67
+ isQueryString,
68
+ isValidUrl,
69
+ parseHashParams,
70
+ parseQueryString,
71
+ parseUrlParams,
50
72
  setLocal,
51
73
  setSession
52
74
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fangzhongya/utils",
3
3
  "private": false,
4
4
  "type": "module",
5
- "version": "0.0.74",
5
+ "version": "0.0.77",
6
6
  "description ": "个人工具库",
7
7
  "author": "fangzhongya ",
8
8
  "license": "MIT",
@@ -201,6 +201,11 @@
201
201
  "require": "./dist/basic/string/getContent.cjs",
202
202
  "import": "./dist/basic/string/getContent.js"
203
203
  },
204
+ "./basic/string/getExports": {
205
+ "types": "./dist/basic/string/getExports.d.ts",
206
+ "require": "./dist/basic/string/getExports.cjs",
207
+ "import": "./dist/basic/string/getExports.js"
208
+ },
204
209
  "./basic/string/getImports": {
205
210
  "types": "./dist/basic/string/getImports.d.ts",
206
211
  "require": "./dist/basic/string/getImports.cjs",
@@ -1,35 +0,0 @@
1
- // packages/window/getParam.ts
2
- function getParam(URL) {
3
- URL = JSON.parse(
4
- '{"' + decodeURI(URL.split("?")[1]).replace(/"/g, '"').replace(/&/g, '","').replace(/=/g, '":"') + '"}'
5
- );
6
- return JSON.stringify(URL);
7
- }
8
- function getUrlParams() {
9
- const hash = window.location.href;
10
- const questionMarkIndex = hash.indexOf("?");
11
- if (questionMarkIndex === -1) {
12
- return new URLSearchParams();
13
- }
14
- const queryString = hash.substring(questionMarkIndex + 1);
15
- return new URLSearchParams(queryString);
16
- }
17
- function getUrlParam(name) {
18
- const params = getUrlParams();
19
- return params.get(name);
20
- }
21
- function getAllParams() {
22
- const params = getUrlParams();
23
- const result = {};
24
- for (const [key, value] of params.entries()) {
25
- result[key] = value;
26
- }
27
- return result;
28
- }
29
-
30
- export {
31
- getParam,
32
- getUrlParams,
33
- getUrlParam,
34
- getAllParams
35
- };
@@ -1,35 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/window/getParam.ts
2
- function getParam(URL) {
3
- URL = JSON.parse(
4
- '{"' + decodeURI(URL.split("?")[1]).replace(/"/g, '"').replace(/&/g, '","').replace(/=/g, '":"') + '"}'
5
- );
6
- return JSON.stringify(URL);
7
- }
8
- function getUrlParams() {
9
- const hash = window.location.href;
10
- const questionMarkIndex = hash.indexOf("?");
11
- if (questionMarkIndex === -1) {
12
- return new URLSearchParams();
13
- }
14
- const queryString = hash.substring(questionMarkIndex + 1);
15
- return new URLSearchParams(queryString);
16
- }
17
- function getUrlParam(name) {
18
- const params = getUrlParams();
19
- return params.get(name);
20
- }
21
- function getAllParams() {
22
- const params = getUrlParams();
23
- const result = {};
24
- for (const [key, value] of params.entries()) {
25
- result[key] = value;
26
- }
27
- return result;
28
- }
29
-
30
-
31
-
32
-
33
-
34
-
35
- exports.getParam = getParam; exports.getUrlParams = getUrlParams; exports.getUrlParam = getUrlParam; exports.getAllParams = getAllParams;
@@ -1,30 +0,0 @@
1
- import { copy } from './window/copy.cjs';
2
- import { downloadCSV, downloadFile, downloadFromURL, downloadImage, downloadJSON, downloadMultipleFiles, downloadText, downloadViaAJAX } from './window/download.cjs';
3
- import { getAllParams, getParam, getUrlParam, getUrlParams } from './window/getParam.cjs';
4
- import { cleanupExpired, clearLocal, clearSession, getLocal, getSession, setLocal, setSession } from './window/storage.cjs';
5
-
6
- declare const index_cleanupExpired: typeof cleanupExpired;
7
- declare const index_clearLocal: typeof clearLocal;
8
- declare const index_clearSession: typeof clearSession;
9
- declare const index_copy: typeof copy;
10
- declare const index_downloadCSV: typeof downloadCSV;
11
- declare const index_downloadFile: typeof downloadFile;
12
- declare const index_downloadFromURL: typeof downloadFromURL;
13
- declare const index_downloadImage: typeof downloadImage;
14
- declare const index_downloadJSON: typeof downloadJSON;
15
- declare const index_downloadMultipleFiles: typeof downloadMultipleFiles;
16
- declare const index_downloadText: typeof downloadText;
17
- declare const index_downloadViaAJAX: typeof downloadViaAJAX;
18
- declare const index_getAllParams: typeof getAllParams;
19
- declare const index_getLocal: typeof getLocal;
20
- declare const index_getParam: typeof getParam;
21
- declare const index_getSession: typeof getSession;
22
- declare const index_getUrlParam: typeof getUrlParam;
23
- declare const index_getUrlParams: typeof getUrlParams;
24
- declare const index_setLocal: typeof setLocal;
25
- declare const index_setSession: typeof setSession;
26
- declare namespace index {
27
- export { index_cleanupExpired as cleanupExpired, index_clearLocal as clearLocal, index_clearSession as clearSession, index_copy as copy, index_downloadCSV as downloadCSV, index_downloadFile as downloadFile, index_downloadFromURL as downloadFromURL, index_downloadImage as downloadImage, index_downloadJSON as downloadJSON, index_downloadMultipleFiles as downloadMultipleFiles, index_downloadText as downloadText, index_downloadViaAJAX as downloadViaAJAX, index_getAllParams as getAllParams, index_getLocal as getLocal, index_getParam as getParam, index_getSession as getSession, index_getUrlParam as getUrlParam, index_getUrlParams as getUrlParams, index_setLocal as setLocal, index_setSession as setSession };
28
- }
29
-
30
- export { index as i };
@@ -1,30 +0,0 @@
1
- import { copy } from './window/copy.js';
2
- import { downloadCSV, downloadFile, downloadFromURL, downloadImage, downloadJSON, downloadMultipleFiles, downloadText, downloadViaAJAX } from './window/download.js';
3
- import { getAllParams, getParam, getUrlParam, getUrlParams } from './window/getParam.js';
4
- import { cleanupExpired, clearLocal, clearSession, getLocal, getSession, setLocal, setSession } from './window/storage.js';
5
-
6
- declare const index_cleanupExpired: typeof cleanupExpired;
7
- declare const index_clearLocal: typeof clearLocal;
8
- declare const index_clearSession: typeof clearSession;
9
- declare const index_copy: typeof copy;
10
- declare const index_downloadCSV: typeof downloadCSV;
11
- declare const index_downloadFile: typeof downloadFile;
12
- declare const index_downloadFromURL: typeof downloadFromURL;
13
- declare const index_downloadImage: typeof downloadImage;
14
- declare const index_downloadJSON: typeof downloadJSON;
15
- declare const index_downloadMultipleFiles: typeof downloadMultipleFiles;
16
- declare const index_downloadText: typeof downloadText;
17
- declare const index_downloadViaAJAX: typeof downloadViaAJAX;
18
- declare const index_getAllParams: typeof getAllParams;
19
- declare const index_getLocal: typeof getLocal;
20
- declare const index_getParam: typeof getParam;
21
- declare const index_getSession: typeof getSession;
22
- declare const index_getUrlParam: typeof getUrlParam;
23
- declare const index_getUrlParams: typeof getUrlParams;
24
- declare const index_setLocal: typeof setLocal;
25
- declare const index_setSession: typeof setSession;
26
- declare namespace index {
27
- export { index_cleanupExpired as cleanupExpired, index_clearLocal as clearLocal, index_clearSession as clearSession, index_copy as copy, index_downloadCSV as downloadCSV, index_downloadFile as downloadFile, index_downloadFromURL as downloadFromURL, index_downloadImage as downloadImage, index_downloadJSON as downloadJSON, index_downloadMultipleFiles as downloadMultipleFiles, index_downloadText as downloadText, index_downloadViaAJAX as downloadViaAJAX, index_getAllParams as getAllParams, index_getLocal as getLocal, index_getParam as getParam, index_getSession as getSession, index_getUrlParam as getUrlParam, index_getUrlParams as getUrlParams, index_setLocal as setLocal, index_setSession as setSession };
28
- }
29
-
30
- export { index as i };
@@ -2,12 +2,12 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkYAD5PHVFcjs = require('./chunk-YAD5PHVF.cjs');
5
+ var _chunkRYBJGHXKcjs = require('./chunk-RYBJGHXK.cjs');
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkRYBJGHXKcjs = require('./chunk-RYBJGHXK.cjs');
10
+ var _chunkYAD5PHVFcjs = require('./chunk-YAD5PHVF.cjs');
11
11
 
12
12
 
13
13
  var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
@@ -1,40 +1,40 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk76G4GJ6Rcjs = require('./chunk-76G4GJ6R.cjs');
4
3
 
4
+ var _chunkJFAHWIZ3cjs = require('./chunk-JFAHWIZ3.cjs');
5
5
 
6
- var _chunkETOSL4FHcjs = require('./chunk-ETOSL4FH.cjs');
7
6
 
7
+ var _chunkJAWXP52Ocjs = require('./chunk-JAWXP52O.cjs');
8
8
 
9
- var _chunkTPOVGKBXcjs = require('./chunk-TPOVGKBX.cjs');
10
9
 
10
+ var _chunkKHFZCJ23cjs = require('./chunk-KHFZCJ23.cjs');
11
11
 
12
12
 
13
- var _chunkJFAHWIZ3cjs = require('./chunk-JFAHWIZ3.cjs');
13
+ var _chunkA4K3QWLIcjs = require('./chunk-A4K3QWLI.cjs');
14
14
 
15
15
 
16
- var _chunkH6KIVPAScjs = require('./chunk-H6KIVPAS.cjs');
16
+ var _chunkRFUD3TOQcjs = require('./chunk-RFUD3TOQ.cjs');
17
17
 
18
18
 
19
- var _chunkCVBJXH33cjs = require('./chunk-CVBJXH33.cjs');
19
+ var _chunk3DD7YCN2cjs = require('./chunk-3DD7YCN2.cjs');
20
20
 
21
21
 
22
- var _chunkJAWXP52Ocjs = require('./chunk-JAWXP52O.cjs');
22
+ var _chunkHMAAC5QAcjs = require('./chunk-HMAAC5QA.cjs');
23
23
 
24
24
 
25
- var _chunkKHFZCJ23cjs = require('./chunk-KHFZCJ23.cjs');
25
+ var _chunk76G4GJ6Rcjs = require('./chunk-76G4GJ6R.cjs');
26
26
 
27
27
 
28
- var _chunkA4K3QWLIcjs = require('./chunk-A4K3QWLI.cjs');
28
+ var _chunkETOSL4FHcjs = require('./chunk-ETOSL4FH.cjs');
29
29
 
30
30
 
31
- var _chunkRFUD3TOQcjs = require('./chunk-RFUD3TOQ.cjs');
31
+ var _chunkTPOVGKBXcjs = require('./chunk-TPOVGKBX.cjs');
32
32
 
33
33
 
34
- var _chunk3DD7YCN2cjs = require('./chunk-3DD7YCN2.cjs');
34
+ var _chunkH6KIVPAScjs = require('./chunk-H6KIVPAS.cjs');
35
35
 
36
36
 
37
- var _chunkHMAAC5QAcjs = require('./chunk-HMAAC5QA.cjs');
37
+ var _chunkCVBJXH33cjs = require('./chunk-CVBJXH33.cjs');
38
38
 
39
39
 
40
40
  var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');