Applied automatic fixes

This commit is contained in:
codegen-sh[bot] authored and github-actions[bot] committed 2025-04-24 11:23:28 +00:00
1 parent 16e2817ac2
commit 8a804769ad
1 file changed
+18 -11
+18 -11
View File
@@ -118,13 +118,12 @@ export class NotionClient {
pages.push({
type: item.object === "page" ? PageType.Page : PageType.Database,
id: item.id,
name: this.parseTitle(
item,
{ maxLength: item.object === "database"
? CollectionValidation.maxNameLength
: DocumentValidation.maxTitleLength
}
),
name: this.parseTitle(item, {
maxLength:
item.object === "database"
? CollectionValidation.maxNameLength
: DocumentValidation.maxTitleLength,
}),
emoji: this.parseEmoji(item),
});
}
@@ -210,7 +209,9 @@ export class NotionClient {
return {
type: PageType.Page,
id: item.id,
name: this.parseTitle(item, { maxLength: DocumentValidation.maxTitleLength }),
name: this.parseTitle(item, {
maxLength: DocumentValidation.maxTitleLength,
}),
emoji: this.parseEmoji(item),
};
})
@@ -234,7 +235,9 @@ export class NotionClient {
const author = await this.fetchUsername(page.created_by.id);
return {
title: this.parseTitle(page, { maxLength: DocumentValidation.maxTitleLength }),
title: this.parseTitle(page, {
maxLength: DocumentValidation.maxTitleLength,
}),
emoji: this.parseEmoji(page),
author: author ?? undefined,
createdAt: !page.created_time ? undefined : new Date(page.created_time),
@@ -253,7 +256,9 @@ export class NotionClient {
const author = await this.fetchUsername(database.created_by.id);
return {
title: this.parseTitle(database, { maxLength: CollectionValidation.maxNameLength }),
title: this.parseTitle(database, {
maxLength: CollectionValidation.maxNameLength,
}),
emoji: this.parseEmoji(database),
author: author ?? undefined,
createdAt: !database.created_time
@@ -292,7 +297,9 @@ export class NotionClient {
private parseTitle(
item: PageObjectResponse | DatabaseObjectResponse,
{ maxLength = DocumentValidation.maxTitleLength }: { maxLength?: number } = {}
{
maxLength = DocumentValidation.maxTitleLength,
}: { maxLength?: number } = {}
) {
let richTexts: RichTextItemResponse[];