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 0998f46 commit a0ca0a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions async/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
export type Operator<A, B> = (v: A) => B | Promise<B>;

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

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 a0ca0a7

Please sign in to comment.