UNPKG

sanity

Version:

Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches

22 lines (18 loc) 566 B
import {type SchemaTypeDefinition} from '@sanity/types' const BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset'] /** * @internal */ export function _isSanityDocumentTypeDefinition( def: SchemaTypeDefinition, ): def is SchemaTypeDefinition<'document'> { return def.type === 'document' && BUNDLED_DOC_TYPES.includes(def.name) } /** * @internal */ export function _isCustomDocumentTypeDefinition( def: SchemaTypeDefinition, ): def is SchemaTypeDefinition<'document'> { return def.type === 'document' && !_isSanityDocumentTypeDefinition(def) }