@wibetter/json-utils 6.0.1 → 6.0.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.
Files changed (59) hide show
  1. package/README.md +4 -5
  2. package/dist/index.esm.js +572 -5501
  3. package/dist/index.esm.min.js +1 -4535
  4. package/dist/index.js +1 -1600
  5. package/dist/index.js.LICENSE.txt +2 -2
  6. package/dist/types/data/KeyWordList.d.ts +1 -0
  7. package/dist/types/data/TypeDataList.d.ts +129 -0
  8. package/dist/types/data/index.d.ts +31 -0
  9. package/dist/types/data/initSchemaEntity/Api.d.ts +43 -0
  10. package/dist/types/data/initSchemaEntity/Array.d.ts +20 -0
  11. package/dist/types/data/initSchemaEntity/Boolean.d.ts +6 -0
  12. package/dist/types/data/initSchemaEntity/BoxStyle.d.ts +32 -0
  13. package/dist/types/data/initSchemaEntity/Cascader.d.ts +20 -0
  14. package/dist/types/data/initSchemaEntity/Checkbox.d.ts +10 -0
  15. package/dist/types/data/initSchemaEntity/CodeArea.d.ts +7 -0
  16. package/dist/types/data/initSchemaEntity/Color.d.ts +6 -0
  17. package/dist/types/data/initSchemaEntity/DataSource.d.ts +73 -0
  18. package/dist/types/data/initSchemaEntity/Date.d.ts +7 -0
  19. package/dist/types/data/initSchemaEntity/DateTime.d.ts +7 -0
  20. package/dist/types/data/initSchemaEntity/DynamicData.d.ts +105 -0
  21. package/dist/types/data/initSchemaEntity/EmptyArray.d.ts +12 -0
  22. package/dist/types/data/initSchemaEntity/EmptyObject.d.ts +6 -0
  23. package/dist/types/data/initSchemaEntity/Event.d.ts +96 -0
  24. package/dist/types/data/initSchemaEntity/FuncBody.d.ts +7 -0
  25. package/dist/types/data/initSchemaEntity/HtmlArea.d.ts +7 -0
  26. package/dist/types/data/initSchemaEntity/IMG.d.ts +12 -0
  27. package/dist/types/data/initSchemaEntity/Input.d.ts +7 -0
  28. package/dist/types/data/initSchemaEntity/InputImage.d.ts +7 -0
  29. package/dist/types/data/initSchemaEntity/JSONSchema.d.ts +60 -0
  30. package/dist/types/data/initSchemaEntity/Json.d.ts +6 -0
  31. package/dist/types/data/initSchemaEntity/Number.d.ts +8 -0
  32. package/dist/types/data/initSchemaEntity/Object.d.ts +24 -0
  33. package/dist/types/data/initSchemaEntity/PaddingMargin.d.ts +38 -0
  34. package/dist/types/data/initSchemaEntity/Quantity.d.ts +34 -0
  35. package/dist/types/data/initSchemaEntity/Radio.d.ts +9 -0
  36. package/dist/types/data/initSchemaEntity/Select.d.ts +9 -0
  37. package/dist/types/data/initSchemaEntity/TextEditor.d.ts +7 -0
  38. package/dist/types/data/initSchemaEntity/Textarea.d.ts +7 -0
  39. package/dist/types/data/initSchemaEntity/Time.d.ts +7 -0
  40. package/dist/types/data/initSchemaEntity/URL.d.ts +7 -0
  41. package/dist/types/function/getExpectType.d.ts +2 -0
  42. package/dist/types/function/getJsonDataByKeyRoute.d.ts +8 -0
  43. package/dist/types/function/getSchemaByIndexRoute.d.ts +8 -0
  44. package/dist/types/function/getSchemaByKeyRoute.d.ts +8 -0
  45. package/dist/types/function/indexRoute2keyRoute.d.ts +7 -0
  46. package/dist/types/function/json2schema.d.ts +4 -0
  47. package/dist/types/function/json2treeData.d.ts +8 -0
  48. package/dist/types/function/keyRoute2indexRoute.d.ts +7 -0
  49. package/dist/types/function/metaElemAnalyzer.d.ts +2 -0
  50. package/dist/types/function/oldSchemaToNewSchema.d.ts +2 -0
  51. package/dist/types/function/schema2conditionValue.d.ts +4 -0
  52. package/dist/types/function/schema2json.d.ts +5 -0
  53. package/dist/types/function/schemaMetaList.d.ts +1 -0
  54. package/dist/types/main.d.ts +74 -0
  55. package/dist/types/utils/index.d.ts +24 -0
  56. package/dist/types/utils/jsonData.d.ts +8 -0
  57. package/dist/types/utils/jsonSchema.d.ts +55 -0
  58. package/dist/types/utils/typeof.d.ts +32 -0
  59. package/package.json +7 -4
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * @wibetter/json-utils v6.0.1
2
+ * @wibetter/json-utils v6.0.3
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Tue May 20 2025 15:25:47 GMT+0800 (China Standard Time)
5
+ * build time: Tue Jan 27 2026 14:09:50 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
@@ -0,0 +1 @@
1
+ export declare const KeyWordList: string[];
@@ -0,0 +1,129 @@
1
+ export declare const TypeDataList: any;
2
+ export declare const EventTypeDataList: {
3
+ on: {
4
+ type: string;
5
+ title: string;
6
+ isContainer: boolean;
7
+ properties: {
8
+ type: {
9
+ default: string;
10
+ type: string;
11
+ options: {
12
+ label: string;
13
+ value: string;
14
+ }[];
15
+ title: string;
16
+ };
17
+ register: {
18
+ type: string;
19
+ default: string;
20
+ title: string;
21
+ description: string;
22
+ placeholder: string;
23
+ };
24
+ actionFunc: {
25
+ title: string;
26
+ type: string;
27
+ default: string;
28
+ description: string;
29
+ };
30
+ };
31
+ propertyOrder: string[];
32
+ };
33
+ emit: {
34
+ type: string;
35
+ title: string;
36
+ isContainer: boolean;
37
+ properties: {
38
+ type: {
39
+ default: string;
40
+ type: string;
41
+ options: {
42
+ label: string;
43
+ value: string;
44
+ }[];
45
+ title: string;
46
+ };
47
+ trigger: {
48
+ type: string;
49
+ default: string;
50
+ title: string;
51
+ description: string;
52
+ placeholder: string;
53
+ };
54
+ eventData: {
55
+ title: string;
56
+ type: string;
57
+ default: string;
58
+ description: string;
59
+ };
60
+ };
61
+ propertyOrder: string[];
62
+ };
63
+ };
64
+ export declare const DataSourceTypeList: {
65
+ local: {
66
+ type: string;
67
+ title: string;
68
+ isContainer: boolean;
69
+ properties: {
70
+ type: {
71
+ default: string;
72
+ type: string;
73
+ options: {
74
+ label: string;
75
+ value: string;
76
+ }[];
77
+ title: string;
78
+ };
79
+ data: {
80
+ title: string;
81
+ placeholder: string;
82
+ type: string;
83
+ default: string;
84
+ description: string;
85
+ isRequired: boolean;
86
+ };
87
+ filter: {
88
+ title: string;
89
+ type: string;
90
+ default: string;
91
+ description: string;
92
+ isRequired: boolean;
93
+ };
94
+ };
95
+ propertyOrder: string[];
96
+ };
97
+ remote: {
98
+ type: string;
99
+ title: string;
100
+ isContainer: boolean;
101
+ properties: {
102
+ type: {
103
+ type: string;
104
+ default: string;
105
+ options: {
106
+ label: string;
107
+ value: string;
108
+ }[];
109
+ title: string;
110
+ };
111
+ data: {
112
+ type: string;
113
+ title: string;
114
+ placeholder: string;
115
+ default: string;
116
+ isRequired: boolean;
117
+ description: string;
118
+ };
119
+ filter: {
120
+ type: string;
121
+ title: string;
122
+ default: string;
123
+ description: string;
124
+ isRequired: boolean;
125
+ };
126
+ };
127
+ propertyOrder: string[];
128
+ };
129
+ };
@@ -0,0 +1,31 @@
1
+ export * from './initSchemaEntity/JSONSchema';
2
+ export * from './initSchemaEntity/Input';
3
+ export * from './initSchemaEntity/Boolean';
4
+ export * from './initSchemaEntity/Textarea';
5
+ export * from './initSchemaEntity/TextEditor';
6
+ export * from './initSchemaEntity/Number';
7
+ export * from './initSchemaEntity/Radio';
8
+ export * from './initSchemaEntity/Select';
9
+ export * from './initSchemaEntity/Checkbox';
10
+ export * from './initSchemaEntity/Cascader';
11
+ export * from './initSchemaEntity/DateTime';
12
+ export * from './initSchemaEntity/Date';
13
+ export * from './initSchemaEntity/Time';
14
+ export * from './initSchemaEntity/Color';
15
+ export * from './initSchemaEntity/URL';
16
+ export * from './initSchemaEntity/IMG';
17
+ export * from './initSchemaEntity/InputImage';
18
+ export * from './initSchemaEntity/Array';
19
+ export * from './initSchemaEntity/Object';
20
+ export * from './initSchemaEntity/EmptyArray';
21
+ export * from './initSchemaEntity/EmptyObject';
22
+ export * from './initSchemaEntity/Quantity';
23
+ export * from './initSchemaEntity/BoxStyle';
24
+ export * from './initSchemaEntity/PaddingMargin';
25
+ export * from './initSchemaEntity/Json';
26
+ export * from './initSchemaEntity/CodeArea';
27
+ export * from './initSchemaEntity/HtmlArea';
28
+ export * from './initSchemaEntity/Event';
29
+ export * from './initSchemaEntity/DataSource';
30
+ export * from './initSchemaEntity/DynamicData';
31
+ export * from './initSchemaEntity/Api';
@@ -0,0 +1,43 @@
1
+ export declare const initApiData: {
2
+ type: string;
3
+ title: string;
4
+ isContainer: boolean;
5
+ properties: {
6
+ url: {
7
+ type: string;
8
+ title: string;
9
+ default: string;
10
+ description: string;
11
+ isRequired: boolean;
12
+ };
13
+ method: {
14
+ type: string;
15
+ title: string;
16
+ default: string;
17
+ options: {
18
+ label: string;
19
+ value: string;
20
+ }[];
21
+ isRequired: boolean;
22
+ };
23
+ headers: {
24
+ type: string;
25
+ title: string;
26
+ default: string;
27
+ description: string;
28
+ };
29
+ data: {
30
+ type: string;
31
+ title: string;
32
+ default: string;
33
+ description: string;
34
+ };
35
+ };
36
+ propertyOrder: string[];
37
+ };
38
+ export declare const EmptyApiCont: {
39
+ url: string;
40
+ method: string;
41
+ headers: {};
42
+ data: {};
43
+ };
@@ -0,0 +1,20 @@
1
+ export declare const initArrayData: {
2
+ type: string;
3
+ title: string;
4
+ description: string;
5
+ items: {
6
+ type: string;
7
+ title: string;
8
+ description: string;
9
+ properties: {
10
+ name: {
11
+ type: string;
12
+ title: string;
13
+ default: string;
14
+ description: string;
15
+ placeholder: string;
16
+ };
17
+ };
18
+ propertyOrder: string[];
19
+ };
20
+ };
@@ -0,0 +1,6 @@
1
+ export declare const initBooleanData: {
2
+ type: string;
3
+ title: string;
4
+ default: boolean;
5
+ description: string;
6
+ };
@@ -0,0 +1,32 @@
1
+ /** box-style字段项
2
+ * 【字段属性说明】
3
+ * title:字段项的label值
4
+ * properties:存放所有的子字段数据内容
5
+ * type:用于标识字段项的展示类型(input、date、data-time、url、textarea 等)
6
+ * readOnly:字段项可设置是否可编辑
7
+ * required:存放所有子字段的key值,用于验证子字段项是否存在,同时required可充当排序功能
8
+ * propertyOrder:按序存放所有子字段的key值(排序功能)
9
+ * */
10
+ export declare const initBoxStyleData: {
11
+ type: string;
12
+ title: string;
13
+ isContainer: boolean;
14
+ properties: {
15
+ unit: {
16
+ title: string;
17
+ type: string;
18
+ default: string;
19
+ description: string;
20
+ };
21
+ quantity: {
22
+ type: string;
23
+ default: string;
24
+ options: {
25
+ label: string;
26
+ value: string;
27
+ }[];
28
+ title: string;
29
+ };
30
+ };
31
+ propertyOrder: string[];
32
+ };
@@ -0,0 +1,20 @@
1
+ export declare const initCascaderSchema: {
2
+ type: string;
3
+ title: string;
4
+ options: {
5
+ value: string;
6
+ label: string;
7
+ children: {
8
+ value: string;
9
+ label: string;
10
+ children: {
11
+ value: string;
12
+ label: string;
13
+ }[];
14
+ }[];
15
+ }[];
16
+ default: string;
17
+ description: string;
18
+ showSearch: boolean;
19
+ allowClear: boolean;
20
+ };
@@ -0,0 +1,10 @@
1
+ export declare const initCheckboxSchema: {
2
+ type: string;
3
+ title: string;
4
+ options: {
5
+ label: string;
6
+ value: string;
7
+ }[];
8
+ default: string[];
9
+ description: string;
10
+ };
@@ -0,0 +1,7 @@
1
+ export declare const initCodeAreaData: {
2
+ type: string;
3
+ title: string;
4
+ placeholder: string;
5
+ default: string;
6
+ description: string;
7
+ };
@@ -0,0 +1,6 @@
1
+ export declare const initColorData: {
2
+ type: string;
3
+ title: string;
4
+ default: string;
5
+ description: string;
6
+ };
@@ -0,0 +1,73 @@
1
+ /** dataSource字段项
2
+ * 【字段属性说明】
3
+ * title:字段项的label值
4
+ * properties:存放所有的子字段数据内容
5
+ * type:用于标识字段项的展示类型(input、date、data-time、url、textarea 等)
6
+ * readOnly:字段项可设置是否可编辑
7
+ * required:存放所有子字段的key值,用于验证子字段项是否存在,同时required可充当排序功能
8
+ * propertyOrder:按序存放所有子字段的key值(排序功能)
9
+ * */
10
+ export declare const initDataSourceData: {
11
+ type: string;
12
+ title: string;
13
+ isContainer: boolean;
14
+ properties: {
15
+ type: {
16
+ default: string;
17
+ type: string;
18
+ options: {
19
+ label: string;
20
+ value: string;
21
+ }[];
22
+ title: string;
23
+ };
24
+ data: {
25
+ title: string;
26
+ placeholder: string;
27
+ type: string;
28
+ default: string;
29
+ description: string;
30
+ isRequired: boolean;
31
+ };
32
+ filter: {
33
+ title: string;
34
+ type: string;
35
+ default: string;
36
+ description: string;
37
+ isRequired: boolean;
38
+ };
39
+ };
40
+ propertyOrder: string[];
41
+ };
42
+ export declare const initDataSourceDataV2: {
43
+ type: string;
44
+ title: string;
45
+ isContainer: boolean;
46
+ properties: {
47
+ type: {
48
+ type: string;
49
+ default: string;
50
+ options: {
51
+ label: string;
52
+ value: string;
53
+ }[];
54
+ title: string;
55
+ };
56
+ data: {
57
+ type: string;
58
+ title: string;
59
+ placeholder: string;
60
+ default: string;
61
+ isRequired: boolean;
62
+ description: string;
63
+ };
64
+ filter: {
65
+ type: string;
66
+ title: string;
67
+ default: string;
68
+ description: string;
69
+ isRequired: boolean;
70
+ };
71
+ };
72
+ propertyOrder: string[];
73
+ };
@@ -0,0 +1,7 @@
1
+ export declare const initDateData: {
2
+ type: string;
3
+ title: string;
4
+ default: string;
5
+ description: string;
6
+ placeholder: string;
7
+ };
@@ -0,0 +1,7 @@
1
+ export declare const initDateTimeData: {
2
+ type: string;
3
+ title: string;
4
+ default: string;
5
+ description: string;
6
+ placeholder: string;
7
+ };
@@ -0,0 +1,105 @@
1
+ /** dynamic-data: 动态数据
2
+ * 【字段属性说明】
3
+ * title:字段项的label值
4
+ * properties:存放所有的子字段数据内容
5
+ * type:用于标识字段项的展示类型(input、date、data-time、url、textarea 等)
6
+ * readOnly:字段项可设置是否可编辑
7
+ * required:存放所有子字段的key值,用于验证子字段项是否存在,同时required可充当排序功能
8
+ * propertyOrder:按序存放所有子字段的key值(排序功能)
9
+ * */
10
+ export declare const initDynamicData: {
11
+ type: string;
12
+ title: string;
13
+ isContainer: boolean;
14
+ properties: {
15
+ type: {
16
+ default: string;
17
+ type: string;
18
+ options: {
19
+ label: string;
20
+ value: string;
21
+ }[];
22
+ title: string;
23
+ };
24
+ config: {
25
+ title: string;
26
+ type: string;
27
+ description: string;
28
+ isRequired: boolean;
29
+ properties: {
30
+ url: {
31
+ type: string;
32
+ title: string;
33
+ default: string;
34
+ description: string;
35
+ isRequired: boolean;
36
+ };
37
+ method: {
38
+ type: string;
39
+ title: string;
40
+ default: string;
41
+ options: {
42
+ label: string;
43
+ value: string;
44
+ }[];
45
+ isRequired: boolean;
46
+ };
47
+ headers: {
48
+ type: string;
49
+ title: string;
50
+ default: string;
51
+ description: string;
52
+ };
53
+ data: {
54
+ type: string;
55
+ title: string;
56
+ default: string;
57
+ description: string;
58
+ };
59
+ dataType: {
60
+ type: string;
61
+ title: string;
62
+ default: string;
63
+ options: {
64
+ label: string;
65
+ value: string;
66
+ }[];
67
+ };
68
+ cache: {
69
+ type: string;
70
+ title: string;
71
+ default: undefined;
72
+ description: string;
73
+ };
74
+ };
75
+ propertyOrder: string[];
76
+ };
77
+ data: {
78
+ title: string;
79
+ type: string;
80
+ default: string;
81
+ description: string;
82
+ isRequired: boolean;
83
+ };
84
+ localFilter: {
85
+ title: string;
86
+ type: string;
87
+ default: string;
88
+ description: string;
89
+ isRequired: boolean;
90
+ };
91
+ };
92
+ propertyOrder: string[];
93
+ };
94
+ export declare const EmptyDynamicDataCont: {
95
+ type: string;
96
+ config: {
97
+ url: string;
98
+ method: string;
99
+ headers: {};
100
+ data: {};
101
+ dataType: string;
102
+ };
103
+ data: string;
104
+ localFilter: string;
105
+ };
@@ -0,0 +1,12 @@
1
+ export declare const EmptyArray: {
2
+ type: string;
3
+ title: string;
4
+ description: string;
5
+ default: never[];
6
+ items: {
7
+ type: string;
8
+ title: string;
9
+ description: string;
10
+ properties: {};
11
+ };
12
+ };
@@ -0,0 +1,6 @@
1
+ export declare const EmptyObject: {
2
+ type: string;
3
+ title: string;
4
+ description: string;
5
+ properties: {};
6
+ };
@@ -0,0 +1,96 @@
1
+ /** event字段项
2
+ * 【字段属性说明】
3
+ * title:字段项的label值
4
+ * properties:存放所有的子字段数据内容
5
+ * type:用于标识字段项的展示类型(input、date、data-time、url、textarea 等)
6
+ * readOnly:字段项可设置是否可编辑
7
+ * required:存放所有子字段的key值,用于验证子字段项是否存在,同时required可充当排序功能
8
+ * propertyOrder:按序存放所有子字段的key值(排序功能)
9
+ * */
10
+ export declare const initEventDataV1: {
11
+ type: string;
12
+ title: string;
13
+ isContainer: boolean;
14
+ properties: {
15
+ type: {
16
+ default: string;
17
+ type: string;
18
+ options: {
19
+ label: string;
20
+ value: string;
21
+ }[];
22
+ title: string;
23
+ readOnlyInJson: boolean;
24
+ };
25
+ filter: {
26
+ type: string;
27
+ default: string;
28
+ title: string;
29
+ };
30
+ };
31
+ propertyOrder: string[];
32
+ };
33
+ /** 新版EventData
34
+ * type: emit 的默认数据 */
35
+ export declare const initEventData: {
36
+ type: string;
37
+ title: string;
38
+ isContainer: boolean;
39
+ properties: {
40
+ type: {
41
+ default: string;
42
+ type: string;
43
+ options: {
44
+ label: string;
45
+ value: string;
46
+ }[];
47
+ title: string;
48
+ };
49
+ trigger: {
50
+ type: string;
51
+ default: string;
52
+ title: string;
53
+ description: string;
54
+ placeholder: string;
55
+ };
56
+ eventData: {
57
+ title: string;
58
+ type: string;
59
+ default: string;
60
+ description: string;
61
+ };
62
+ };
63
+ propertyOrder: string[];
64
+ };
65
+ /** 新版EventData
66
+ * type: on 的默认数据 */
67
+ export declare const initEventDataTypeON: {
68
+ type: string;
69
+ title: string;
70
+ isContainer: boolean;
71
+ properties: {
72
+ type: {
73
+ default: string;
74
+ type: string;
75
+ options: {
76
+ label: string;
77
+ value: string;
78
+ }[];
79
+ title: string;
80
+ };
81
+ register: {
82
+ type: string;
83
+ default: string;
84
+ title: string;
85
+ description: string;
86
+ placeholder: string;
87
+ };
88
+ actionFunc: {
89
+ title: string;
90
+ type: string;
91
+ default: string;
92
+ description: string;
93
+ };
94
+ };
95
+ propertyOrder: string[];
96
+ };
@@ -0,0 +1,7 @@
1
+ export declare const initFuncBody: {
2
+ title: string;
3
+ type: string;
4
+ placeholder: string;
5
+ default: string;
6
+ description: string;
7
+ };
@@ -0,0 +1,7 @@
1
+ export declare const initHtmlAreaData: {
2
+ title: string;
3
+ type: string;
4
+ placeholder: string;
5
+ default: string;
6
+ description: string;
7
+ };
@@ -0,0 +1,12 @@
1
+ /** image图片类型字段
2
+ * 用户可以使用此组件上传图片,最后返回对应的图片资源地址
3
+ * */
4
+ export declare const initIMGData: {
5
+ title: string;
6
+ type: string;
7
+ default: string;
8
+ description: string;
9
+ imgWidth: number;
10
+ imgHeight: number;
11
+ imgRatioReadOnly: boolean;
12
+ };
@@ -0,0 +1,7 @@
1
+ export declare const initInputData: {
2
+ title: string;
3
+ type: string;
4
+ default: string;
5
+ description: string;
6
+ placeholder: string;
7
+ };
@@ -0,0 +1,7 @@
1
+ export declare const initInputImageData: {
2
+ title: string;
3
+ type: string;
4
+ description: string;
5
+ accept: string;
6
+ multiple: boolean;
7
+ };