MCPcopy Create free account
hub / github.com/code100x/daily-code / normalizeRecordMap

Function normalizeRecordMap

apps/web/lib/notion.ts:3–16  ·  view source on GitHub ↗
(recordMap: any)

Source from the content-addressed store, hash-verified

1import { NotionAPI } from "notion-client";
2import { HttpsProxyAgent } from "https-proxy-agent";
3
4function normalizeBlocks(block: any) {
5 if (!block) return {};
6 const normalizedBlock: any = {};
7 for (const [key, b] of Object.entries(block) as any) {
8 if (!b?.value) continue;
9 const value = b.value;
10 if (!value.type && value.value?.type) {
11 normalizedBlock[key] = { ...b, value: value.value };
12 } else {
13 normalizedBlock[key] = b;
14 }
15 }
16 return normalizedBlock;
17}
18
19function collectContentBlockIds(recordMap: any): string[] {

Callers 1

fetchNotionPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected