From a034ac499087fa166db859dc5804c325a71b8688 Mon Sep 17 00:00:00 2001 From: Robby6Strings Date: Wed, 17 Jul 2024 05:03:49 +1200 Subject: [PATCH] standardize portal/signal 'is' checks --- packages/lib/src/portal.ts | 2 +- packages/lib/src/signal.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lib/src/portal.ts b/packages/lib/src/portal.ts index 050dbfac..28d85f39 100644 --- a/packages/lib/src/portal.ts +++ b/packages/lib/src/portal.ts @@ -18,7 +18,7 @@ class Portal extends Component { } static isPortal(type: unknown): type is typeof Portal { - return !!type && typeof type === "function" && portalIdentifier in type + return typeof type === "function" && portalIdentifier in type } render(): JSX.Element { diff --git a/packages/lib/src/signal.ts b/packages/lib/src/signal.ts index f93ccca0..3d1cb5b6 100644 --- a/packages/lib/src/signal.ts +++ b/packages/lib/src/signal.ts @@ -42,7 +42,7 @@ export class Signal { } static isSignal(x: any): x is Signal { - return x && x[SignalKey] + return typeof x === "object" && !!x && SignalKey in x } static subscribeNode(node: Kaioken.VNode, signal: Signal) {