Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fetch return type
Browse files Browse the repository at this point in the history
theothirteen committed Jan 1, 2024
1 parent f431250 commit 1d37b70
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
@@ -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": "*",
@@ -72,8 +73,7 @@
"madge": "^6.0.0",
"prettier": "^2.8.8",
"tsd": "^0.28.1",
"typescript": "^5.0.4",
"@types/node-fetch":"^2.6.3"
"typescript": "^5.0.4"
},
"publishConfig": {
"registry": "https://wombat-dressing-room.appspot.com"
4 changes: 2 additions & 2 deletions src/goods.ts
Original file line number Diff line number Diff line change
@@ -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 {
@@ -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

0 comments on commit 1d37b70

Please sign in to comment.