import { Node , Block , Inline , Text } from './types' ; import { BLOCKS } from './blocks' ; import { INLINES } from './inlines' ; /**
 * Tiny replacement for Object.values(object).includes(key) to
 * avoid including CoreJS polyfills
 */ function hasValue ( obj , value ) { for ( const key of Object . keys ( obj ) ) { if ( value === obj [ key ] ) { return true ; } } return false ; } /**
 * Checks if the node is an instance of Inline.
 */ export function isInline ( node ) { return hasValue ( INLINES , node . nodeType ) ; } /**
 * Checks if the node is an instance of Block.
 */ export function isBlock ( node ) { return hasValue ( BLOCKS , node . nodeType ) ; } /**
 * Checks if the node is an instance of Text.
 */ export function isText ( node ) { return node . nodeType === 'text' ; }