Accessing the 'to_do' Property from a Notion Block with TypeScript

Using the final Notion API in TypeScript, I retrieve block children. However, accessing the ‘to_do’ attribute triggers a type error. Code sample provided below:

(async function fetchBlocks() {
  const uniqueKey = process.env.UNIQUE_BLOCK_ID;
  const resultSet = await client.blocks.children.list({
    block_id: uniqueKey,
    max_items: 50
  });
  console.log(resultSet.results[0].to_do);
})();

hey ethan, check if the block type is actually to_do befor accessing it. typeguards or optional chaning might help to ensure the property exists when you try, cuz not al blocks have that key.