import { BlockEntity } from "@logseq/libs/dist/LSPlugin.user" ; function hasProperty ( block , propertyKey ) { return block . properties ?. [ propertyKey ] !== undefined ; } export function toBatchBlocks ( blocks ) { return blocks . map ( ( c ) => ( { content : c . content , children : c . children ?. length ? toBatchBlocks ( c . children as BlockEntity [ ] ) : undefined , properties : c . properties } ) ) ; } export function mayBeReferenced ( blocks ) { return blocks . some ( ( b ) => { if ( hasProperty ( b , "id" ) ) { return true ; } else { if ( b . children ) { return mayBeReferenced ( b . children as BlockEntity [ ] ) ; } else { return false ; } } } ) ; }