fix a TS issue
This commit is contained in:
parent
cbd1719227
commit
04024a2a8d
@ -7,7 +7,7 @@ export type Complex<T> = { re: T; im: T; }
|
|||||||
export const Complex_type = {
|
export const Complex_type = {
|
||||||
test: <T>(dep: { testT: (z: unknown) => z is T }) =>
|
test: <T>(dep: { testT: (z: unknown) => z is T }) =>
|
||||||
(z: unknown): z is Complex<T> =>
|
(z: unknown): z is Complex<T> =>
|
||||||
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),
|
&& dep.testT(z.re) && dep.testT(z.im),
|
||||||
infer: (dep: typeOfDependency) =>
|
infer: (dep: typeOfDependency) =>
|
||||||
(z: Complex<unknown>) => joinTypes(dep.typeOf(z.re), dep.typeOf(z.im)),
|
(z: Complex<unknown>) => joinTypes(dep.typeOf(z.re), dep.typeOf(z.im)),
|
||||||
|
Loading…
Reference in New Issue
Block a user