UNPKG

@portabletext/block-tools

Version:

Can format HTML, Slate JSON or Sanity block array into any other format.

14 lines (10 loc) 268 B
import type {BlockSchemaType, SchemaType} from '@sanity/types' export function findBlockType(type: SchemaType): type is BlockSchemaType { if (type.type) { return findBlockType(type.type) } if (type.name === 'block') { return true } return false }