fix: workflow 'when' should return T or undefined instead of Partial<T> (#8195)

* fix: workflow 'when' should return T or undefined instead of Partial<T>

* fix when usage
This commit is contained in:
Adrien de Peretti
2024-07-19 10:46:55 +02:00
committed by GitHub
parent 78b8a3c60f
commit 35c3759ed8
3 changed files with 7 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ type ConditionFunction<T extends object | WorkflowData> = (
type ThenFunc = <ThenResolver extends () => any>(
resolver: ThenResolver
) => ReturnType<ThenResolver> extends WorkflowData<infer ReturnedWorkflowData>
? Partial<WorkflowData<ReturnedWorkflowData>>
? WorkflowData<ReturnedWorkflowData> | undefined
: ReturnType<ThenResolver>
export function when<T extends object | WorkflowData, Then extends Function>(