Enable noImplicitAny and kill off request (#457)

* Enable noImplicitAny

* Switch from request to node-fetch

* Fix node-fetch via patch-package

* Add edge to handler

* Pin node-fetch to v2
This commit is contained in:
Michael Telatynski
2022-11-30 13:51:54 +00:00
committed by GitHub
parent c74fdb632b
commit 031ee44571
13 changed files with 232 additions and 86 deletions
+3 -3
View File
@@ -52,7 +52,7 @@ function processUrl(url: string): void {
global.mainWindow.loadURL(urlToLoad.href);
}
function readStore(): object {
function readStore(): Record<string, string> {
try {
const s = fs.readFileSync(storePath, { encoding: "utf8" });
const o = JSON.parse(s);
@@ -62,7 +62,7 @@ function readStore(): object {
}
}
function writeStore(data: object): void {
function writeStore(data: Record<string, string>): void {
fs.writeFileSync(storePath, JSON.stringify(data));
}
@@ -83,7 +83,7 @@ export function recordSSOSession(sessionID: string): void {
export function getProfileFromDeeplink(args: string[]): string | undefined {
// check if we are passed a profile in the SSO callback url
const deeplinkUrl = args.find(arg => arg.startsWith(PROTOCOL + '//'));
if (deeplinkUrl && deeplinkUrl.includes(SEARCH_PARAM)) {
if (deeplinkUrl?.includes(SEARCH_PARAM)) {
const parsedUrl = new URL(deeplinkUrl);
if (parsedUrl.protocol === PROTOCOL) {
const ssoID = parsedUrl.searchParams.get(SEARCH_PARAM)!;