Skip to content

Commit

Permalink
Fix the Node18 problem with path.format
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Feb 2, 2025
1 parent c535a3f commit d2f656b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/support/media-files/file-ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ export function addFileExtension<T extends TypeInfo>(

export function setExtension(fileName: string, ext: string): string {
const { name } = parsePath(fileName);
return formatPath({ name, ext });
return formatPath({ name, ext: ext ? `.${ext}` : '' }); // Add dot for Node18 compatibility
}

0 comments on commit d2f656b

Please sign in to comment.