From 3dae66170a890f30f7c6b6b0bdc9b6584fc444b4 Mon Sep 17 00:00:00 2001 From: Turgay Saba <22500853+sabaturgay@users.noreply.github.com> Date: Fri, 4 Apr 2025 20:16:36 +0200 Subject: [PATCH 1/4] Create helpers.ts --- src/utils/helpers.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils/helpers.ts diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts new file mode 100644 index 0000000..ceba9eb --- /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); + }); +}; From a532e36c8af78ce1cdab8e6337918a99b3af5807 Mon Sep 17 00:00:00 2001 From: Turgay Saba <22500853+sabaturgay@users.noreply.github.com> Date: Fri, 4 Apr 2025 20:16:53 +0200 Subject: [PATCH 2/4] Update Uploader.tsx --- src/utils/Uploader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/Uploader.tsx b/src/utils/Uploader.tsx index c60cfc5..7f3b7b7 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, From 86398e7cfc1219e5a6278ea8a6e23dae7df4421c Mon Sep 17 00:00:00 2001 From: Turgay Saba <22500853+sabaturgay@users.noreply.github.com> Date: Fri, 4 Apr 2025 20:17:22 +0200 Subject: [PATCH 3/4] Update Downloader.tsx --- src/utils/Downloader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/Downloader.tsx b/src/utils/Downloader.tsx index f80b0e7..e5384c1 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, From b54d963e30a74a30fa621efdea2bdc6f12ed0f48 Mon Sep 17 00:00:00 2001 From: Turgay Saba <22500853+sabaturgay@users.noreply.github.com> Date: Fri, 4 Apr 2025 20:17:45 +0200 Subject: [PATCH 4/4] Update index.tsx --- src/utils/index.tsx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/utils/index.tsx b/src/utils/index.tsx index 8814158..d7025ef 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';