Skip to content

Commit

Permalink
feat!: private LastOperatorReturn type
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed Aug 22, 2024
1 parent f840db3 commit aa0829f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion async/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export type AsyncOperator<A, B> = (v: A) => B | Promise<B>;

/**
* Get the return type of the last operator in a list of operators.
* @internal
*/
type LastAsyncOperatorReturn<
T extends AsyncOperator<unknown, unknown>[],
Expand Down
8 changes: 4 additions & 4 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
export type Operator<A, B> = (v: A) => B;

/**
* Get the return type of the last operator in a list of operators.
* @internal
*/
export type LastOperatorReturn<T extends Operator<unknown, unknown>[]> =
T extends [...Operator<unknown, unknown>[], Operator<unknown, infer R>] ? R
: never;
type LastOperatorReturn<T extends Operator<unknown, unknown>[]> = T extends
[...Operator<unknown, unknown>[], Operator<unknown, infer R>] ? R
: never;

/**
* Pipes a value through a series of operator functions.
Expand Down

0 comments on commit aa0829f

Please sign in to comment.