@hono/node-server 1.19.6 → 1.19.7
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/globals.d.mts +1 -1
- package/dist/globals.d.ts +1 -1
- package/dist/request.d.mts +1 -1
- package/dist/request.d.ts +1 -1
- package/dist/response.d.mts +1 -1
- package/dist/response.d.ts +1 -1
- package/dist/serve-static.d.mts +1 -1
- package/dist/serve-static.d.ts +1 -1
- package/dist/serve-static.js +1 -1
- package/dist/serve-static.mjs +2 -2
- package/dist/types.d.mts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +1 -1
package/dist/globals.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
export {
|
|
2
|
+
export { }
|
package/dist/globals.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
export {
|
|
2
|
+
export { }
|
package/dist/request.d.mts
CHANGED
|
@@ -22,4 +22,4 @@ declare const abortControllerKey: unique symbol;
|
|
|
22
22
|
declare const getAbortController: unique symbol;
|
|
23
23
|
declare const newRequest: (incoming: IncomingMessage | Http2ServerRequest, defaultHostname?: string) => any;
|
|
24
24
|
|
|
25
|
-
export { GlobalRequest, IncomingMessageWithWrapBodyStream, Request, RequestError, abortControllerKey, getAbortController, newRequest, toRequestError, wrapBodyStream };
|
|
25
|
+
export { GlobalRequest, type IncomingMessageWithWrapBodyStream, Request, RequestError, abortControllerKey, getAbortController, newRequest, toRequestError, wrapBodyStream };
|
package/dist/request.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ declare const abortControllerKey: unique symbol;
|
|
|
22
22
|
declare const getAbortController: unique symbol;
|
|
23
23
|
declare const newRequest: (incoming: IncomingMessage | Http2ServerRequest, defaultHostname?: string) => any;
|
|
24
24
|
|
|
25
|
-
export { GlobalRequest, IncomingMessageWithWrapBodyStream, Request, RequestError, abortControllerKey, getAbortController, newRequest, toRequestError, wrapBodyStream };
|
|
25
|
+
export { GlobalRequest, type IncomingMessageWithWrapBodyStream, Request, RequestError, abortControllerKey, getAbortController, newRequest, toRequestError, wrapBodyStream };
|
package/dist/response.d.mts
CHANGED
package/dist/response.d.ts
CHANGED
package/dist/serve-static.d.mts
CHANGED
package/dist/serve-static.d.ts
CHANGED
package/dist/serve-static.js
CHANGED
package/dist/serve-static.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/serve-static.ts
|
|
2
2
|
import { getMimeType } from "hono/utils/mime";
|
|
3
|
-
import { createReadStream,
|
|
3
|
+
import { createReadStream, statSync, existsSync } from "fs";
|
|
4
4
|
import { join } from "path";
|
|
5
5
|
var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i;
|
|
6
6
|
var ENCODINGS = {
|
|
@@ -31,7 +31,7 @@ var createStreamBody = (stream) => {
|
|
|
31
31
|
var getStats = (path) => {
|
|
32
32
|
let stats;
|
|
33
33
|
try {
|
|
34
|
-
stats =
|
|
34
|
+
stats = statSync(path);
|
|
35
35
|
} catch {
|
|
36
36
|
}
|
|
37
37
|
return stats;
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IncomingMessage, ServerResponse,
|
|
2
|
-
import { Http2ServerRequest, Http2ServerResponse,
|
|
1
|
+
import { IncomingMessage, ServerResponse, ServerOptions as ServerOptions$1, createServer, Server } from 'node:http';
|
|
2
|
+
import { Http2ServerRequest, Http2ServerResponse, ServerOptions as ServerOptions$3, createServer as createServer$2, SecureServerOptions, createSecureServer, Http2Server, Http2SecureServer } from 'node:http2';
|
|
3
3
|
import { ServerOptions as ServerOptions$2, createServer as createServer$1 } from 'node:https';
|
|
4
4
|
|
|
5
5
|
type HttpBindings = {
|
|
@@ -41,4 +41,4 @@ type Options = {
|
|
|
41
41
|
} & ServerOptions;
|
|
42
42
|
type CustomErrorHandler = (err: unknown) => void | Response | Promise<void | Response>;
|
|
43
43
|
|
|
44
|
-
export { CustomErrorHandler, FetchCallback, Http2Bindings, HttpBindings, NextHandlerOption, Options, ServerOptions, ServerType };
|
|
44
|
+
export type { CustomErrorHandler, FetchCallback, Http2Bindings, HttpBindings, NextHandlerOption, Options, ServerOptions, ServerType };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IncomingMessage, ServerResponse,
|
|
2
|
-
import { Http2ServerRequest, Http2ServerResponse,
|
|
1
|
+
import { IncomingMessage, ServerResponse, ServerOptions as ServerOptions$1, createServer, Server } from 'node:http';
|
|
2
|
+
import { Http2ServerRequest, Http2ServerResponse, ServerOptions as ServerOptions$3, createServer as createServer$2, SecureServerOptions, createSecureServer, Http2Server, Http2SecureServer } from 'node:http2';
|
|
3
3
|
import { ServerOptions as ServerOptions$2, createServer as createServer$1 } from 'node:https';
|
|
4
4
|
|
|
5
5
|
type HttpBindings = {
|
|
@@ -41,4 +41,4 @@ type Options = {
|
|
|
41
41
|
} & ServerOptions;
|
|
42
42
|
type CustomErrorHandler = (err: unknown) => void | Response | Promise<void | Response>;
|
|
43
43
|
|
|
44
|
-
export { CustomErrorHandler, FetchCallback, Http2Bindings, HttpBindings, NextHandlerOption, Options, ServerOptions, ServerType };
|
|
44
|
+
export type { CustomErrorHandler, FetchCallback, Http2Bindings, HttpBindings, NextHandlerOption, Options, ServerOptions, ServerType };
|
package/dist/utils.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import { OutgoingHttpHeaders } from 'node:http';
|
|
|
2
2
|
import { Writable } from 'node:stream';
|
|
3
3
|
|
|
4
4
|
declare function readWithoutBlocking(readPromise: Promise<ReadableStreamReadResult<Uint8Array>>): Promise<ReadableStreamReadResult<Uint8Array> | undefined>;
|
|
5
|
-
declare function writeFromReadableStreamDefaultReader(reader: ReadableStreamDefaultReader<Uint8Array>, writable: Writable, currentReadPromise?: Promise<ReadableStreamReadResult<Uint8Array>> | undefined): Promise<
|
|
6
|
-
declare function writeFromReadableStream(stream: ReadableStream<Uint8Array>, writable: Writable): Promise<
|
|
5
|
+
declare function writeFromReadableStreamDefaultReader(reader: ReadableStreamDefaultReader<Uint8Array>, writable: Writable, currentReadPromise?: Promise<ReadableStreamReadResult<Uint8Array>> | undefined): Promise<undefined>;
|
|
6
|
+
declare function writeFromReadableStream(stream: ReadableStream<Uint8Array>, writable: Writable): Promise<undefined> | undefined;
|
|
7
7
|
declare const buildOutgoingHttpHeaders: (headers: Headers | HeadersInit | null | undefined) => OutgoingHttpHeaders;
|
|
8
8
|
|
|
9
9
|
export { buildOutgoingHttpHeaders, readWithoutBlocking, writeFromReadableStream, writeFromReadableStreamDefaultReader };
|
package/dist/utils.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { OutgoingHttpHeaders } from 'node:http';
|
|
|
2
2
|
import { Writable } from 'node:stream';
|
|
3
3
|
|
|
4
4
|
declare function readWithoutBlocking(readPromise: Promise<ReadableStreamReadResult<Uint8Array>>): Promise<ReadableStreamReadResult<Uint8Array> | undefined>;
|
|
5
|
-
declare function writeFromReadableStreamDefaultReader(reader: ReadableStreamDefaultReader<Uint8Array>, writable: Writable, currentReadPromise?: Promise<ReadableStreamReadResult<Uint8Array>> | undefined): Promise<
|
|
6
|
-
declare function writeFromReadableStream(stream: ReadableStream<Uint8Array>, writable: Writable): Promise<
|
|
5
|
+
declare function writeFromReadableStreamDefaultReader(reader: ReadableStreamDefaultReader<Uint8Array>, writable: Writable, currentReadPromise?: Promise<ReadableStreamReadResult<Uint8Array>> | undefined): Promise<undefined>;
|
|
6
|
+
declare function writeFromReadableStream(stream: ReadableStream<Uint8Array>, writable: Writable): Promise<undefined> | undefined;
|
|
7
7
|
declare const buildOutgoingHttpHeaders: (headers: Headers | HeadersInit | null | undefined) => OutgoingHttpHeaders;
|
|
8
8
|
|
|
9
9
|
export { buildOutgoingHttpHeaders, readWithoutBlocking, writeFromReadableStream, writeFromReadableStreamDefaultReader };
|