Skip to content

Commit

Permalink
Added fetch return type
Browse files Browse the repository at this point in the history
  • Loading branch information
theothirteen committed Oct 2, 2023
1 parent 33fdb48 commit 963a5bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
24 changes: 5 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@types/node": "^18.16.3",
"@types/ps-tree": "^1.1.2",
"@types/which": "^3.0.0",
"@types/node-fetch": "^2.6.3",
"chalk": "^5.2.0",
"fs-extra": "^11.1.1",
"fx": "*",
Expand All @@ -73,8 +74,7 @@
"prettier": "^2.8.8",
"tsd": "^0.28.1",
"typescript": "^5.0.4",
"uvu": "^0.5.6",
"@types/node-fetch": "^2.6.3"
"uvu": "^0.5.6"
},
"publishConfig": {
"registry": "https://wombat-dressing-room.appspot.com"
Expand Down
4 changes: 2 additions & 2 deletions src/goods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import assert from 'node:assert'
import * as globbyModule from 'globby'
import minimist from 'minimist'
import { RequestInfo, RequestInit } from 'node-fetch'
import { RequestInfo, RequestInit, Response } from 'node-fetch'
import { createInterface } from 'node:readline'
import { $, within, ProcessOutput } from './core.js'
import {
Expand Down Expand Up @@ -59,7 +59,7 @@ export function sleep(duration: Duration) {
export async function globalFetch(url: RequestInfo, init?: RequestInit) {
if (isNativeFetchExists) {
$.log({ kind: 'fetch', url, init })
return (globalThis as any).fetch(url, init)
return (globalThis as any).fetch(url, init) as Promise<Response>
}
console.error('Fetch is not supported')
return
Expand Down

0 comments on commit 963a5bc

Please sign in to comment.