File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { dump } from 'js-yaml';
1717import got from 'got' ;
1818
1919import { markdown } from '#markdown' ;
20+ import { getPropertyContent } from '#property' ;
2021
2122import type { Got , OptionsOfJSONResponseBody , Response } from 'got' ;
2223import type {
@@ -28,7 +29,6 @@ import type {
2829 FullPage ,
2930 List ,
3031 Page ,
31- TitleValue ,
3232} from './types' ;
3333
3434interface Pagination extends Record < string , number | string | undefined > {
@@ -178,11 +178,10 @@ export class Notion {
178178 private async normalisePage ( page : Page ) : Promise < FullPage > {
179179 const blocks = await this . getBlocks ( page . id ) ;
180180 // Name for a page in a database, title for an ordinary page
181- /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */
182- const titleBlock = ( page . properties . Name ??
183- page . properties . title ) as TitleValue ;
184-
185- const title = titleBlock . title . map ( ( text ) => text . plain_text ) . join ( '' ) ;
181+ const title = getPropertyContent (
182+ /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */
183+ page . properties . Name ?? page . properties . title ,
184+ ) as string ;
186185 const frontmatter = [
187186 '---' ,
188187 dump (
You can’t perform that action at this time.
0 commit comments