import { Node , Block , BlockNode , BlockNodeWithContent , TextNode , TextType , ComponentNode , ComponentType , } from '@marvr/storyblok-rich-text-types' ; function createEnumChecker < T extends string , TEnumValue extends string > ( enumVariable ) { const enumValues = Object . values ( enumVariable ) ; return ( value ) : value is TEnumValue => enumValues . includes ( value ) ; } const isBlock = createEnumChecker ( Block ) ; export function isBlockNode ( node ) { return isBlock ( node . type ) ; } export function isTextNode ( node ) { return node . type === TextType ; } export function isBlockNodeWithContent ( node ) { return 'content' in node ; } export function isComponentNode ( node ) { return node . type === ComponentType ; }