@umituz/react-native-filesystem 2.1.21 → 2.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-filesystem",
3
- "version": "2.1.21",
3
+ "version": "2.1.22",
4
4
  "description": "File operations and import/export functionality for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -27,7 +27,7 @@ export async function downloadFile(url: string, dest?: string): Promise<FileOper
27
27
  const destination = dest ? new File(dest) : new File(Paths.document, FileUtils.generateUniqueFilename("download"));
28
28
  const res = await File.downloadFileAsync(url, destination, { idempotent: true });
29
29
  return { success: true, uri: res.uri };
30
- } catch (e: any) { return { success: false, error: e.message }; }
30
+ } catch (e: unknown) { return { success: false, error: e instanceof Error ? e.message : String(e) }; }
31
31
  }
32
32
 
33
33
  export async function downloadFileWithProgress(url: string, cacheDir: string, onProgress?: DownloadProgressCallback): Promise<DownloadWithProgressResult> {
@@ -62,7 +62,7 @@ export async function downloadFileWithProgress(url: string, cacheDir: string, on
62
62
  new File(destUri).write(all);
63
63
 
64
64
  return { success: true, uri: destUri, fromCache: false };
65
- } catch (e: any) { return { success: false, error: e.message }; }
65
+ } catch (e: unknown) { return { success: false, error: e instanceof Error ? e.message : String(e) }; }
66
66
  }
67
67
 
68
68
  export const isUrlCached = (url: string, dir: string) => new File(getCacheUri(url, dir)).exists;