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 Jan 1, 2024
1 parent f431250 commit 7bf67b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 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.

1 change: 1 addition & 0 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 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 7bf67b1

Please sign in to comment.