Skip to content

Commit

Permalink
apply fix
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Oct 2, 2023
1 parent c4dbc34 commit 9d23ce1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 11 deletions.
15 changes: 15 additions & 0 deletions fetch.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type * as undici from "undici";

declare global {
// Re-export undici fetch function and various classes to global scope.
// These are classes and functions expected to be at global scope according to
// Node.js v18 API documentation.
// See: https://nodejs.org/dist/latest-v18.x/docs/api/globals.html
export const {
FormData,
Headers,
Request,
Response,
fetch,
}: typeof undici;
}
54 changes: 46 additions & 8 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
]
},
"devDependencies": {
"@types/node": "^20.8.0",
"@types/yargs": "^17.0.24",
"get-stream": "^8.0.1",
"mocha": "^10.2.0",
"np": "^8.0.1",
"prettier": "^3.0.0",
"standard": "^17.0.0",
"stream-match": "^1.2.1",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"undici": "^5.25.3"
},
"dependencies": {
"@influxdata/influxdb-client": "^1.33.2",
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"allowJs": true,
"checkJs": true,
"skipLibCheck": true,
"lib": ["es2021", "DOM"],
"lib": ["es2021"],
"target": "es2021",
"module": "Node16",
"moduleResolution": "node16",
Expand All @@ -24,7 +24,8 @@
"commands",
"lib",
"scripts",
"tests"
"tests",
"fetch.d.ts"
],
"exclude": [
"dist/**/*"
Expand Down

0 comments on commit 9d23ce1

Please sign in to comment.