From e33de09b6a18597bd9894d0ad7a0fd4534b7f173 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Tue, 19 Jul 2022 00:22:45 +0200 Subject: update node types to v18, ditch node-fetch --- util/src/fetch.js | 1 + util/src/index.ts | 1 + util/src/util/AutoUpdate.ts | 2 +- util/src/util/cdn.ts | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 util/src/fetch.js (limited to 'util/src') diff --git a/util/src/fetch.js b/util/src/fetch.js new file mode 100644 index 00000000..709bc440 --- /dev/null +++ b/util/src/fetch.js @@ -0,0 +1 @@ +export default fetch; diff --git a/util/src/index.ts b/util/src/index.ts index ae0f7e54..0de1e19a 100644 --- a/util/src/index.ts +++ b/util/src/index.ts @@ -4,3 +4,4 @@ export * from "./util/index"; export * from "./interfaces/index"; export * from "./entities/index"; export * from "./dtos/index"; +export * from "./fetch.js"; diff --git a/util/src/util/AutoUpdate.ts b/util/src/util/AutoUpdate.ts index 62ce8d79..7a4af4ff 100644 --- a/util/src/util/AutoUpdate.ts +++ b/util/src/util/AutoUpdate.ts @@ -1,5 +1,5 @@ import "missing-native-js-functions"; -import fetch from "node-fetch"; +import fetch from "../fetch"; import ProxyAgent from 'proxy-agent'; import readline from "readline"; import fs from "fs/promises"; diff --git a/util/src/util/cdn.ts b/util/src/util/cdn.ts index ea950cd1..ef4ac47d 100644 --- a/util/src/util/cdn.ts +++ b/util/src/util/cdn.ts @@ -1,8 +1,9 @@ import FormData from "form-data"; import { HTTPError } from "lambert-server"; -import fetch from "node-fetch"; import { Config } from "./Config"; import multer from "multer"; +import fetch from "../fetch" +import { nodeModuleNameResolver } from "typescript"; export async function uploadFile(path: string, file?: Express.Multer.File) { if (!file?.buffer) throw new HTTPError("Missing file in body"); -- cgit 1.5.1