hono 4.12.0 → 4.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/context.js
CHANGED
|
@@ -345,9 +345,6 @@ class Context {
|
|
|
345
345
|
* ```
|
|
346
346
|
*/
|
|
347
347
|
body = (data, arg, headers) => this.#newResponse(data, arg, headers);
|
|
348
|
-
#useFastPath() {
|
|
349
|
-
return !this.#preparedHeaders && !this.#status && !this.finalized;
|
|
350
|
-
}
|
|
351
348
|
/**
|
|
352
349
|
* `.text()` can render text as `Content-Type:text/plain`.
|
|
353
350
|
*
|
|
@@ -361,7 +358,7 @@ class Context {
|
|
|
361
358
|
* ```
|
|
362
359
|
*/
|
|
363
360
|
text = (text, arg, headers) => {
|
|
364
|
-
return this.#
|
|
361
|
+
return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(
|
|
365
362
|
text,
|
|
366
363
|
arg,
|
|
367
364
|
setDefaultContentType(TEXT_PLAIN, headers)
|
|
@@ -380,7 +377,7 @@ class Context {
|
|
|
380
377
|
* ```
|
|
381
378
|
*/
|
|
382
379
|
json = (object, arg, headers) => {
|
|
383
|
-
return this.#
|
|
380
|
+
return this.#newResponse(
|
|
384
381
|
JSON.stringify(object),
|
|
385
382
|
arg,
|
|
386
383
|
setDefaultContentType("application/json", headers)
|
package/dist/context.js
CHANGED
|
@@ -322,9 +322,6 @@ var Context = class {
|
|
|
322
322
|
* ```
|
|
323
323
|
*/
|
|
324
324
|
body = (data, arg, headers) => this.#newResponse(data, arg, headers);
|
|
325
|
-
#useFastPath() {
|
|
326
|
-
return !this.#preparedHeaders && !this.#status && !this.finalized;
|
|
327
|
-
}
|
|
328
325
|
/**
|
|
329
326
|
* `.text()` can render text as `Content-Type:text/plain`.
|
|
330
327
|
*
|
|
@@ -338,7 +335,7 @@ var Context = class {
|
|
|
338
335
|
* ```
|
|
339
336
|
*/
|
|
340
337
|
text = (text, arg, headers) => {
|
|
341
|
-
return this.#
|
|
338
|
+
return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(
|
|
342
339
|
text,
|
|
343
340
|
arg,
|
|
344
341
|
setDefaultContentType(TEXT_PLAIN, headers)
|
|
@@ -357,7 +354,7 @@ var Context = class {
|
|
|
357
354
|
* ```
|
|
358
355
|
*/
|
|
359
356
|
json = (object, arg, headers) => {
|
|
360
|
-
return this.#
|
|
357
|
+
return this.#newResponse(
|
|
361
358
|
JSON.stringify(object),
|
|
362
359
|
arg,
|
|
363
360
|
setDefaultContentType("application/json", headers)
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { hc } from './client';
|
|
6
6
|
export { parseResponse, DetailedError } from './utils';
|
|
7
|
-
export type { InferResponseType, InferRequestType, Fetch, ClientRequestOptions, ClientRequest, ClientResponse, } from './types';
|
|
7
|
+
export type { InferResponseType, InferRequestType, Fetch, ClientRequestOptions, ClientRequest, ClientResponse, ApplyGlobalResponse, } from './types';
|