[TS] Various cleanups
This commit is contained in:
parent
13cf5e6872
commit
4d10691ac1
2 changed files with 10 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue