srvx 0.2.4 → 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.
@@ -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;
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "srvx",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Universal Server API based on web platform standards. Works seamlessly with Deno, Bun and Node.js.",
5
5
  "repository": "unjs/srvx",
6
6
  "license": "MIT",