From e8b16179160242f5eca64c1d483bebda3ee555bd Mon Sep 17 00:00:00 2001 From: Jiaxin Peng Date: Wed, 28 Aug 2024 20:30:05 +0100 Subject: [PATCH] fix item type error for iteration --- src/upload/upload_general/Upload2NotionGeneral.ts | 2 +- src/upload/upload_next/Upload2NotionNext.ts | 2 +- src/upload/upoload_custom/Upload2NotionCustom.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/upload/upload_general/Upload2NotionGeneral.ts b/src/upload/upload_general/Upload2NotionGeneral.ts index 977b9d8..8f9201a 100644 --- a/src/upload/upload_general/Upload2NotionGeneral.ts +++ b/src/upload/upload_general/Upload2NotionGeneral.ts @@ -61,7 +61,7 @@ export class Upload2NotionGeneral extends UploadBaseGeneral { // remove the annotations from the childArr if type is code block childArr.forEach((block: any) => { if (block.type === "code") { - block.code.rich_text.forEach(item => { + block.code.rich_text.forEach((item: any) => { if (item.type === "text" && item.annotations) { delete item.annotations; } diff --git a/src/upload/upload_next/Upload2NotionNext.ts b/src/upload/upload_next/Upload2NotionNext.ts index a902b2f..832e163 100644 --- a/src/upload/upload_next/Upload2NotionNext.ts +++ b/src/upload/upload_next/Upload2NotionNext.ts @@ -85,7 +85,7 @@ export class Upload2NotionNext extends UploadBaseNext { // remove the annotations from the childArr if type is code block childArr.forEach((block: any) => { if (block.type === "code") { - block.code.rich_text.forEach(item => { + block.code.rich_text.forEach((item: any) => { if (item.type === "text" && item.annotations) { delete item.annotations; } diff --git a/src/upload/upoload_custom/Upload2NotionCustom.ts b/src/upload/upoload_custom/Upload2NotionCustom.ts index c64b46f..de64711 100644 --- a/src/upload/upoload_custom/Upload2NotionCustom.ts +++ b/src/upload/upoload_custom/Upload2NotionCustom.ts @@ -57,11 +57,11 @@ export class Upload2NotionCustom extends UploadBaseCustom { // remove the annotations from the childArr if type is code block childArr.forEach((block: any) => { if (block.type === "code") { - block.code.rich_text.forEach(item => { - if (item.type === "text" && item.annotations) { - delete item.annotations; + block.code.rich_text.forEach((item: any) => { + if (item.type === "text" && item.annotations) { + delete item.annotations; + } } - } ); } }