Prefer native node fetch over node-fetch (#1970)

This commit is contained in:
Michael Telatynski
2024-10-31 11:16:36 +00:00
committed by GitHub
parent e66db793bf
commit 098609607b
7 changed files with 8 additions and 8 deletions

View File

@@ -5,7 +5,6 @@ import { createWriteStream, promises as fs } from "node:fs";
import * as childProcess from "node:child_process";
import * as tar from "tar";
import * as asar from "@electron/asar";
import fetch from "node-fetch";
import { promises as stream } from "node:stream";
import riotDesktopPackageJson from "../package.json";
@@ -125,6 +124,8 @@ async function main(): Promise<number | undefined> {
});
fetch(PUB_KEY_URL)
.then((resp) => {
if (!resp.ok) throw new Error(`unexpected response ${resp.statusText}`);
if (!resp.body) throw new Error(`unexpected response has no body ${resp.statusText}`);
stream.pipeline(resp.body, gpgProc.stdin!).catch(reject);
})
.catch(reject);

View File

@@ -2,12 +2,13 @@
"compilerOptions": {
"resolveJsonModule": true,
"moduleResolution": "node16",
"skipLibCheck": true,
"esModuleInterop": true,
"target": "es2022",
"module": "node16",
"sourceMap": false,
"strict": true,
"lib": ["es2020", "dom"]
"lib": ["es2020"]
},
"include": ["../src/@types", "./**/*.ts"]
}