@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.
- package/README.md +4 -5
- package/dist/index.esm.js +572 -5501
- package/dist/index.esm.min.js +1 -4535
- package/dist/index.js +1 -1600
- package/dist/index.js.LICENSE.txt +2 -2
- package/dist/types/data/KeyWordList.d.ts +1 -0
- package/dist/types/data/TypeDataList.d.ts +129 -0
- package/dist/types/data/index.d.ts +31 -0
- package/dist/types/data/initSchemaEntity/Api.d.ts +43 -0
- package/dist/types/data/initSchemaEntity/Array.d.ts +20 -0
- package/dist/types/data/initSchemaEntity/Boolean.d.ts +6 -0
- package/dist/types/data/initSchemaEntity/BoxStyle.d.ts +32 -0
- package/dist/types/data/initSchemaEntity/Cascader.d.ts +20 -0
- package/dist/types/data/initSchemaEntity/Checkbox.d.ts +10 -0
- package/dist/types/data/initSchemaEntity/CodeArea.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/Color.d.ts +6 -0
- package/dist/types/data/initSchemaEntity/DataSource.d.ts +73 -0
- package/dist/types/data/initSchemaEntity/Date.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/DateTime.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/DynamicData.d.ts +105 -0
- package/dist/types/data/initSchemaEntity/EmptyArray.d.ts +12 -0
- package/dist/types/data/initSchemaEntity/EmptyObject.d.ts +6 -0
- package/dist/types/data/initSchemaEntity/Event.d.ts +96 -0
- package/dist/types/data/initSchemaEntity/FuncBody.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/HtmlArea.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/IMG.d.ts +12 -0
- package/dist/types/data/initSchemaEntity/Input.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/InputImage.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/JSONSchema.d.ts +60 -0
- package/dist/types/data/initSchemaEntity/Json.d.ts +6 -0
- package/dist/types/data/initSchemaEntity/Number.d.ts +8 -0
- package/dist/types/data/initSchemaEntity/Object.d.ts +24 -0
- package/dist/types/data/initSchemaEntity/PaddingMargin.d.ts +38 -0
- package/dist/types/data/initSchemaEntity/Quantity.d.ts +34 -0
- package/dist/types/data/initSchemaEntity/Radio.d.ts +9 -0
- package/dist/types/data/initSchemaEntity/Select.d.ts +9 -0
- package/dist/types/data/initSchemaEntity/TextEditor.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/Textarea.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/Time.d.ts +7 -0
- package/dist/types/data/initSchemaEntity/URL.d.ts +7 -0
- package/dist/types/function/getExpectType.d.ts +2 -0
- package/dist/types/function/getJsonDataByKeyRoute.d.ts +8 -0
- package/dist/types/function/getSchemaByIndexRoute.d.ts +8 -0
- package/dist/types/function/getSchemaByKeyRoute.d.ts +8 -0
- package/dist/types/function/indexRoute2keyRoute.d.ts +7 -0
- package/dist/types/function/json2schema.d.ts +4 -0
- package/dist/types/function/json2treeData.d.ts +8 -0
- package/dist/types/function/keyRoute2indexRoute.d.ts +7 -0
- package/dist/types/function/metaElemAnalyzer.d.ts +2 -0
- package/dist/types/function/oldSchemaToNewSchema.d.ts +2 -0
- package/dist/types/function/schema2conditionValue.d.ts +4 -0
- package/dist/types/function/schema2json.d.ts +5 -0
- package/dist/types/function/schemaMetaList.d.ts +1 -0
- package/dist/types/main.d.ts +74 -0
- package/dist/types/utils/index.d.ts +24 -0
- package/dist/types/utils/jsonData.d.ts +8 -0
- package/dist/types/utils/jsonSchema.d.ts +55 -0
- package/dist/types/utils/typeof.d.ts +32 -0
- package/package.json +7 -4
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** 新版JSONSchema一级字段项
|
|
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 initJSONSchemaData: {
|
|
11
|
+
type: string;
|
|
12
|
+
title: string;
|
|
13
|
+
properties: {
|
|
14
|
+
func: {
|
|
15
|
+
type: string;
|
|
16
|
+
title: string;
|
|
17
|
+
properties: {
|
|
18
|
+
a: {
|
|
19
|
+
title: string;
|
|
20
|
+
type: string;
|
|
21
|
+
default: string;
|
|
22
|
+
description: string;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
isRequired: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
propertyOrder: string[];
|
|
28
|
+
};
|
|
29
|
+
style: {
|
|
30
|
+
type: string;
|
|
31
|
+
title: string;
|
|
32
|
+
properties: {
|
|
33
|
+
b: {
|
|
34
|
+
title: string;
|
|
35
|
+
type: string;
|
|
36
|
+
default: string;
|
|
37
|
+
description: string;
|
|
38
|
+
placeholder: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
propertyOrder: string[];
|
|
42
|
+
};
|
|
43
|
+
data: {
|
|
44
|
+
type: string;
|
|
45
|
+
title: string;
|
|
46
|
+
properties: {
|
|
47
|
+
c: {
|
|
48
|
+
title: string;
|
|
49
|
+
type: string;
|
|
50
|
+
default: string;
|
|
51
|
+
description: string;
|
|
52
|
+
placeholder: string;
|
|
53
|
+
isRequired: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
propertyOrder: string[];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
propertyOrder: string[];
|
|
60
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Object字段项
|
|
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 initObjectData: {
|
|
11
|
+
type: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
properties: {
|
|
15
|
+
a: {
|
|
16
|
+
type: string;
|
|
17
|
+
title: string;
|
|
18
|
+
default: string;
|
|
19
|
+
description: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
propertyOrder: string[];
|
|
24
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** padding-margin 字段项
|
|
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 initPaddingMarginData: {
|
|
11
|
+
type: string;
|
|
12
|
+
title: string;
|
|
13
|
+
isContainer: boolean;
|
|
14
|
+
properties: {
|
|
15
|
+
margin: {
|
|
16
|
+
title: string;
|
|
17
|
+
type: string;
|
|
18
|
+
default: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
padding: {
|
|
22
|
+
title: string;
|
|
23
|
+
type: string;
|
|
24
|
+
default: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
quantity: {
|
|
28
|
+
type: string;
|
|
29
|
+
default: string;
|
|
30
|
+
options: {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
}[];
|
|
34
|
+
title: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
propertyOrder: string[];
|
|
38
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** quantity字段项
|
|
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 initQuantityData: {
|
|
11
|
+
type: string;
|
|
12
|
+
title: string;
|
|
13
|
+
isContainer: boolean;
|
|
14
|
+
properties: {
|
|
15
|
+
unit: {
|
|
16
|
+
type: string;
|
|
17
|
+
title: string;
|
|
18
|
+
default: number;
|
|
19
|
+
minimum: number;
|
|
20
|
+
maximum: number;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
quantity: {
|
|
24
|
+
type: string;
|
|
25
|
+
default: string;
|
|
26
|
+
options: {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}[];
|
|
30
|
+
title: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
propertyOrder: string[];
|
|
34
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getJSONDataByKeyRoute: 根据key值路径获取对应的json数据
|
|
3
|
+
* 【方法参数说明】
|
|
4
|
+
* keyRoute: key值索引路径
|
|
5
|
+
* targetJsonDataObj: json数据对象
|
|
6
|
+
* useObjClone: 是否进行深拷贝,避免影响原有数据。(默认不进行深拷贝)
|
|
7
|
+
*/
|
|
8
|
+
export declare function getJsonDataByKeyRoute(keyRoute: string, targetJsonDataObj: any, useObjClone?: boolean): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getSchemaByIndexRoute: 根据index索引路径获取对应的schema数据
|
|
3
|
+
* 【方法参数说明】
|
|
4
|
+
* indexRoute: index索引路径
|
|
5
|
+
* targetJsonSchemaObj: schema数据对象
|
|
6
|
+
* useObjClone: 是否进行深拷贝,避免影响原有数据。(默认不进行深拷贝)
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSchemaByIndexRoute(indexRoute: string | number, targetJsonSchemaObj: any, useObjClone?: boolean): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getSchemaByKeyRoute: 根据key值路径获取对应的schema数据
|
|
3
|
+
* 【方法参数说明】
|
|
4
|
+
* keyRoute: key值路径
|
|
5
|
+
* targetJsonSchemaObj: schema数据对象
|
|
6
|
+
* useObjClone: 是否进行深拷贝,避免影响原有数据。(默认不进行深拷贝)
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSchemaByKeyRoute(keyRoute: string, targetJsonSchemaObj: any, useObjClone?: boolean): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataRoute转真实数据路径
|
|
3
|
+
* */
|
|
4
|
+
export declare function dataRoute2dataPath(dataRoute: string, baseDataPath: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* mockData转treeData(供antd的TreeSelect使用)
|
|
7
|
+
* */
|
|
8
|
+
export declare function json2treeData(mockData: any, parentDataRoute: string): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const schemaMetaList: any;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* json-utils: json工具集合
|
|
3
|
+
* 【提供的工具方法清单】
|
|
4
|
+
*
|
|
5
|
+
* 【12个主要的json工具方法】
|
|
6
|
+
* getJsonDataByKeyRoute: 根据key索引路径获取对应的数值
|
|
7
|
+
* getSchemaByIndexRoute: 根据index索引路径获取对应的schema数据
|
|
8
|
+
* getSchemaByKeyRoute: 根据key值路径获取对应的schema数据
|
|
9
|
+
* indexRoute2keyRoute: 根据index索引路径获取对应的key值路径
|
|
10
|
+
* keyRoute2indexRoute:根据key值路径获取对应的index索引路径
|
|
11
|
+
* json2schema: 根据json数据内容获取对应的schema数据
|
|
12
|
+
* oldSchemaToNewSchema: 旧版jsonSchema转新版jsonSchema
|
|
13
|
+
* schema2json: 根据schema数据内容生成一份对应的json数据
|
|
14
|
+
* schemaMetaList: 当前JSON数据可视化提供的元数据清单
|
|
15
|
+
* metaElemAnalyzer: 根据当前的json和对应的schema,统计当前json里面用到的元数据情况
|
|
16
|
+
*
|
|
17
|
+
* 【其他较小的json工具方法】
|
|
18
|
+
*
|
|
19
|
+
* 【json数据内容相关的操作方法】
|
|
20
|
+
* getParentKeyRoute: 获取父元素的key路径值
|
|
21
|
+
* getParentKeyRoute_CurKey: 获取父元素的key路径值和当前key
|
|
22
|
+
*
|
|
23
|
+
* 【schema相关的操作方法】
|
|
24
|
+
* isEmptySchema: 判断是否为空的Schema
|
|
25
|
+
* isNewSchemaData: 判断是否是最新版的schema数据
|
|
26
|
+
* isContainerSchema: 判断是否是容器类型元素,用于确认是否能添加子元素
|
|
27
|
+
* isStructuredSchema: 判断是否是结构化schema数据(一级schema为object类型,其所有二级schema为object类型)
|
|
28
|
+
* isSameParent: 判断是否是同一个父元素
|
|
29
|
+
* getCurPosition: 判断当前元素在目标元素的位置 前 or 后(根据当前元素的位置和目标元素的位置)
|
|
30
|
+
* getParentIndexRoute: 获取父元素的路径值
|
|
31
|
+
* getNextIndexRoute: 获取下一个兄弟元素的路径值
|
|
32
|
+
* getParentIndexRoute_CurIndex: 获取父元素的路径值和当前index
|
|
33
|
+
* moveForward: 将当前路径值向前移动一位
|
|
34
|
+
* moveBackward: 将当前路径值向后移动一位
|
|
35
|
+
*
|
|
36
|
+
* 【纯工具方法】
|
|
37
|
+
* objClone: js对象数据深拷贝,避免数据联动
|
|
38
|
+
* isEqual: 对比两个json数据是否相等
|
|
39
|
+
* hasProperties: 判断当前属性是否存在(识别数值为false、0、null)
|
|
40
|
+
*
|
|
41
|
+
* 【基础元数据类型判断】
|
|
42
|
+
* isURL
|
|
43
|
+
* isString
|
|
44
|
+
* isNumber
|
|
45
|
+
* isBoolean
|
|
46
|
+
* isDateStr
|
|
47
|
+
* isDateTimeStr
|
|
48
|
+
* isTimeStr
|
|
49
|
+
* isArray
|
|
50
|
+
* isSelect
|
|
51
|
+
* isObject
|
|
52
|
+
* isQuantity
|
|
53
|
+
* isColor
|
|
54
|
+
* isFunction
|
|
55
|
+
*/
|
|
56
|
+
export * from './function/getJsonDataByKeyRoute';
|
|
57
|
+
export * from './function/getSchemaByIndexRoute';
|
|
58
|
+
export * from './function/getSchemaByKeyRoute';
|
|
59
|
+
export * from './function/indexRoute2keyRoute';
|
|
60
|
+
export * from './function/keyRoute2indexRoute';
|
|
61
|
+
export * from './function/json2schema';
|
|
62
|
+
export * from './function/metaElemAnalyzer';
|
|
63
|
+
export * from './function/oldSchemaToNewSchema';
|
|
64
|
+
export * from './function/schema2json';
|
|
65
|
+
export * from './function/schemaMetaList';
|
|
66
|
+
export * from './function/json2treeData';
|
|
67
|
+
export * from './function/getExpectType';
|
|
68
|
+
export * from './function/schema2conditionValue';
|
|
69
|
+
export * from './utils/index';
|
|
70
|
+
export * from './utils/jsonData';
|
|
71
|
+
export * from './utils/jsonSchema';
|
|
72
|
+
export * from './utils/typeof';
|
|
73
|
+
export * from './data/KeyWordList';
|
|
74
|
+
export * from './data/TypeDataList';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取 URL 上的所有参数
|
|
3
|
+
* 例如:比如当前页面的地址为 xx?a1=123 则 urlParse() => {a1: 123}
|
|
4
|
+
*/
|
|
5
|
+
export declare function urlParse(): {};
|
|
6
|
+
/**
|
|
7
|
+
* 转换成 URL 上的参数字符串
|
|
8
|
+
* @param {*} urlParams
|
|
9
|
+
* 例如:{a1: 123} => a1=123
|
|
10
|
+
*/
|
|
11
|
+
export declare function urlStringify(urlParams: any): string;
|
|
12
|
+
/** js对象数据深拷贝,避免数据联动 */
|
|
13
|
+
export declare function objClone(targetObj: any): any;
|
|
14
|
+
/** 对比两个json数据是否相等 */
|
|
15
|
+
export declare function isEqual(targetObj: any, nextTargetObj: any): boolean;
|
|
16
|
+
export declare function isEqualByIdT(targetObj: any, nextTargetObj: any): boolean;
|
|
17
|
+
/** 判断当前属性是否存在
|
|
18
|
+
* 备注:要识别boolean类型的数值 */
|
|
19
|
+
export declare function hasProperties(targetProperties: any): boolean;
|
|
20
|
+
export declare function truncate(str: string, paramConfig: any): string;
|
|
21
|
+
/**
|
|
22
|
+
* 支持属性表达式
|
|
23
|
+
*/
|
|
24
|
+
export declare function evalExpression(expressionStr: string, data: any): string | false;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSONSchema(json格式)对象的通用操作方法【非响应式数据操作方法集合】
|
|
3
|
+
*/
|
|
4
|
+
/** 判断是否为空的Schema
|
|
5
|
+
* 包括 通用schema和组件配置专用的schema
|
|
6
|
+
* */
|
|
7
|
+
export declare function isEmptySchema(targetJsonSchema: any): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 判断是否是最新版的schema数据
|
|
10
|
+
* 备注:确保当前schema数据是通过@wibetter/json-schema-editor生成的
|
|
11
|
+
* */
|
|
12
|
+
export declare function isNewSchemaData(schemaData: any): boolean;
|
|
13
|
+
/** 判断是否是容器类型元素
|
|
14
|
+
* 容器类型字段:object数值类型
|
|
15
|
+
* 主要用于判断当前元素点击新增时是添加子元素还是添加兄弟节点,容器类型点击新增时则添加子节点。
|
|
16
|
+
* 备注:array类型字段只有固定的一个items属性,不能新增其他子元素。
|
|
17
|
+
* */
|
|
18
|
+
export declare function isContainerSchema(curSchema: any): boolean;
|
|
19
|
+
/** 判断是否是结构化的schema数据,
|
|
20
|
+
* 判定条件:一级schema为object类型,其所有二级schema也为object类型
|
|
21
|
+
* */
|
|
22
|
+
export declare function isStructuredSchema(jsonSchema: any): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 判断是否是同一个父元素
|
|
25
|
+
* 备注:用于判断两个元素是否在同一个父级容器中
|
|
26
|
+
*/
|
|
27
|
+
export declare function isSameParent(curIndex: string, targetIndex: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 判断当前元素在目标元素的位置 前 or 后(根据当前元素的位置和目标元素的位置)
|
|
30
|
+
*/
|
|
31
|
+
export declare function getCurPosition(curIndex: string, targetIndex: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* 获取父元素的路径值
|
|
34
|
+
*/
|
|
35
|
+
export declare function getParentIndexRoute(curIndexRoute: string | number): string;
|
|
36
|
+
/**
|
|
37
|
+
* 获取下一个兄弟元素的路径值
|
|
38
|
+
*/
|
|
39
|
+
export declare function getNextIndexRoute(curIndexRoute: string | number): string;
|
|
40
|
+
/**
|
|
41
|
+
* 获取父元素的路径值和当前index
|
|
42
|
+
*/
|
|
43
|
+
export declare function getParentIndexRoute_CurIndex(curIndexRoute: string | number): string[];
|
|
44
|
+
/**
|
|
45
|
+
* 将当前路径值向前移动一位
|
|
46
|
+
*/
|
|
47
|
+
export declare function moveForward(curIndexRoute: string | number): any;
|
|
48
|
+
/**
|
|
49
|
+
* 将当前路径值向后移动一位
|
|
50
|
+
*/
|
|
51
|
+
export declare function moveBackward(curIndexRoute: string | number): any;
|
|
52
|
+
/**
|
|
53
|
+
* 获取第一个选项值
|
|
54
|
+
*/
|
|
55
|
+
export declare function getDefaultOptionVal(jsonSchema: any, multiple?: boolean): any;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare function isURL(s: any): boolean;
|
|
2
|
+
export declare function isString(o: any): boolean;
|
|
3
|
+
export declare function isNumber(value: any): boolean;
|
|
4
|
+
export declare function isBoolean(o: any): boolean;
|
|
5
|
+
export declare function isDateStr(dateStr: string): boolean;
|
|
6
|
+
export declare function isDateTimeStr(dateStr: string): boolean;
|
|
7
|
+
export declare function isTimeStr(dateStr: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 判断是否是数组类型
|
|
10
|
+
* */
|
|
11
|
+
export declare function isArray(curObj: any): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 判断是否是select多选类型(基础类型的array)
|
|
14
|
+
* select类型一定是一个array类型
|
|
15
|
+
* */
|
|
16
|
+
export declare function isSelect(curObj: any): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 判断是否是对象类型
|
|
19
|
+
* */
|
|
20
|
+
export declare function isObject(curObj: any): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 判断是否是单位类型
|
|
23
|
+
* */
|
|
24
|
+
export declare function isQuantity(val: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 判断是否是颜色值
|
|
27
|
+
* */
|
|
28
|
+
export declare function isColor(colorVal: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 判断是否是函数类型
|
|
31
|
+
* */
|
|
32
|
+
export declare function isFunction(curObj: any): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wibetter/json-utils",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "提供JSON相关的各类工具方法,比如schema转json、json转schema、json元数据分析等",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"json工具包",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"module": "dist/index.esm.js",
|
|
17
|
+
"types": "dist/main.d.ts",
|
|
17
18
|
"scripts": {
|
|
18
19
|
"build2lib": "akfun build2lib && npm run build2esm",
|
|
19
20
|
"build2esm": "akfun build2esm -n=index"
|
|
@@ -29,11 +30,13 @@
|
|
|
29
30
|
"url": "https://github.com/wibetter/json-utils/issues"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"lodash": "^4.17.
|
|
33
|
-
"qs": "^6.
|
|
33
|
+
"lodash": "^4.17.23",
|
|
34
|
+
"qs": "^6.14.1"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"
|
|
37
|
+
"@types/lodash": "^4.17.20",
|
|
38
|
+
"@types/qs": "^6.9.12",
|
|
39
|
+
"akfun": "^5.1.19"
|
|
37
40
|
},
|
|
38
41
|
"engines": {
|
|
39
42
|
"node": ">= 10.13.0",
|