11import {
22 cloneVNode ,
3- Comment ,
3+ Comment as CommentVNode ,
44 type Component ,
55 type ComponentOptions ,
66 createCommentVNode ,
77 createTextVNode ,
8- Fragment ,
8+ Fragment as FragmentVNode ,
99 type FunctionalComponent ,
1010 isVNode ,
11- Static ,
12- Text ,
11+ Static as StaticVNode ,
12+ Text as TextVNode ,
1313 type VNode ,
1414 type VNodeArrayChildren ,
1515 type VNodeChild
@@ -18,7 +18,7 @@ import {
1818// @ts -ignore
1919const DEV = process . env . NODE_ENV !== 'production'
2020
21- export const isComment = ( vnode : unknown ) : vnode is ( null | undefined | boolean | ( VNode & { type : Comment } ) ) => {
21+ export const isComment = ( vnode : unknown ) : vnode is ( null | undefined | boolean | ( VNode & { type : typeof CommentVNode } ) ) => {
2222 return getType ( vnode ) === 'comment'
2323}
2424
@@ -30,7 +30,7 @@ export const isElement = (vnode: unknown): vnode is (VNode & { type: string }) =
3030 return getType ( vnode ) === 'element'
3131}
3232
33- export const isFragment = ( vnode : unknown ) : vnode is ( ( VNode & { type : typeof Fragment } ) | VNodeArrayChildren ) => {
33+ export const isFragment = ( vnode : unknown ) : vnode is ( ( VNode & { type : typeof FragmentVNode } ) | VNodeArrayChildren ) => {
3434 return getType ( vnode ) === 'fragment'
3535}
3636
@@ -42,11 +42,11 @@ export const isStatefulComponent = (vnode: unknown): vnode is (VNode & { type: C
4242 return isComponent ( vnode ) && typeof vnode . type === 'object'
4343}
4444
45- export const isStatic = ( vnode : unknown ) : vnode is ( VNode & { type : typeof Static } ) => {
45+ export const isStatic = ( vnode : unknown ) : vnode is ( VNode & { type : typeof StaticVNode } ) => {
4646 return getType ( vnode ) === 'static'
4747}
4848
49- export const isText = ( vnode : unknown ) : vnode is ( string | number | ( VNode & { type : Text } ) ) => {
49+ export const isText = ( vnode : unknown ) : vnode is ( string | number | ( VNode & { type : typeof TextVNode } ) ) => {
5050 return getType ( vnode ) === 'text'
5151}
5252
@@ -59,7 +59,7 @@ export const getText = (vnode: VNode | string | number): string | undefined => {
5959 return String ( vnode )
6060 }
6161
62- if ( isVNode ( vnode ) && vnode . type === Text ) {
62+ if ( isVNode ( vnode ) && vnode . type === TextVNode ) {
6363 return String ( vnode . children )
6464 }
6565
@@ -119,13 +119,13 @@ export const getType = (vnode: unknown) => {
119119 const typeofType = typeof type
120120
121121 if ( typeofType === 'symbol' ) {
122- if ( type === Fragment ) {
122+ if ( type === FragmentVNode ) {
123123 return 'fragment'
124- } else if ( type === Text ) {
124+ } else if ( type === TextVNode ) {
125125 return 'text'
126- } else if ( type === Comment ) {
126+ } else if ( type === CommentVNode ) {
127127 return 'comment'
128- } else if ( type === Static ) {
128+ } else if ( type === StaticVNode ) {
129129 return 'static'
130130 }
131131 } else if ( typeofType === 'string' ) {
0 commit comments