Skip to content

Commit

Permalink
perf: add typed arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
iiio2 committed Aug 11, 2024
1 parent 9cf16e0 commit c36eb39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
} from "./types";

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
const retryStatusCodes = new Set([
const retryStatusCodes = new Set(new Int16Array([
408, // Request Timeout
409, // Conflict
425, // Too Early (Experimental)
Expand All @@ -25,10 +25,10 @@ const retryStatusCodes = new Set([
502, // Bad Gateway
503, // Service Unavailable
504, // Gateway Timeout
]);
]));

// https://developer.mozilla.org/en-US/docs/Web/API/Response/body
const nullBodyResponses = new Set([101, 204, 205, 304]);
const nullBodyResponses = new Set(new Int16Array([101, 204, 205, 304]));

export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch {
const {
Expand Down

0 comments on commit c36eb39

Please sign in to comment.