Skip to content

Commit

Permalink
refactor: node-fetch to undici
Browse files Browse the repository at this point in the history
Follow up to sapphiredev#143
  • Loading branch information
KhafraDev committed Sep 29, 2021
1 parent 5ee876b commit 4dbd099
Show file tree
Hide file tree
Showing 6 changed files with 344 additions and 47 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@sapphire/utilities": "^2.0.1",
"@types/jest": "^27.0.2",
"@types/node": "^16.10.1",
"@types/node-fetch": "^2.5.12",
"@types/ws": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@
"prepublishOnly": "yarn build"
},
"dependencies": {
"@types/node-fetch": "^2.5.12",
"@types/psl": "^1.1.0",
"@types/ws": "8.2.0",
"node-fetch": "^2.6.5",
"psl": "^1.8.0",
"tslib": "^2.3.1"
"tslib": "^2.3.1",
"undici": "^4.7.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/lib/structures/http/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Routes,
RouteBases
} from 'discord-api-types/v9';
import fetch from 'node-fetch';
import { fetch } from 'undici';

export class Auth {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routes/oauth/callback.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { PieceContext } from '@sapphire/pieces';
import { OAuth2Routes, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2AccessTokenURLEncodedData } from 'discord-api-types/v9';
import fetch from 'node-fetch';
import { fetch } from 'undici';
import { stringify } from 'querystring';
import type { ApiRequest } from '../../lib/structures/api/ApiRequest';
import type { ApiResponse } from '../../lib/structures/api/ApiResponse';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routes/oauth/logout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { PieceContext } from '@sapphire/pieces';
import { OAuth2Routes } from 'discord-api-types/v9';
import fetch from 'node-fetch';
import { fetch } from 'undici';
import { stringify } from 'querystring';
import { promisify } from 'util';
import type { ApiRequest } from '../../lib/structures/api/ApiRequest';
Expand Down
Loading

0 comments on commit 4dbd099

Please sign in to comment.