From bdb8f42472dfc0d352159a0c0bb19537d40fda91 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Sat, 11 Jan 2025 09:40:51 -0800 Subject: [PATCH] Format --- .../src/document_loaders/web/notionapi.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/libs/langchain-community/src/document_loaders/web/notionapi.ts b/libs/langchain-community/src/document_loaders/web/notionapi.ts index b434acfd425f..a3529eef1b49 100644 --- a/libs/langchain-community/src/document_loaders/web/notionapi.ts +++ b/libs/langchain-community/src/document_loaders/web/notionapi.ts @@ -91,7 +91,7 @@ export type NotionAPILoaderOptions = { * }); * const pageDocs = await pageLoader.load(); * const splitDocs = await splitter.splitDocuments(pageDocs); - * + * * const dbLoader = new NotionAPILoader({ * clientOptions: { auth: "" }, * id: "", @@ -132,7 +132,7 @@ export class NotionAPILoader extends BaseDocumentLoader { ...options.callerOptions, }); this.notionClient = new Client({ - logger: () => { }, // Suppress Notion SDK logger + logger: () => {}, // Suppress Notion SDK logger ...options.clientOptions, }); this.n2mClient = new NotionToMarkdown({ @@ -145,7 +145,7 @@ export class NotionAPILoader extends BaseDocumentLoader { this.pageQueueTotal = 0; this.documents = []; this.rootTitle = ""; - this.onDocumentLoaded = options.onDocumentLoaded ?? ((_ti, _cu) => { }); + this.onDocumentLoaded = options.onDocumentLoaded ?? ((_ti, _cu) => {}); this.propertiesAsHeader = options.propertiesAsHeader || false; } @@ -202,8 +202,9 @@ export class NotionAPILoader extends BaseDocumentLoader { case "status": return prop[prop.type]?.name ?? ""; case "date": - return `${prop[prop.type]?.start ?? ""}${prop[prop.type]?.end ? ` - ${prop[prop.type]?.end}` : "" - }`; + return `${prop[prop.type]?.start ?? ""}${ + prop[prop.type]?.end ? ` - ${prop[prop.type]?.end}` : "" + }`; case "email": return prop[prop.type] || ""; case "phone_number": @@ -291,7 +292,7 @@ export class NotionAPILoader extends BaseDocumentLoader { if (block.has_children) { const block_id = block.type === "synced_block" && - block.synced_block?.synced_from?.block_id + block.synced_block?.synced_from?.block_id ? block.synced_block.synced_from.block_id : block.id; @@ -350,11 +351,11 @@ export class NotionAPILoader extends BaseDocumentLoader { const [pageData, pageId] = typeof page === "string" ? [ - this.caller.call(() => - this.notionClient.pages.retrieve({ page_id: page }) - ), - page, - ] + this.caller.call(() => + this.notionClient.pages.retrieve({ page_id: page }) + ), + page, + ] : [page, page.id]; const [pageDetails, pageBlocks] = await Promise.all([