@vtj/utils 0.3.3 → 0.3.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.
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@vtj/utils",
3
3
  "private": false,
4
- "version": "0.3.3",
4
+ "version": "0.3.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "setup": "npm install --registry=https://registry.npmmirror.com",
8
8
  "dev": "cross-env ENV_TYPE=dev vite",
9
9
  "build": "vue-tsc && vite build && npm run build:cdn",
10
10
  "build:cdn": "vue-tsc && cross-env CDN=true vite build",
11
- "test:unit": "vitest"
11
+ "test:unit": "vitest --environment jsdom",
12
+ "coverage": "vitest run --coverage --environment jsdom"
12
13
  },
13
14
  "devDependencies": {
14
- "@vtj/cli": "^0.3.3",
15
- "@vtj/deps": "^0.3.3"
15
+ "@vtj/cli": "^0.3.4",
16
+ "@vtj/deps": "^0.3.4"
16
17
  },
17
18
  "files": [
18
19
  "lib",
@@ -29,7 +30,7 @@
29
30
  "require": "./lib/index.js"
30
31
  }
31
32
  },
32
- "gitHead": "1e4758a9ece0c0ab6c078692fc38d56843bba33a",
33
+ "gitHead": "75b73af06e4448e21e97186828ba6c6079bde2c7",
33
34
  "publishConfig": {
34
35
  "access": "public"
35
36
  }
package/types/util.d.ts CHANGED
@@ -1,30 +1,10 @@
1
- export { get, set, isPlainObject, cloneDeep, merge, debounce, throttle, isEqual, camelCase, upperFirst, template } from 'lodash-es';
1
+ import { upperFirst, camelCase } from 'lodash-es';
2
+ export { get, set, isPlainObject, cloneDeep, merge, debounce, throttle, isEqual, template } from 'lodash-es';
3
+ export { upperFirst, camelCase };
2
4
  export declare function uid(): string;
3
5
  export declare function uuid(split?: boolean): string;
4
6
  export declare function isFunction(val: any): boolean;
5
- /**
6
- * 判断传入的参数是否为null,undefined或者空字符串
7
- * @param arg
8
- * @return {boolean}
9
- */
10
- export declare function isEmpty(arg: any): boolean;
11
- /**
12
- * 判断字符串是否为空
13
- * @param str
14
- */
15
- export declare function isTrimEmpty(str: string): boolean;
16
- /**
17
- * 判断传入的参数不为为null,undefined或者空字符串
18
- * @param arg
19
- * @return {boolean}
20
- */
21
- export declare function isNotEmpty(arg: string | null | undefined): boolean;
22
- /**
23
- * @desc 判断value是不是一个对象
24
- * @param value
25
- * @return boolean
26
- */
27
- export declare function isObject(value: any): boolean;
7
+ export declare function upperFirstCamelCase(name: string): string;
28
8
  /**
29
9
  * 提取对象属性
30
10
  * @param object
@@ -43,120 +23,3 @@ export declare function trim(obj: any): any;
43
23
  */
44
24
  export declare function toFixed(value: number, number: number | undefined, round: boolean): number;
45
25
  export declare function delay(val?: number): Promise<unknown>;
46
- /**
47
- * @desc 判断value是不是一个布尔值
48
- * @param value
49
- * @return {boolean}
50
- */
51
- export declare function isBoolean(value: any): boolean;
52
- /**
53
- * 树拷贝
54
- * @param source
55
- * @param childrenProperty
56
- * @param validate 校验元素是否需要拷贝的函数
57
- * @param copyMethod 自定义复制方法,如果传入了copyMethod,propertyArray就变为无效
58
- * @param propertyArray 需要拷贝的属性
59
- * @return {array}
60
- */
61
- export declare function copyTree({ source, childrenProperty, validate, copyMethod, propertyArray }: {
62
- source: Array<any>;
63
- childrenProperty: string;
64
- validate?: Function;
65
- copyMethod: Function;
66
- propertyArray: Array<string>;
67
- }): any[];
68
- /**
69
- * 对比两棵树是否一样
70
- * @param reference
71
- * @param target
72
- * @param childrenProperty
73
- * @param validate
74
- * @return {boolean}
75
- */
76
- export declare function compareTree({ reference, target, childrenProperty, validate }: {
77
- reference: any;
78
- target: any;
79
- childrenProperty: string;
80
- validate: Function;
81
- }): boolean;
82
- /**
83
- * 获取所有的叶子节点
84
- * @param tree
85
- * @param childrenProperty
86
- * @return {array}
87
- */
88
- export declare function getLeafList({ tree, childrenProperty }: {
89
- tree: Array<any>;
90
- childrenProperty: string;
91
- }): any[];
92
- /**
93
- * 阿里云oss图片路劲转换
94
- * @return {string|*}
95
- */
96
- export declare function ossTransferSrc({ src, width, height }: {
97
- src: string;
98
- width: number;
99
- height: number;
100
- }): string;
101
- /**
102
- * 将树转成二维数组
103
- * @param tree
104
- * @param childrenProperty
105
- * @param validate 是否转换的校验函数,返回true/false
106
- * @return {array}
107
- */
108
- export declare function treeToMultiDimensionArray({ tree, childrenProperty, validate }: {
109
- tree: Array<any>;
110
- childrenProperty: string;
111
- validate: Function;
112
- }): any[];
113
- /**
114
- * @desc 获取树的深度
115
- * @param tree 数组
116
- * @param childrenProperty 子节点的属性名,默认是children
117
- * @return {number} 返回深度值,如[]空数组是0, [{}]有一个元素是1, [{children[]}]也是1,[{children[{}]}]也是2
118
- */
119
- export declare function getTreeDeep({ tree, childrenProperty }: {
120
- tree: Array<any>;
121
- childrenProperty: string;
122
- }): number;
123
- /**
124
- * 将数组转成逗号分隔字符串
125
- * @param source
126
- * @param rowKey
127
- * @return {string|*}
128
- */
129
- export declare function fromArrayToCommaDivideString({ source, rowKey }: {
130
- source: Array<any>;
131
- rowKey: string;
132
- }): string;
133
- /**
134
- * 将逗号分隔字符串转成数组
135
- * @param source
136
- * @param rowKey
137
- * @return {*[]|any}
138
- */
139
- export declare function fromCommaDivideStringToArray({ source, rowKey }: {
140
- source: Array<any> | string;
141
- rowKey: string;
142
- }): any[];
143
- /**
144
- * 将数组转成json字符串
145
- * @param source
146
- * @param rowKey
147
- * @return {string|*}
148
- */
149
- export declare function fromArrayToJsonString({ source, rowKey }: {
150
- source: Array<any>;
151
- rowKey: string;
152
- }): string;
153
- /**
154
- * 将json字符串转成数组
155
- * @param source
156
- * @param rowKey
157
- * @return {*[]|any}
158
- */
159
- export declare function fromJsonStringToArray({ source, rowKey }: {
160
- source: Array<any> | string;
161
- rowKey: string;
162
- }): any[];