Skip to content

Commit 56fdeb8

Browse files
committedOct 5, 2024··
feat(typing): add NonVoid type
1 parent dcb0498 commit 56fdeb8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎typing/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export type Promisable<T> = T | Promise<T>
4242
/** Arrayable type. */
4343
export type Arrayable<T> = T | Array<T>
4444

45+
/** Non `void` type. */
46+
export type NonVoid<T> = T extends void ? never : T
47+
4548
/** Extract function argument. */
4649
// deno-lint-ignore no-explicit-any
4750
export type Arg<T extends ((...args: any[]) => any), index extends number = 0, required extends boolean = false> = required extends true ? NonNullable<Parameters<T>[index]> : Parameters<T>[index]

0 commit comments

Comments
 (0)
Please sign in to comment.