Skip to content

Commit a58b81d

Browse files
fix linter errors, check undici
1 parent 52c32a8 commit a58b81d

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

src/orkes/helpers/resolveFetchFn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export const resolveFetchFn = async (
2222
return ((input: UndiciRequestInfo, init?: UndiciRequestInit) =>
2323
undiciFetch(input, { ...init, dispatcher: undiciAgent })) as FetchFn;
2424
} catch {
25-
return fetch;
25+
throw new Error("Undici is not supported");
2626
}
2727
};

src/orkes/request/request.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,7 @@ const isStringWithValue = (value: unknown): value is string => {
2424
};
2525

2626
const isBlob = (value: unknown): value is Blob => {
27-
return (
28-
typeof value === "object" && value !== null &&
29-
typeof (value as Blob).type === "string" &&
30-
typeof (value as Blob).stream === "function" &&
31-
typeof (value as Blob).arrayBuffer === "function" &&
32-
typeof value.constructor === "function" &&
33-
typeof value.constructor.name === "string" &&
34-
/^(Blob|File)$/.test(value.constructor.name) &&
35-
/^(Blob|File)$/.test((value as { [Symbol.toStringTag]: string })[Symbol.toStringTag])
36-
);
27+
return typeof Blob !== "undefined" && value instanceof Blob;
3728
};
3829

3930
const isFormData = (value: unknown): value is FormData => {

0 commit comments

Comments
 (0)