From 04024a2a8df83dea08d7293686b71fcafc0659eb Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Fri, 23 Dec 2022 12:22:41 +0100 Subject: [PATCH] fix a TS issue --- src/Complex/type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Complex/type.ts b/src/Complex/type.ts index d0845c8..50a231f 100644 --- a/src/Complex/type.ts +++ b/src/Complex/type.ts @@ -7,7 +7,7 @@ export type Complex = { re: T; im: T; } export const Complex_type = { test: (dep: { testT: (z: unknown) => z is T }) => (z: unknown): z is Complex => - typeof z === 'object' && 're' in z && 'im' in z + typeof z === 'object' && z != null && 're' in z && 'im' in z && dep.testT(z.re) && dep.testT(z.im), infer: (dep: typeOfDependency) => (z: Complex) => joinTypes(dep.typeOf(z.re), dep.typeOf(z.im)),