mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 01:13:55 +00:00
fix: filename may not exist
This commit is contained in:
committed by
Carlos Valente
parent
af5d6e1aee
commit
13aeeb278d
@@ -19,7 +19,8 @@ export function ensureDirectory(directory: string): void {
|
||||
/**
|
||||
* Ensures that a filename ends with .json extension
|
||||
*/
|
||||
export function ensureJsonExtension(filename: string): string {
|
||||
export function ensureJsonExtension(filename: string | undefined): string | undefined {
|
||||
if (!filename) return filename;
|
||||
return filename.endsWith('.json') ? filename : `${filename}.json`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user