refactor: improve path resolution readability

This commit is contained in:
Reese Wright
2026-02-02 14:54:05 +00:00
parent 99fbcca7f4
commit d40f7d2676
+6 -6
View File
@@ -10,12 +10,12 @@ export const tauriFilesystem: PlatformFilesystem = {
}); });
if (filePath) { if (filePath) {
const resolvedPath = let resolvedPath = '';
typeof filePath === 'string' if (typeof filePath === 'string') {
? filePath resolvedPath = filePath;
: filePath && typeof filePath === 'object' && 'path' in filePath } else if (filePath && typeof filePath === 'object' && 'path' in filePath) {
? (filePath as { path: string }).path resolvedPath = (filePath as { path: string }).path;
: ''; }
if (!resolvedPath) { if (!resolvedPath) {
throw new Error('Failed to resolve save path'); throw new Error('Failed to resolve save path');