@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yh-kit/utils",
3
3
  "private": false,
4
- "version": "1.2.0",
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
+ }>;
@@ -0,0 +1,2 @@
1
+ export type * from "./enum-obj";
2
+ export type * from "./option";
@@ -1,12 +1,5 @@
1
1
  /**
2
- * 枚举对象类型
3
- */
4
- export type TValueEnum = Record<string | number | symbol, {
5
- text: string;
6
- [key: string]: unknown;
7
- }>;
8
- /**
9
- * 枚举对象类型
2
+ * option对象类型
10
3
  */
11
4
  export interface IOptionItem {
12
5
  /** 值 */
@@ -1,4 +1,4 @@
1
- import { IOptionItem, TValueEnum } from "../typings";
1
+ import { IOptionItem, TValueEnum } from "../../../typings/src";
2
2
  /**
3
3
  * 数组转枚举对象
4
4
  * @param arr 数组
@@ -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("../typings").IOptionItem[]) => import("../typings").TValueEnum;
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