From 7192690c1cec4a87275d031df05c6861e43f84d9 Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Tue, 3 Dec 2024 02:19:30 +0530 Subject: [PATCH] clean up --- app/utils/constants.ts | 1 - app/utils/parseCookies.ts | 19 ------------------- 2 files changed, 20 deletions(-) delete mode 100644 app/utils/parseCookies.ts diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 81a64575..7109a935 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -1,5 +1,4 @@ import Cookies from 'js-cookie'; -import { parseCookies } from './parseCookies'; import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types'; import type { ProviderInfo } from '~/types/model'; diff --git a/app/utils/parseCookies.ts b/app/utils/parseCookies.ts deleted file mode 100644 index 235adc30..00000000 --- a/app/utils/parseCookies.ts +++ /dev/null @@ -1,19 +0,0 @@ -export function parseCookies(cookieHeader: string) { - const cookies: any = {}; - - // Split the cookie string by semicolons and spaces - const items = cookieHeader.split(';').map((cookie) => cookie.trim()); - - items.forEach((item) => { - const [name, ...rest] = item.split('='); - - if (name && rest) { - // Decode the name and value, and join value parts in case it contains '=' - const decodedName = decodeURIComponent(name.trim()); - const decodedValue = decodeURIComponent(rest.join('=').trim()); - cookies[decodedName] = decodedValue; - } - }); - - return cookies; -} \ No newline at end of file