Skip to content

Commit

Permalink
chore: use that BodyInit can be null in typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Aug 30, 2024
1 parent ef4c684 commit 398862a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/Route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type RouteConfig = UserRouteConfig &
FetchImplementations &
InternalRouteConfig;
export type RouteResponseConfig = {
body?: BodyInit | object | null;
body?: BodyInit | object ;
status?: number;
headers?: {
[key: string]: string;
Expand Down Expand Up @@ -72,7 +72,7 @@ export type RouteResponse =
| RouteResponseFunction;
export type RouteName = string;

function isBodyInit(body: BodyInit | null | object): body is BodyInit {
function isBodyInit(body: BodyInit | object): body is BodyInit {
return (
body instanceof Blob ||
body instanceof ArrayBuffer ||
Expand Down Expand Up @@ -210,7 +210,7 @@ class Route {
constructResponseBody(
responseInput: RouteResponseConfig,
responseOptions: ResponseInitUsingHeaders,
): BodyInit | null {
): BodyInit {
let body = responseInput.body;
const bodyIsBodyInit = isBodyInit(body);

Expand Down

0 comments on commit 398862a

Please sign in to comment.