[TS] Various cleanups

This commit is contained in:
Beef 2023-03-20 21:30:13 +00:00
parent 13cf5e6872
commit 4d10691ac1
2 changed files with 10 additions and 6 deletions

View file

@ -1,6 +1,6 @@
// A really basic fetch wrapper which throws on non-ok response codes
export default async function safeFetch(input: RequestInfo, options?: RequestInit) {
export default async function safeFetch(input: RequestInfo | URL, options?: RequestInit) {
const req = await fetch(input, options);
if (!req.ok) throw new Error("Request returned non-ok");
return req;