From 9bf2719e77eaad785077f0b9bb32c6dd89cb07a3 Mon Sep 17 00:00:00 2001 From: AlexandrHoroshih Date: Sat, 18 Nov 2023 16:44:40 +0700 Subject: [PATCH] Fix build --- src/combine-events/index.ts | 4 ++-- src/condition/index.ts | 22 ++++++++++++---------- src/debug/index.ts | 2 +- tsconfig.json | 1 - 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/combine-events/index.ts b/src/combine-events/index.ts index b15fc514..95d2e9eb 100644 --- a/src/combine-events/index.ts +++ b/src/combine-events/index.ts @@ -49,7 +49,7 @@ export function combineEvents

({ reset, target = createEvent(), }: { - events: Events

; + events: Events; reset?: Unit; target?: UnitTargetable | Unit; }) { @@ -83,7 +83,7 @@ export function combineEvents

({ $counter.on($isDone, (value) => value - 1); $results.on(events[key], (shape, payload) => { - const newShape = Array.isArray(shape) ? [...shape] : { ...shape }; + const newShape = (Array.isArray(shape) ? [...shape] : { ...shape }) as any; newShape[key] = payload; return newShape; }); diff --git a/src/condition/index.ts b/src/condition/index.ts index fdf36043..590d6955 100644 --- a/src/condition/index.ts +++ b/src/condition/index.ts @@ -68,16 +68,16 @@ export function condition(options: { export function condition(options: { if: ((payload: State) => boolean) | Store | State; - then: Unit | void>; - else: Unit | void>; + then: UnitTargetable | void>; + else: UnitTargetable | void>; }): EventAsReturnType; export function condition(options: { if: ((payload: State) => boolean) | Store | State; - then: Unit | void>; + then: UnitTargetable | void>; }): Event; export function condition(options: { if: ((payload: State) => boolean) | Store | State; - else: Unit | void>; + else: UnitTargetable | void>; }): Event; export function condition({ if: test, @@ -87,8 +87,8 @@ export function condition({ }: { if: ((payload: State) => boolean) | Store | State; source?: Store | Event | Effect; - then?: Unit; - else?: Unit; + then?: UnitTargetable; + else?: UnitTargetable; }) { const checker = is.unit(test) || isFunction(test) ? test : (value: State) => value === test; @@ -98,7 +98,7 @@ export function condition({ source, match: { then: checker, - else: inverse(checker), + else: inverse(checker as any), }, cases: { then: thenBranch, @@ -106,16 +106,18 @@ export function condition({ }, } as any); } else if (thenBranch) { + // @ts-expect-error sample({ - source, + source: source, filter: checker, - target: thenBranch as Unit, + target: thenBranch, }); } else if (elseBranch) { + // @ts-expect-error sample({ source, filter: inverse(checker as any), - target: elseBranch as Unit, + target: elseBranch, }); } diff --git a/src/debug/index.ts b/src/debug/index.ts index 5094f9fb..b0adcbfa 100644 --- a/src/debug/index.ts +++ b/src/debug/index.ts @@ -412,7 +412,7 @@ function getType(unit: Unit | Node) { if (is.store(unit)) { return 'store'; } - if (is.effect(unit) || isEffectChild(unit)) { + if (is.effect(unit as any) || isEffectChild(unit)) { return 'effect'; } if (is.event(unit)) { diff --git a/tsconfig.json b/tsconfig.json index 783137cf..1b31401e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,6 @@ "strict": true, "strictNullChecks": true, "skipLibCheck": true, - "suppressImplicitAnyIndexErrors": true, "target": "es2016", "types": ["jest", "node"] },