mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-15 12:50:42 -07:00
refactor: improve path resolution readability
This commit is contained in:
@@ -10,12 +10,12 @@ export const tauriFilesystem: PlatformFilesystem = {
|
||||
});
|
||||
|
||||
if (filePath) {
|
||||
const resolvedPath =
|
||||
typeof filePath === 'string'
|
||||
? filePath
|
||||
: filePath && typeof filePath === 'object' && 'path' in filePath
|
||||
? (filePath as { path: string }).path
|
||||
: '';
|
||||
let resolvedPath = '';
|
||||
if (typeof filePath === 'string') {
|
||||
resolvedPath = filePath;
|
||||
} else if (filePath && typeof filePath === 'object' && 'path' in filePath) {
|
||||
resolvedPath = (filePath as { path: string }).path;
|
||||
}
|
||||
|
||||
if (!resolvedPath) {
|
||||
throw new Error('Failed to resolve save path');
|
||||
|
||||
Reference in New Issue
Block a user