fix optional parameter type
This commit is contained in:
parent
b01a80f06c
commit
10fdd4b993
|
@ -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 )
|
||||||
|
|
Loading…
Reference in New Issue