fix optional parameter type

This commit is contained in:
Ron Rennick 2023-11-30 19:19:36 -04:00
parent b01a80f06c
commit 10fdd4b993
1 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ import yaml from 'js-yaml';
*/ */
export const generatePostFrontMatter = ( export const generatePostFrontMatter = (
fileContents: string, fileContents: string,
includeContent: false includeContent?: boolean
): { ): {
[ key: string ]: unknown; [ key: string ]: unknown;
} => { } => {
@ -40,7 +40,7 @@ export const generatePostFrontMatter = (
const title = headings[ 0 ]?.substring( 2 ).trim(); const title = headings[ 0 ]?.substring( 2 ).trim();
frontMatter.data.post_title = frontMatter.data.post_title ?? title; frontMatter.data.post_title = frontMatter.data.post_title ?? title;
if ( includeContent ) { if ( includeContent ?? false ) {
frontMatter.data.content = frontMatter.content; frontMatter.data.content = frontMatter.content;
} }
return Object.keys( frontMatter.data ) return Object.keys( frontMatter.data )