nhanh-pure-function 3.0.6-beta.6 → 3.0.6-beta.7

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.
@@ -100,4 +100,12 @@ type UnitName = (typeof UnitConfigs)[number][0];
100
100
  * 3. 输入校验:非整数或负数会返回"0毫秒"
101
101
  */
102
102
  export declare function _Format_MillisecondToReadable(ms: number, maxUnit?: UnitName): string;
103
+ /**
104
+ * 将数组按指定长度分割成多个子数组
105
+ * @param arr 要分割的原始数组
106
+ * @param size 每个子数组的长度
107
+ * @returns 分割后的二维数组
108
+ * @throws 当size小于1时抛出错误
109
+ */
110
+ export declare function _Format_ChunkArray<T>(arr: T[], size: number): T[][];
103
111
  export {};
@@ -8,7 +8,7 @@
8
8
  * type RequiredName = RequiredBy<User, 'name'>
9
9
  * // 结果:{ name: string; age?: number; id: string }
10
10
  */
11
- export type RequiredBy<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
11
+ export type _Type_RequiredBy<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
12
12
  /**
13
13
  * 将类型 T 中指定的属性 K 改为可选,其他属性保持原有状态(必填/可选)
14
14
  * @template T - 原始类型
@@ -19,13 +19,16 @@ export type RequiredBy<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>
19
19
  * type OptionalAge = PartialBy<User, 'age'>
20
20
  * // 结果:{ name: string; age?: number; id?: string }
21
21
  */
22
- export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
22
+ export type _Type_PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
23
23
  /**
24
24
  * 递归将类型T的所有属性(包括嵌套对象的属性)转为可选
25
25
  * @template T - 要处理的基础类型
26
26
  * @description 与TypeScript内置的Partial不同,DeepPartial会对嵌套对象进行递归处理,
27
27
  * 使所有层级的属性都变为可选。适用于需要部分更新对象且允许深层属性缺失的场景
28
28
  */
29
- export type DeepPartial<T> = {
29
+ export type _Type_DeepPartial<T> = {
30
30
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
31
31
  };
32
+ export type _Type_Mutable<T> = {
33
+ -readonly [P in keyof T]: T[P];
34
+ };