Skip to content

Commit

Permalink
$mol_wire_async, $mol_wire_sync fix types3
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Oct 3, 2023
1 parent aeb3f02 commit 1112030
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions wire/async/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ namespace $ {
[K in keyof Host]: FunctionResultPromisify<Host[K]>
}

type ObjectOrFunctionResultPromisify<Some> = Some extends (...args: any) => unknown
? FunctionResultPromisify<Some>
: Some extends Object ? MethodsResultPromisify<Some> : Some
type ObjectOrFunctionResultPromisify<Some> = (
Some extends (...args: any) => unknown ? FunctionResultPromisify<Some> : {}
) & ( Some extends Object ? MethodsResultPromisify<Some> : Some )

}
6 changes: 3 additions & 3 deletions wire/sync/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace $ {
[K in keyof Host]: FunctionResultAwaited<Host[K]>
}

type ObjectOrFunctionResultAwaited<Some> = Some extends (...args: any) => unknown
? FunctionResultAwaited<Some>
: Some extends Object ? MethodsResultAwaited<Some> : Some
type ObjectOrFunctionResultAwaited<Some> = (
Some extends (...args: any) => unknown ? FunctionResultAwaited<Some> : {}
) & ( Some extends Object ? MethodsResultAwaited<Some> : Some )

}

0 comments on commit 1112030

Please sign in to comment.