Skip to content

Commit dc85791

Browse files
committed
feat(create): change interface types
1 parent 0aae951 commit dc85791

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

create.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright 2023-latest the httpland authors. All rights reserved. MIT license.
22
// This module is browser compatible.
33

4-
import { isResponse } from "./is.ts";
5-
64
/** Create a new `Response`.
75
*
86
* If you create a new `Response` from an existing `Response`, any options you set
@@ -21,17 +19,15 @@ import { isResponse } from "./is.ts";
2119
* ```
2220
*/
2321
export function createResponse(
24-
input: Response | Body,
22+
input: Response,
2523
init?: ResponseInit,
2624
): Response {
27-
init = isResponse(input)
28-
? {
29-
headers: input.headers,
30-
status: input.status,
31-
statusText: input.statusText,
32-
...init,
33-
}
34-
: init;
25+
init = {
26+
headers: input.headers,
27+
status: input.status,
28+
statusText: input.statusText,
29+
...init,
30+
};
3531

3632
return new Response(input.body, init);
3733
}

0 commit comments

Comments
 (0)