@orpc/standard-server-fetch 0.49.0 → 0.51.0

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/README.md CHANGED
@@ -67,6 +67,14 @@ You can find the full documentation [here](https://orpc.unnoq.com).
67
67
 
68
68
  [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) server adapter for oRPC.
69
69
 
70
+ ## Sponsors
71
+
72
+ <p align="center">
73
+ <a href="https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg">
74
+ <img src='https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg'/>
75
+ </a>
76
+ </p>
77
+
70
78
  ## License
71
79
 
72
80
  Distributed under the MIT License. See [LICENSE](https://github.com/unnoq/orpc/blob/main/LICENSE) for more information.
package/dist/index.mjs CHANGED
@@ -182,14 +182,15 @@ function toFetchHeaders(headers, fetchHeaders = new Headers()) {
182
182
  }
183
183
 
184
184
  function toStandardLazyRequest(request) {
185
+ const raw = { adapter: "fetch", request };
185
186
  return {
186
- raw: { request },
187
+ raw,
187
188
  url: new URL(request.url),
188
189
  signal: request.signal,
189
190
  method: request.method,
190
- body: once(() => toStandardBody(request)),
191
+ body: once(() => toStandardBody(raw.request)),
191
192
  get headers() {
192
- const headers = toStandardHeaders(request.headers);
193
+ const headers = toStandardHeaders(raw.request.headers);
193
194
  Object.defineProperty(this, "headers", { value: headers, writable: true });
194
195
  return headers;
195
196
  },
@@ -215,12 +216,13 @@ function toFetchResponse(response, options = {}) {
215
216
  return new Response(body, { headers, status: response.status });
216
217
  }
217
218
  function toStandardLazyResponse(response) {
219
+ const raw = { adapter: "fetch", response };
218
220
  return {
219
- raw: { response },
220
- body: once(() => toStandardBody(response)),
221
+ raw,
222
+ body: once(() => toStandardBody(raw.response)),
221
223
  status: response.status,
222
224
  get headers() {
223
- const headers = toStandardHeaders(response.headers);
225
+ const headers = toStandardHeaders(raw.response.headers);
224
226
  Object.defineProperty(this, "headers", { value: headers, writable: true });
225
227
  return headers;
226
228
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/standard-server-fetch",
3
3
  "type": "module",
4
- "version": "0.49.0",
4
+ "version": "0.51.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://unnoq.com",
7
7
  "repository": {
@@ -23,8 +23,8 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "@orpc/shared": "0.49.0",
27
- "@orpc/standard-server": "0.49.0"
26
+ "@orpc/shared": "0.51.0",
27
+ "@orpc/standard-server": "0.51.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@hono/node-server": "^1.13.8"