@hono/node-server
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -48,3 +48,2 @@ "use strict"; | ||
var responseCache = Symbol("responseCache"); | ||
var newGlobalResponseKey = Symbol("newGlobalResponse"); | ||
var cacheKey = Symbol("cache"); | ||
@@ -55,16 +54,20 @@ var GlobalResponse = global.Response; | ||
#init; | ||
[newGlobalResponseKey]() { | ||
return new GlobalResponse( | ||
this.#body, | ||
this.#init instanceof _Response ? this.#init[newGlobalResponseKey]() : this.#init | ||
); | ||
} | ||
// @ts-ignore | ||
get cache() { | ||
delete this[cacheKey]; | ||
return this[responseCache] ||= this[newGlobalResponseKey](); | ||
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); | ||
} | ||
constructor(body, init) { | ||
this.#body = body; | ||
this.#init = init; | ||
if (init instanceof _Response) { | ||
const cachedGlobalResponse = init[responseCache]; | ||
if (cachedGlobalResponse) { | ||
this.#init = cachedGlobalResponse; | ||
this.cache; | ||
return; | ||
} else { | ||
this.#init = init.#init; | ||
} | ||
} else { | ||
this.#init = init; | ||
} | ||
if (typeof body === "string" || body instanceof ReadableStream) { | ||
@@ -75,2 +78,3 @@ let headers = init?.headers || { "content-type": "text/plain;charset=UTF-8" }; | ||
} | ||
; | ||
this[cacheKey] = [init?.status || 200, body, headers]; | ||
@@ -77,0 +81,0 @@ } |
@@ -103,3 +103,2 @@ "use strict"; | ||
var responseCache = Symbol("responseCache"); | ||
var newGlobalResponseKey = Symbol("newGlobalResponse"); | ||
var cacheKey = Symbol("cache"); | ||
@@ -110,16 +109,20 @@ var GlobalResponse = global.Response; | ||
#init; | ||
[newGlobalResponseKey]() { | ||
return new GlobalResponse( | ||
this.#body, | ||
this.#init instanceof _Response ? this.#init[newGlobalResponseKey]() : this.#init | ||
); | ||
} | ||
// @ts-ignore | ||
get cache() { | ||
delete this[cacheKey]; | ||
return this[responseCache] ||= this[newGlobalResponseKey](); | ||
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); | ||
} | ||
constructor(body, init) { | ||
this.#body = body; | ||
this.#init = init; | ||
if (init instanceof _Response) { | ||
const cachedGlobalResponse = init[responseCache]; | ||
if (cachedGlobalResponse) { | ||
this.#init = cachedGlobalResponse; | ||
this.cache; | ||
return; | ||
} else { | ||
this.#init = init.#init; | ||
} | ||
} else { | ||
this.#init = init; | ||
} | ||
if (typeof body === "string" || body instanceof ReadableStream) { | ||
@@ -130,2 +133,3 @@ let headers = init?.headers || { "content-type": "text/plain;charset=UTF-8" }; | ||
} | ||
; | ||
this[cacheKey] = [init?.status || 200, body, headers]; | ||
@@ -132,0 +136,0 @@ } |
@@ -98,3 +98,2 @@ "use strict"; | ||
var responseCache = Symbol("responseCache"); | ||
var newGlobalResponseKey = Symbol("newGlobalResponse"); | ||
var cacheKey = Symbol("cache"); | ||
@@ -105,16 +104,20 @@ var GlobalResponse = global.Response; | ||
#init; | ||
[newGlobalResponseKey]() { | ||
return new GlobalResponse( | ||
this.#body, | ||
this.#init instanceof _Response ? this.#init[newGlobalResponseKey]() : this.#init | ||
); | ||
} | ||
// @ts-ignore | ||
get cache() { | ||
delete this[cacheKey]; | ||
return this[responseCache] ||= this[newGlobalResponseKey](); | ||
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); | ||
} | ||
constructor(body, init) { | ||
this.#body = body; | ||
this.#init = init; | ||
if (init instanceof _Response) { | ||
const cachedGlobalResponse = init[responseCache]; | ||
if (cachedGlobalResponse) { | ||
this.#init = cachedGlobalResponse; | ||
this.cache; | ||
return; | ||
} else { | ||
this.#init = init.#init; | ||
} | ||
} else { | ||
this.#init = init; | ||
} | ||
if (typeof body === "string" || body instanceof ReadableStream) { | ||
@@ -125,2 +128,3 @@ let headers = init?.headers || { "content-type": "text/plain;charset=UTF-8" }; | ||
} | ||
; | ||
this[cacheKey] = [init?.status || 200, body, headers]; | ||
@@ -127,0 +131,0 @@ } |
@@ -1,2 +0,1 @@ | ||
declare const newGlobalResponseKey: unique symbol; | ||
declare const cacheKey: unique symbol; | ||
@@ -12,3 +11,2 @@ declare const GlobalResponse: { | ||
#private; | ||
[newGlobalResponseKey](): typeof GlobalResponse; | ||
private get cache(); | ||
@@ -15,0 +13,0 @@ constructor(body?: BodyInit | null, init?: ResponseInit); |
@@ -49,3 +49,2 @@ "use strict"; | ||
var responseCache = Symbol("responseCache"); | ||
var newGlobalResponseKey = Symbol("newGlobalResponse"); | ||
var cacheKey = Symbol("cache"); | ||
@@ -56,16 +55,20 @@ var GlobalResponse = global.Response; | ||
#init; | ||
[newGlobalResponseKey]() { | ||
return new GlobalResponse( | ||
this.#body, | ||
this.#init instanceof _Response ? this.#init[newGlobalResponseKey]() : this.#init | ||
); | ||
} | ||
// @ts-ignore | ||
get cache() { | ||
delete this[cacheKey]; | ||
return this[responseCache] ||= this[newGlobalResponseKey](); | ||
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); | ||
} | ||
constructor(body, init) { | ||
this.#body = body; | ||
this.#init = init; | ||
if (init instanceof _Response) { | ||
const cachedGlobalResponse = init[responseCache]; | ||
if (cachedGlobalResponse) { | ||
this.#init = cachedGlobalResponse; | ||
this.cache; | ||
return; | ||
} else { | ||
this.#init = init.#init; | ||
} | ||
} else { | ||
this.#init = init; | ||
} | ||
if (typeof body === "string" || body instanceof ReadableStream) { | ||
@@ -76,2 +79,3 @@ let headers = init?.headers || { "content-type": "text/plain;charset=UTF-8" }; | ||
} | ||
; | ||
this[cacheKey] = [init?.status || 200, body, headers]; | ||
@@ -78,0 +82,0 @@ } |
@@ -100,3 +100,2 @@ "use strict"; | ||
var responseCache = Symbol("responseCache"); | ||
var newGlobalResponseKey = Symbol("newGlobalResponse"); | ||
var cacheKey = Symbol("cache"); | ||
@@ -107,16 +106,20 @@ var GlobalResponse = global.Response; | ||
#init; | ||
[newGlobalResponseKey]() { | ||
return new GlobalResponse( | ||
this.#body, | ||
this.#init instanceof _Response ? this.#init[newGlobalResponseKey]() : this.#init | ||
); | ||
} | ||
// @ts-ignore | ||
get cache() { | ||
delete this[cacheKey]; | ||
return this[responseCache] ||= this[newGlobalResponseKey](); | ||
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); | ||
} | ||
constructor(body, init) { | ||
this.#body = body; | ||
this.#init = init; | ||
if (init instanceof _Response) { | ||
const cachedGlobalResponse = init[responseCache]; | ||
if (cachedGlobalResponse) { | ||
this.#init = cachedGlobalResponse; | ||
this.cache; | ||
return; | ||
} else { | ||
this.#init = init.#init; | ||
} | ||
} else { | ||
this.#init = init; | ||
} | ||
if (typeof body === "string" || body instanceof ReadableStream) { | ||
@@ -127,2 +130,3 @@ let headers = init?.headers || { "content-type": "text/plain;charset=UTF-8" }; | ||
} | ||
; | ||
this[cacheKey] = [init?.status || 200, body, headers]; | ||
@@ -129,0 +133,0 @@ } |
@@ -98,3 +98,2 @@ "use strict"; | ||
var responseCache = Symbol("responseCache"); | ||
var newGlobalResponseKey = Symbol("newGlobalResponse"); | ||
var cacheKey = Symbol("cache"); | ||
@@ -105,16 +104,20 @@ var GlobalResponse = global.Response; | ||
#init; | ||
[newGlobalResponseKey]() { | ||
return new GlobalResponse( | ||
this.#body, | ||
this.#init instanceof _Response ? this.#init[newGlobalResponseKey]() : this.#init | ||
); | ||
} | ||
// @ts-ignore | ||
get cache() { | ||
delete this[cacheKey]; | ||
return this[responseCache] ||= this[newGlobalResponseKey](); | ||
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); | ||
} | ||
constructor(body, init) { | ||
this.#body = body; | ||
this.#init = init; | ||
if (init instanceof _Response) { | ||
const cachedGlobalResponse = init[responseCache]; | ||
if (cachedGlobalResponse) { | ||
this.#init = cachedGlobalResponse; | ||
this.cache; | ||
return; | ||
} else { | ||
this.#init = init.#init; | ||
} | ||
} else { | ||
this.#init = init; | ||
} | ||
if (typeof body === "string" || body instanceof ReadableStream) { | ||
@@ -125,2 +128,3 @@ let headers = init?.headers || { "content-type": "text/plain;charset=UTF-8" }; | ||
} | ||
; | ||
this[cacheKey] = [init?.status || 200, body, headers]; | ||
@@ -127,0 +131,0 @@ } |
{ | ||
"name": "@hono/node-server", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Node.js Adapter for Hono", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
119042
3743