mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
fix: TypeScript build errors in embeds.ts and totp-settings test
- embeds.ts: non-null assert on validated octets array access - embeds.ts: cast fetchOpts for Tauri-specific `danger` property - totp-settings.test.ts: cast closest() result to HTMLElement for style access
This commit is contained in:
@@ -94,7 +94,7 @@ function parseIPv4Literal(hostname: string): readonly [number, number, number, n
|
||||
return null;
|
||||
}
|
||||
|
||||
return [octets[0], octets[1], octets[2], octets[3]];
|
||||
return [octets[0]!, octets[1]!, octets[2]!, octets[3]!];
|
||||
}
|
||||
|
||||
function isPrivateHost(hostname: string): boolean {
|
||||
@@ -178,7 +178,7 @@ function fetchOgMeta(url: string): Promise<OgMeta> {
|
||||
headers: { "User-Agent": "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" },
|
||||
};
|
||||
if (isTrustedServerUrl(url)) {
|
||||
fetchOpts.danger = { acceptInvalidCerts: true, acceptInvalidHostnames: false };
|
||||
(fetchOpts as RequestInit & { danger?: { acceptInvalidCerts: boolean; acceptInvalidHostnames: boolean } }).danger = { acceptInvalidCerts: true, acceptInvalidHostnames: false };
|
||||
}
|
||||
const res = await tauriFetch(url, fetchOpts);
|
||||
clearTimeout(timer);
|
||||
|
||||
@@ -552,7 +552,7 @@ describe("TOTP Settings", () => {
|
||||
// Disable button should reappear
|
||||
expect(disableBtn.style.display).toBe("");
|
||||
// The confirm area (parent of password input) should be hidden
|
||||
expect(pwInput.closest("div[style*='display']")!.style.display).toBe("none");
|
||||
expect((pwInput.closest("div[style*='display']") as HTMLElement).style.display).toBe("none");
|
||||
|
||||
overlay.destroy?.();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user