@esportsplus/typescript 0.0.4 → 0.0.6
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/build/types.d.ts +2 -2
- package/package.json +1 -1
- package/src/types.ts +3 -3
package/build/types.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ type Function = (...args: unknown[]) => Promise<unknown> | unknown;
|
|
|
2
2
|
type Prettify<T> = {
|
|
3
3
|
[K in keyof T]: T[K];
|
|
4
4
|
} & {};
|
|
5
|
-
type SyncFunction<T, R = T extends
|
|
6
|
-
export { Prettify, SyncFunction };
|
|
5
|
+
type SyncFunction<T, R = T extends ((...args: unknown[]) => Promise<unknown> | unknown) ? ReturnType<T> : T> = T extends Promise<unknown> ? never : T extends ((...args: unknown[]) => Promise<unknown> | unknown) ? SyncFunction<R> extends never ? never : T : T;
|
|
6
|
+
export { Function, Prettify, SyncFunction };
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -4,14 +4,14 @@ type Prettify<T> = {
|
|
|
4
4
|
[K in keyof T]: T[K];
|
|
5
5
|
} & {};
|
|
6
6
|
|
|
7
|
-
type SyncFunction<T, R = T extends
|
|
7
|
+
type SyncFunction<T, R = T extends ((...args: unknown[]) => Promise<unknown> | unknown) ? ReturnType<T> : T> =
|
|
8
8
|
T extends Promise<unknown>
|
|
9
9
|
? never
|
|
10
|
-
: T extends
|
|
10
|
+
: T extends ((...args: unknown[]) => Promise<unknown> | unknown)
|
|
11
11
|
? SyncFunction<R> extends never
|
|
12
12
|
? never
|
|
13
13
|
: T
|
|
14
14
|
: T;
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
export { Prettify, SyncFunction };
|
|
17
|
+
export { Function, Prettify, SyncFunction };
|