UNPKG

@udus/notion-renderer

Version:
25 lines (24 loc) 800 B
import { convertResponseToRichText } from "../../richText/richText.js"; import { fetchBlockList } from "../fetchBlockList.js"; export const convertToDoResponseToBlock = async (block, client) => { if (block.has_children) { const { ok, data } = await fetchBlockList(client, { block_id: block.id }); if (ok) { return { ...block, to_do: { ...block.to_do, rich_text: await convertResponseToRichText(block.to_do.rich_text, client), children: data, }, }; } } return { ...block, to_do: { ...block.to_do, rich_text: await convertResponseToRichText(block.to_do.rich_text, client), }, }; };