mirror of
https://github.com/bendtherules/react-fiber-traverse.git
synced 2026-08-18 22:01:49 +00:00
Add better type check utils for HTMLLike
This commit is contained in:
+8
-2
@@ -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;
|
return (typeof node.type === "string") || node.type === null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { isNodeSimple };
|
function isNotHtmlLike(node: FiberNode): node is Exclude<FiberNode, FiberNodeisHTMLLike> {
|
||||||
|
return (typeof node.type === "string") || node.type === null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export { isHtmlLike, isNotHtmlLike };
|
||||||
Reference in New Issue
Block a user