Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
$fetch
any
1 parent aef6933 commit 1f4754eCopy full SHA for 1f4754e
1 file changed
‎src/e2e/server.ts‎
@@ -1,6 +1,6 @@
1
import { x } from 'tinyexec'
2
import { getRandomPort, waitForPort } from 'get-port-please'
3
-import type { FetchOptions } from 'ofetch'
+import type { $Fetch, FetchOptions } from 'ofetch'
4
import { fetch as _fetch, createFetch } from 'ofetch'
5
import { resolve } from 'pathe'
6
import { joinURL } from 'ufo'
@@ -93,7 +93,7 @@ const _$fetch = createFetch({ fetch: globalFetch })
93
94
export const $fetch = function $fetch(path: string, options?: FetchOptions) {
95
return _$fetch(url(path), options)
96
-} as (typeof globalThis)['$fetch']
+} as '$fetch' extends keyof typeof globalThis ? typeof globalThis.$fetch : $Fetch
97
98
export function url(path: string) {
99
const ctx = useTestContext()
0 commit comments