Update some patches, switch to node-fetch-commonjs, more updates
This commit is contained in:
committed by
Rory&
parent
a2ffc536aa
commit
168758924c
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
import "missing-native-js-functions";
|
||||
import fetch from "node-fetch";
|
||||
import fetch from "node-fetch-commonjs";
|
||||
import { ProxyAgent } from "proxy-agent";
|
||||
import readline from "readline";
|
||||
import fs from "fs/promises";
|
||||
@@ -100,7 +100,7 @@ async function getLatestVersion(url: string) {
|
||||
try {
|
||||
const agent = new ProxyAgent();
|
||||
const response = await fetch(url, { agent });
|
||||
const content = await response.json();
|
||||
const content = (await response.json()) as { version: string };
|
||||
return content.version;
|
||||
} catch (error) {
|
||||
throw new Error("[Auto update] check failed for " + url);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
import FormData from "form-data";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import fetch from "node-fetch";
|
||||
import fetch from "node-fetch-commonjs";
|
||||
import { Attachment } from "../entities";
|
||||
import { Config } from "./Config";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user