@esportsplus/typescript 0.0.11 → 0.0.13

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  type Function = (...args: unknown[]) => Promise<unknown> | unknown;
2
2
  type NeverAsync<T> = T extends Promise<unknown> ? never : T extends (...args: unknown[]) => unknown ? (...args: Parameters<T>) => ReturnType<T> extends NeverAsync<unknown> ? ReturnType<T> : NeverAsync<ReturnType<T>> : T;
3
+ type NeverFunction<T> = T extends Promise<unknown> ? never : T extends (...args: unknown[]) => unknown ? never : T;
3
4
  type Prettify<T> = {
4
5
  [K in keyof T]: T[K];
5
6
  } & {};
6
- export { Function, NeverAsync, Prettify };
7
+ export { Function, NeverAsync, NeverFunction, Prettify };
package/package.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "prepublishOnly": "npm run build"
23
23
  },
24
24
  "types": "build/index.d.ts",
25
- "version": "0.0.11"
25
+ "version": "0.0.13"
26
26
  }
package/src/types.ts CHANGED
@@ -9,9 +9,16 @@ type NeverAsync<T> =
9
9
  : NeverAsync<ReturnType<T>>
10
10
  : T;
11
11
 
12
+ type NeverFunction<T> =
13
+ T extends Promise<unknown>
14
+ ? never
15
+ : T extends (...args: unknown[]) => unknown
16
+ ? never
17
+ : T;
18
+
12
19
  type Prettify<T> = {
13
20
  [K in keyof T]: T[K];
14
21
  } & {};
15
22
 
16
23
 
17
- export { Function, NeverAsync, Prettify };
24
+ export { Function, NeverAsync, NeverFunction, Prettify };