type-tls 3.1.1 → 3.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/dist/member.d.ts
CHANGED
|
@@ -19,3 +19,19 @@ export type MethodReturnType<Obj, Method extends keyof Obj> = Obj[Method] extend
|
|
|
19
19
|
* @typeParam Arr 数组
|
|
20
20
|
*/
|
|
21
21
|
export type ArrayItemType<Arr> = Arr extends (infer Item)[] ? Item : never;
|
|
22
|
+
/**
|
|
23
|
+
* 格式化为数组格式
|
|
24
|
+
* @remarks
|
|
25
|
+
* 如果 ItemOrArray 是数组,则保持不变
|
|
26
|
+
* 如果 ItemOrArray 不是数组,则转为数组类型 ItemOrArray[]
|
|
27
|
+
*/
|
|
28
|
+
export type FormatAsArray<ItemOrArray> = ItemOrArray extends any[] ? ItemOrArray : ItemOrArray[];
|
|
29
|
+
/**
|
|
30
|
+
* 格式化对象成员为数组格式
|
|
31
|
+
* @remarks
|
|
32
|
+
* 如果 成员 是数组,则保持不变
|
|
33
|
+
* 如果 成员 不是数组,则转为数组类型
|
|
34
|
+
*/
|
|
35
|
+
export type FormatMemberAsArray<D> = {
|
|
36
|
+
[K in keyof D]: FormatAsArray<D[K]>;
|
|
37
|
+
};
|
package/dist/type-tls.d.ts
CHANGED
|
@@ -86,6 +86,24 @@ export declare type ExactType = LooseType | Exclude<TypeOfReturnType, "undefined
|
|
|
86
86
|
*/
|
|
87
87
|
export declare type ExactTypeName = LooseTypeName | Exclude<TypeOfReturnType, "undefined" | "function" | "object">;
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* 格式化为数组格式
|
|
91
|
+
* @remarks
|
|
92
|
+
* 如果 ItemOrArray 是数组,则保持不变
|
|
93
|
+
* 如果 ItemOrArray 不是数组,则转为数组类型 ItemOrArray[]
|
|
94
|
+
*/
|
|
95
|
+
export declare type FormatAsArray<ItemOrArray> = ItemOrArray extends any[] ? ItemOrArray : ItemOrArray[];
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 格式化对象成员为数组格式
|
|
99
|
+
* @remarks
|
|
100
|
+
* 如果 成员 是数组,则保持不变
|
|
101
|
+
* 如果 成员 不是数组,则转为数组类型
|
|
102
|
+
*/
|
|
103
|
+
export declare type FormatMemberAsArray<D> = {
|
|
104
|
+
[K in keyof D]: FormatAsArray<D[K]>;
|
|
105
|
+
};
|
|
106
|
+
|
|
89
107
|
/**
|
|
90
108
|
* 获取 inst 的精确类型的字符串表示
|
|
91
109
|
* @param inst
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [type-tls](./type-tls.md) > [FormatAsArray](./type-tls.formatasarray.md)
|
|
4
|
+
|
|
5
|
+
## FormatAsArray type
|
|
6
|
+
|
|
7
|
+
格式化为数组格式
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type FormatAsArray<ItemOrArray> = ItemOrArray extends any[] ? ItemOrArray : ItemOrArray[];
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
如果 ItemOrArray 是数组,则保持不变 如果 ItemOrArray 不是数组,则转为数组类型 ItemOrArray\[\]
|
|
18
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [type-tls](./type-tls.md) > [FormatMemberAsArray](./type-tls.formatmemberasarray.md)
|
|
4
|
+
|
|
5
|
+
## FormatMemberAsArray type
|
|
6
|
+
|
|
7
|
+
格式化对象成员为数组格式
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type FormatMemberAsArray<D> = {
|
|
13
|
+
[K in keyof D]: FormatAsArray<D[K]>;
|
|
14
|
+
};
|
|
15
|
+
```
|
|
16
|
+
**References:** [FormatAsArray](./type-tls.formatasarray.md)
|
|
17
|
+
|
|
18
|
+
## Remarks
|
|
19
|
+
|
|
20
|
+
如果 成员 是数组,则保持不变 如果 成员 不是数组,则转为数组类型
|
|
21
|
+
|
package/doc/api/type-tls.md
CHANGED
|
@@ -323,6 +323,28 @@ Description
|
|
|
323
323
|
精确类型的字符串表示
|
|
324
324
|
|
|
325
325
|
|
|
326
|
+
</td></tr>
|
|
327
|
+
<tr><td>
|
|
328
|
+
|
|
329
|
+
[FormatAsArray](./type-tls.formatasarray.md)
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
</td><td>
|
|
333
|
+
|
|
334
|
+
格式化为数组格式
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
</td></tr>
|
|
338
|
+
<tr><td>
|
|
339
|
+
|
|
340
|
+
[FormatMemberAsArray](./type-tls.formatmemberasarray.md)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
</td><td>
|
|
344
|
+
|
|
345
|
+
格式化对象成员为数组格式
|
|
346
|
+
|
|
347
|
+
|
|
326
348
|
</td></tr>
|
|
327
349
|
<tr><td>
|
|
328
350
|
|