diff --git a/src/components/utils/csv-loader.ts b/src/components/utils/csv-loader.ts index 3c3fc5b..c71c1d3 100644 --- a/src/components/utils/csv-loader.ts +++ b/src/components/utils/csv-loader.ts @@ -68,7 +68,7 @@ export async function loadCSV>(path: string): Promise if (frontmatter) { csvResult.frontmatter = frontmatter; for(const each of result){ - Object.setPrototypeOf(each, frontmatter); + Object.assign(each, frontmatter); } } @@ -97,5 +97,5 @@ export function processVariables (body: string, currentRow return `{{${key}}}`; } - return body.replace(/\{\{(\w+)\}\}/g, (_, key) => `${replaceProp(key)}`); + return body?.replace(/\{\{(\w+)\}\}/g, (_, key) => `${replaceProp(key)}`) || ''; } \ No newline at end of file