From 9e972c5c22ecaaece8d68f7f0dfa6e62b29b4145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 27 Sep 2024 23:15:01 +0200 Subject: [PATCH] pl-fe: remove unusued dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/package.json | 2 -- packages/pl-fe/src/api/__mocks__/index.ts | 16 +--------------- packages/pl-fe/yarn.lock | 12 ------------ 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/packages/pl-fe/package.json b/packages/pl-fe/package.json index fd40b63d9..1cbef8de4 100644 --- a/packages/pl-fe/package.json +++ b/packages/pl-fe/package.json @@ -91,7 +91,6 @@ "fuzzysort": "^3.0.0", "graphemesplit": "^2.4.4", "html-react-parser": "^5.0.0", - "http-link-header": "^1.0.2", "immer": "^10.1.1", "immutable": "^4.3.7", "intersection-observer": "^0.12.2", @@ -165,7 +164,6 @@ "@testing-library/react-hooks": "^8.0.1", "@testing-library/user-event": "^14.5.1", "@types/escape-html": "^1.0.1", - "@types/http-link-header": "^1.0.3", "@types/leaflet": "^1.8.0", "@types/lodash": "^4.17.9", "@types/object-assign": "^4.0.30", diff --git a/packages/pl-fe/src/api/__mocks__/index.ts b/packages/pl-fe/src/api/__mocks__/index.ts index b28d2e252..3945260f6 100644 --- a/packages/pl-fe/src/api/__mocks__/index.ts +++ b/packages/pl-fe/src/api/__mocks__/index.ts @@ -1,5 +1,4 @@ // import MockAdapter from 'axios-mock-adapter'; -import LinkHeader from 'http-link-header'; import { vi } from 'vitest'; const api = await vi.importActual('../index') as Record; @@ -15,19 +14,6 @@ const __clear = (): Function[] => mocks = []; const staticClient = api.staticClient; -const getLinks = (response: Response): LinkHeader => - new LinkHeader(response.headers?.get('link') || undefined); - -const getNextLink = (response: Response) => { - const nextLink = new LinkHeader(response.headers?.get('link') || undefined); - return nextLink.refs.find(link => link.rel === 'next')?.uri; -}; - -const getPrevLink = (response: Response) => { - const prevLink = new LinkHeader(response.headers?.get('link') || undefined); - return prevLink.refs.find(link => link.rel === 'prev')?.uri; -}; - const baseClient = (...params: any[]) => { const axios = api.baseClient(...params); // setupMock(axios); @@ -40,4 +26,4 @@ export default (...params: any[]) => { return axios; }; -export { __stub, __clear, staticClient, getLinks, getNextLink, getPrevLink, baseClient }; +export { __stub, __clear, staticClient, baseClient }; diff --git a/packages/pl-fe/yarn.lock b/packages/pl-fe/yarn.lock index 5c8af8c83..d732c5307 100644 --- a/packages/pl-fe/yarn.lock +++ b/packages/pl-fe/yarn.lock @@ -2808,13 +2808,6 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== -"@types/http-link-header@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@types/http-link-header/-/http-link-header-1.0.3.tgz#899adf1d8d2036074514f3dbd148fb901ceff920" - integrity sha512-y8HkoD/vyid+5MrJ3aas0FvU3/BVBGcyG9kgxL0Zn4JwstA8CglFPnrR0RuzOjRCXwqzL5uxWC2IO7Ub0rMU2A== - dependencies: - "@types/node" "*" - "@types/json-schema@*", "@types/json-schema@^7.0.12", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.13" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85" @@ -7012,11 +7005,6 @@ http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" -http-link-header@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/http-link-header/-/http-link-header-1.0.3.tgz#abbc2cdc5e06dd7e196a4983adac08a2d085ec90" - integrity sha512-nARK1wSKoBBrtcoESlHBx36c1Ln/gnbNQi1eB6MeTUefJIT3NvUOsV15bClga0k38f0q/kN5xxrGSDS3EFnm9w== - http-link-header@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/http-link-header/-/http-link-header-1.1.3.tgz#b367b7a0ad1cf14027953f31aa1df40bb433da2a"