@worker-tools/response-creators
Advanced tools
Comparing version 1.2.0-pre.4 to 1.2.0-pre.5
@@ -6,3 +6,3 @@ { | ||
"name": "@worker-tools/response-creators", | ||
"version": "1.2.0-pre.4", | ||
"version": "1.2.0-pre.5", | ||
"description": "A collection of factory functions for Fetch API Response types with pre-filled status and status-text headers for well-known HTTP status codes.", | ||
@@ -21,3 +21,3 @@ "license": "MIT", | ||
}, | ||
"homepage": "https://workers.tools/#response-creators", | ||
"homepage": "https://workers.tools/response-creators", | ||
"keywords": [ | ||
@@ -24,0 +24,0 @@ "cloudflare-workers", |
export type RequestInitExStatus = Omit<RequestInit, 'status' | 'statusText'>; | ||
const mkResponse = (status: number, statusText: string) => (body: BodyInit | null = null, init: RequestInitExStatus = {}) => new Response(body, { | ||
const mkResponse = (status: number, statusText: string) => (body: BodyInit | null = null, init: RequestInitExStatus = {}): Response => new Response(body, { | ||
...init, | ||
@@ -9,3 +9,3 @@ status, | ||
const mkRedirect = (status: number, statusText: string) => (location: string | URL, init: RequestInitExStatus = {}) => new Response(null, { | ||
const mkRedirect = (status: number, statusText: string) => (location: string | URL, init: RequestInitExStatus = {}): Response => new Response(null, { | ||
...init, | ||
@@ -20,3 +20,3 @@ status, | ||
const mkUnauthorized = (status: number, statusText: string) => (realm = '', init: RequestInitExStatus = {}) => new Response(null, { | ||
const mkUnauthorized = (status: number, statusText: string) => (realm = '', init: RequestInitExStatus = {}): Response => new Response(null, { | ||
...init, | ||
@@ -31,3 +31,3 @@ status, | ||
const mkNotModified = (status: number, statusText: string) => (ifNoneMatch: string, ifModifiedSince: Date, init: RequestInitExStatus = {}) => new Response(null, { | ||
const mkNotModified = (status: number, statusText: string) => (ifNoneMatch: string, ifModifiedSince: Date, init: RequestInitExStatus = {}): Response => new Response(null, { | ||
...init, | ||
@@ -34,0 +34,0 @@ status, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36849