srvx 0.2.3 → 0.2.5
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/adapters/node.d.mts +5 -0
- package/dist/adapters/node.mjs +5 -8
- package/dist/types.d.mts +1 -1
- package/package.json +1 -1
package/dist/adapters/node.d.mts
CHANGED
|
@@ -6,6 +6,11 @@ import 'bun';
|
|
|
6
6
|
import '@cloudflare/workers-types';
|
|
7
7
|
|
|
8
8
|
type NodeFastResponse = InstanceType<typeof NodeFastResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Fast Response for Node.js runtime
|
|
11
|
+
*
|
|
12
|
+
* It is faster because in most cases it doesn't create a full Response instance.
|
|
13
|
+
*/
|
|
9
14
|
declare const NodeFastResponse: {
|
|
10
15
|
new (body?: BodyInit | null, init?: ResponseInit): {
|
|
11
16
|
"__#4201@#body"?: BodyInit | null;
|
package/dist/adapters/node.mjs
CHANGED
|
@@ -516,13 +516,8 @@ async function _readStream(stream) {
|
|
|
516
516
|
return Buffer.concat(chunks);
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
const NodeFastResponse = /* @__PURE__ */ (() =>
|
|
520
|
-
|
|
521
|
-
* Fast Response for Node.js runtime
|
|
522
|
-
*
|
|
523
|
-
* It is faster because in most cases it doesn't create a full Response instance.
|
|
524
|
-
*/
|
|
525
|
-
class NodeFastResponse {
|
|
519
|
+
const NodeFastResponse = /* @__PURE__ */ (() => {
|
|
520
|
+
class NodeFastResponse2 {
|
|
526
521
|
#body;
|
|
527
522
|
#init;
|
|
528
523
|
constructor(body, init) {
|
|
@@ -739,7 +734,9 @@ const NodeFastResponse = /* @__PURE__ */ (() => (
|
|
|
739
734
|
return this.text().then((text) => JSON.parse(text));
|
|
740
735
|
}
|
|
741
736
|
}
|
|
742
|
-
|
|
737
|
+
Object.setPrototypeOf(NodeFastResponse2.prototype, Response.prototype);
|
|
738
|
+
return NodeFastResponse2;
|
|
739
|
+
})();
|
|
743
740
|
|
|
744
741
|
function serve(options) {
|
|
745
742
|
return new NodeServer(options);
|
package/dist/types.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import * as Bun from 'bun';
|
|
|
4
4
|
import * as CF from '@cloudflare/workers-types';
|
|
5
5
|
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
7
|
-
declare const Response: globalThis.Response;
|
|
7
|
+
declare const Response: typeof globalThis.Response;
|
|
8
8
|
/**
|
|
9
9
|
* Create a new server instance.
|
|
10
10
|
*/
|