Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

686 B
Raw Blame
interface RoomDocumentBlock {
  children: readonly RoomDocumentBlock[];
  content?: unknown;
  type: string;
}

export function roomDocumentBlocksAreEmpty(
  blocks: readonly RoomDocumentBlock[],
): boolean {
  return blocks.every((block) => {
    if (block.type !== "paragraph" && block.type !== "heading") {
      return false;
    }
    const content = Array.isArray(block.content) ? block.content : [];
    const hasText = content.some((inline) => {
      if (!inline || typeof inline !== "object") {
        return false;
      }
      return "text" in inline && String(inline.text).trim() !== "";
    });
    return !hasText && roomDocumentBlocksAreEmpty(block.children);
  });
}