Skip to content

Commit

Permalink
double-wrapping-bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
uriva committed Jan 10, 2025
1 parent a30a1db commit 0484190
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/composition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ const _generics8: <T extends number>(t: T) => T = pipe(
<T extends string>(t: T) => t,
);

const _generics9: Promise<number> = pipe((x) => Promise.resolve(x))(8);

// failing typing tests:

// Generics understands contextual extends
Expand Down
2 changes: 2 additions & 0 deletions src/composition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,5 @@ export const always = <T>(x: T) => () => x;
export const identity = <T>(x: T) => x;

export const thunk = <F extends Func>(f: () => F) => ((...x) => f()(...x)) as F;


2 changes: 1 addition & 1 deletion src/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export type UnaryFnUntyped = (input: any) => any;

export type PromisifyFunction<F extends Func> = (
...args: Parameters<F>
) => Promise<ReturnType<F>>;
) => Promise<Awaited<ReturnType<F>>>;

0 comments on commit 0484190

Please sign in to comment.