chore: replaced deprecated package build-url with query-string

This commit is contained in:
Settel 2024-02-02 21:49:03 +01:00
parent bad7e137ad
commit 8375a3b5bd
3 changed files with 32 additions and 14 deletions

View File

@ -23,9 +23,9 @@
"@vue/runtime-core": "^3.3.4", "@vue/runtime-core": "^3.3.4",
"@vue/runtime-dom": "^3.3.4", "@vue/runtime-dom": "^3.3.4",
"@vue/shared": "^3.3.4", "@vue/shared": "^3.3.4",
"build-url": "^6.0.1",
"nuxt-icons": "^3.2.1", "nuxt-icons": "^3.2.1",
"ofetch": "^1.3.3", "ofetch": "^1.3.3",
"query-string": "^8.1.0",
"typescript": "^5.1.3", "typescript": "^5.1.3",
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-contenteditable": "^4.1.0", "vue-contenteditable": "^4.1.0",

View File

@ -20,15 +20,15 @@ dependencies:
'@vue/shared': '@vue/shared':
specifier: ^3.3.4 specifier: ^3.3.4
version: 3.3.4 version: 3.3.4
build-url:
specifier: ^6.0.1
version: 6.0.1
nuxt-icons: nuxt-icons:
specifier: ^3.2.1 specifier: ^3.2.1
version: 3.2.1 version: 3.2.1
ofetch: ofetch:
specifier: ^1.3.3 specifier: ^1.3.3
version: 1.3.3 version: 1.3.3
query-string:
specifier: ^8.1.0
version: 8.1.0
typescript: typescript:
specifier: ^5.1.3 specifier: ^5.1.3
version: 5.1.3 version: 5.1.3
@ -1533,11 +1533,6 @@ packages:
ieee754: 1.2.1 ieee754: 1.2.1
dev: true dev: true
/build-url@6.0.1:
resolution: {integrity: sha512-FEmyP+3hCVoBBxGZEfC8WCTvqASZb+QOvTznddKCBgdxZFqTww1+7vtZP0TUIL0/8sup0m0QpKaOaj/V4Mol0w==}
deprecated: This package is no longer maintained
dev: false
/builtin-modules@3.3.0: /builtin-modules@3.3.0:
resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==}
engines: {node: '>=6'} engines: {node: '>=6'}
@ -1963,6 +1958,11 @@ packages:
dependencies: dependencies:
ms: 2.1.2 ms: 2.1.2
/decode-uri-component@0.4.1:
resolution: {integrity: sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==}
engines: {node: '>=14.16'}
dev: false
/deepmerge@4.3.1: /deepmerge@4.3.1:
resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -2322,6 +2322,11 @@ packages:
dependencies: dependencies:
to-regex-range: 5.0.1 to-regex-range: 5.0.1
/filter-obj@5.1.0:
resolution: {integrity: sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==}
engines: {node: '>=14.16'}
dev: false
/flat@5.0.2: /flat@5.0.2:
resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==}
hasBin: true hasBin: true
@ -3991,6 +3996,15 @@ packages:
engines: {node: '>=6'} engines: {node: '>=6'}
dev: true dev: true
/query-string@8.1.0:
resolution: {integrity: sha512-BFQeWxJOZxZGix7y+SByG3F36dA0AbTy9o6pSmKFcFz7DAj0re9Frkty3saBn3nHo3D0oZJ/+rx3r8H8r8Jbpw==}
engines: {node: '>=14.16'}
dependencies:
decode-uri-component: 0.4.1
filter-obj: 5.1.0
split-on-first: 3.0.0
dev: false
/queue-microtask@1.2.3: /queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
@ -4318,6 +4332,11 @@ packages:
engines: {node: '>= 8'} engines: {node: '>= 8'}
dev: true dev: true
/split-on-first@3.0.0:
resolution: {integrity: sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==}
engines: {node: '>=12'}
dev: false
/standard-as-callback@2.1.0: /standard-as-callback@2.1.0:
resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==}
dev: true dev: true

View File

@ -1,14 +1,13 @@
import buildUrl from 'build-url' import queryString from 'query-string'
export type QueryParams = { export type QueryParams = {
[name: string]: string [name: string]: string
} }
export async function callApi(path: string, queryParams?: QueryParams) { export async function callApi(path: string, queryParams?: QueryParams) {
const url = buildUrl('/', { const url = path + (
path, queryParams ? '?' + queryString.stringify(queryParams) : ''
queryParams, )
})
return await $fetch(url) return await $fetch(url)
} }