diff --git a/src/utils/Downloader.tsx b/src/utils/Downloader.tsx index f80b0e73..e5384c12 100644 --- a/src/utils/Downloader.tsx +++ b/src/utils/Downloader.tsx @@ -2,7 +2,7 @@ import { NativeEventEmitter, Platform } from 'react-native'; import type { NativeEventSubscription } from 'react-native'; import { Compressor } from '../Main'; const CompressEventEmitter = new NativeEventEmitter(Compressor); -import { uuidv4 } from './index'; +import { uuidv4 } from './helpers'; export const download = async ( fileUrl: string, downloadProgress?: (progress: number) => void, diff --git a/src/utils/Uploader.tsx b/src/utils/Uploader.tsx index c60cfc5d..7f3b7b73 100644 --- a/src/utils/Uploader.tsx +++ b/src/utils/Uploader.tsx @@ -2,7 +2,7 @@ import { NativeEventEmitter, Platform } from 'react-native'; import type { NativeEventSubscription } from 'react-native'; import { Compressor } from '../Main'; const CompressEventEmitter = new NativeEventEmitter(Compressor); -import { uuidv4 } from './index'; +import { uuidv4 } from './helpers'; export enum UploadType { BINARY_CONTENT = 0, MULTIPART = 1, diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts new file mode 100644 index 00000000..ceba9ebd --- /dev/null +++ b/src/utils/helpers.ts @@ -0,0 +1,15 @@ +export const uuidv4 = () => { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + const r = + (parseFloat( + '0.' + + Math.random().toString().replace('0.', '') + + new Date().getTime() + ) * + 16) | + 0, + // eslint-disable-next-line eqeqeq + v = c == 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); +}; diff --git a/src/utils/index.tsx b/src/utils/index.tsx index 8814158d..d7025ef7 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -194,20 +194,6 @@ export const getFileSize = async (filePath: string): Promise => { return Compressor.getFileSize(filePath); }; -export const uuidv4 = () => { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - const r = - (parseFloat( - '0.' + - Math.random().toString().replace('0.', '') + - new Date().getTime() - ) * - 16) | - 0, - // eslint-disable-next-line eqeqeq - v = c == 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -}; export * from './Downloader'; export * from './Uploader'; +export * from './helpers';