diff --git a/apps/web/package.json b/apps/web/package.json index 9d18dab..aa6e595 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -40,7 +40,6 @@ "dayjs": "1.11.11", "framer-motion": "11.2.10", "next": "14.2.15", - "qs": "6.12.1", "react": "18.3.1", "react-countup": "6.5.3", "react-dom": "18.3.1", @@ -74,7 +73,6 @@ "@types/jest-plugin-context": "2.9.7", "@types/node": "20", "@types/prop-types": "^15", - "@types/qs": "^6", "@types/react": "18.3.2", "@types/react-dom": "18.3.0", "@types/react-responsive-masonry": "^2", diff --git a/apps/web/src/components/molecules/Tags/index.tsx b/apps/web/src/components/molecules/Tags/index.tsx index 8b57e0f..742b518 100644 --- a/apps/web/src/components/molecules/Tags/index.tsx +++ b/apps/web/src/components/molecules/Tags/index.tsx @@ -5,10 +5,11 @@ import { useCallback, useMemo } from 'react'; import { Route } from 'next'; import { useRouter, useSearchParams } from 'next/navigation'; +import { paramsSerializer } from '@dnd-academy/core'; import clsx from 'clsx'; import Tag from '@/components/atoms/Tag'; -import { paramsSerializer, sortFlagsDescending } from '@/utils'; +import { sortFlagsDescending } from '@/utils'; import styles from './index.module.scss'; diff --git a/apps/web/src/utils/index.test.ts b/apps/web/src/utils/index.test.ts index c3f0dd7..6ed004d 100644 --- a/apps/web/src/utils/index.test.ts +++ b/apps/web/src/utils/index.test.ts @@ -1,27 +1,4 @@ -import qs from 'qs'; - -import { checkNumber, paramsSerializer } from '.'; - -describe('paramsSerializer', () => { - it('"qs.stringify"를 호출해야만 한다', () => { - const qsSpyOn = jest.spyOn(qs, 'stringify'); - const params = { - param1: 'apple', - param2: 'banana', - param3: 'orange', - }; - - const result = paramsSerializer(params); - - expect(result).toBe('param1=apple¶m2=banana¶m3=orange'); - expect(qsSpyOn).toHaveBeenCalledWith(params, { - indices: false, - arrayFormat: 'comma', - }); - - qsSpyOn.mockRestore(); - }); -}); +import { checkNumber } from '.'; describe('checkNumber', () => { describe('value가 null인 경우', () => { diff --git a/apps/web/src/utils/index.ts b/apps/web/src/utils/index.ts index 4953e8f..d2c0de1 100644 --- a/apps/web/src/utils/index.ts +++ b/apps/web/src/utils/index.ts @@ -1,26 +1,4 @@ import type { Entries, RequiredNonNullableObject } from '@dnd-academy/core'; -import dayjs from 'dayjs'; -import qs from 'qs'; - -const CACHE_MINUTE = 5; - -export const paramsSerializer = (params: T): string => qs.stringify(params, { - arrayFormat: 'comma', - indices: false, -}); - -export const isSSR = typeof window === 'undefined'; - -export const getCacheDate = (cacheTime = CACHE_MINUTE) => { - const date = dayjs().format('YYYY-MM-DD-HH'); - const currentMin = dayjs().get('minute'); - const modMin = dayjs().get('minute') % cacheTime; - const minute = modMin === 0 ? currentMin : currentMin - modMin; - - return { - date: `${date}-${minute}`, - }; -}; export const getEntries = (obj: T) => { const entries = Object.entries(obj) as Entries; diff --git a/yarn.lock b/yarn.lock index 8d22fc3..1a4bdde 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18939,7 +18939,6 @@ __metadata: "@types/jest-plugin-context": "npm:2.9.7" "@types/node": "npm:20" "@types/prop-types": "npm:^15" - "@types/qs": "npm:^6" "@types/react": "npm:18.3.2" "@types/react-dom": "npm:18.3.0" "@types/react-responsive-masonry": "npm:^2" @@ -18971,7 +18970,6 @@ __metadata: jest-plugin-context: "npm:2.9.0" next: "npm:14.2.15" prop-types: "npm:15.8.1" - qs: "npm:6.12.1" react: "npm:18.3.1" react-countup: "npm:6.5.3" react-dom: "npm:18.3.1"