diff --git a/core/util/index.ts b/core/util/index.ts index 1a7312e3f..65f602d8e 100644 --- a/core/util/index.ts +++ b/core/util/index.ts @@ -187,5 +187,6 @@ export function getMarkdownLanguageTagForFile(filepath: string): string { } export function copyOf(obj: any): any { + if (obj === null || obj === undefined) return obj; return JSON.parse(JSON.stringify(obj)); }