From 4af377f1ba0b5e6876f7c6c821b69ba69595f252 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Mon, 22 Jul 2019 18:47:32 +0530 Subject: [PATCH] Add better type check utils for HTMLLike --- src/utils.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 33afafd..1b15d98 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,11 @@ -function isNodeSimple(node) { +import { FiberNode, FiberNodeisHTMLLike } from './mocked-types'; + +function isHtmlLike(node: FiberNode): node is FiberNodeisHTMLLike { return (typeof node.type === "string") || node.type === null; } -export { isNodeSimple }; \ No newline at end of file +function isNotHtmlLike(node: FiberNode): node is Exclude { + return (typeof node.type === "string") || node.type === null; +} + +export { isHtmlLike, isNotHtmlLike }; \ No newline at end of file