@yh-kit/utils 1.2.0 → 1.2.1
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 +6 -3
- package/types/typings/src/enum-obj.d.ts +14 -0
- package/types/typings/src/index.d.ts +2 -0
- package/types/typings/{index.d.ts → src/option.d.ts} +1 -8
- package/types/{array → utils/lib/array}/array2obj.d.ts +1 -1
- package/types/{array → utils/lib/array}/index.d.ts +1 -1
- /package/types/{index.d.ts → utils/lib/index.d.ts} +0 -0
- /package/types/{letter → utils/lib/letter}/index.d.ts +0 -0
- /package/types/{number → utils/lib/number}/index.d.ts +0 -0
- /package/types/{number → utils/lib/number}/letter.d.ts +0 -0
- /package/types/{number → utils/lib/number}/money.d.ts +0 -0
- /package/types/{phone → utils/lib/phone}/index.d.ts +0 -0
- /package/types/{string → utils/lib/string}/index.d.ts +0 -0
- /package/types/{url → utils/lib/url}/index.d.ts +0 -0
- /package/types/{url → utils/lib/url}/query.d.ts +0 -0
- /package/types/{waterfall → utils/lib/waterfall}/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yh-kit/utils",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
],
|
|
10
10
|
"main": "./dist/utils.umd.cjs",
|
|
11
11
|
"module": "./dist/utils.js",
|
|
12
|
-
"types": "./types/index.d.ts",
|
|
12
|
+
"types": "./types/utils/lib/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
|
-
"types": "./types/index.d.ts",
|
|
14
|
+
"types": "./types/utils/lib/index.d.ts",
|
|
15
15
|
"import": "./dist/utils.js",
|
|
16
16
|
"require": "./dist/utils.umd.cjs"
|
|
17
17
|
},
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"typescript": "catalog:",
|
|
28
28
|
"vite": "catalog:"
|
|
29
29
|
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@yh-kit/types": "workspace:*"
|
|
32
|
+
},
|
|
30
33
|
"publishConfig": {
|
|
31
34
|
"main": "dist/utils.js",
|
|
32
35
|
"access": "public",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 枚举对象类型
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* const enumObj = {
|
|
6
|
+
* 1: { key: 1, label: '男', text: '男' },
|
|
7
|
+
* 2: { key: 1, label: '女',text: '女' },
|
|
8
|
+
* } as TValueEnum;
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export type TValueEnum = Record<string | number | symbol, {
|
|
12
|
+
text: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}>;
|
|
@@ -29,5 +29,5 @@ export declare const arrayUtils: {
|
|
|
29
29
|
* @returns 排序后的数组
|
|
30
30
|
*/
|
|
31
31
|
sort<T>(arr: T[], order?: "asc" | "desc"): T[];
|
|
32
|
-
toEnumObj: (arr: import("
|
|
32
|
+
toEnumObj: (arr: import("@yh-kit/types").IOptionItem[]) => import("@yh-kit/types").TValueEnum;
|
|
33
33
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|