capnweb 0.0.0-6664f94 → 0.0.0-667958e

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
@@ -203,6 +203,7 @@ The following types can be passed over RPC (in arguments or return values), and
203
203
  * `Error` and its well-known subclasses
204
204
  * `Blob`
205
205
  * `ReadableStream` and `WritableStream`, with automatic flow control.
206
+ * `URL`
206
207
  * `Headers`, `Request`, and `Response` from the Fetch API.
207
208
 
208
209
  The following types are not supported as of this writing, but may be added in the future:
@@ -58,6 +58,7 @@ function typeForRpc(value) {
58
58
  case Float64Array.prototype: return "bytes";
59
59
  case WritableStream.prototype: return "writable";
60
60
  case ReadableStream.prototype: return "readable";
61
+ case URL.prototype: return "url";
61
62
  case Headers.prototype: return "headers";
62
63
  case Request.prototype: return "request";
63
64
  case Response.prototype: return "response";
@@ -392,6 +393,7 @@ var RpcPayload = class RpcPayload {
392
393
  case "date":
393
394
  case "bytes":
394
395
  case "blob":
396
+ case "url":
395
397
  case "error":
396
398
  case "undefined": return value;
397
399
  case "array": {
@@ -589,6 +591,7 @@ var RpcPayload = class RpcPayload {
589
591
  case "bytes":
590
592
  case "blob":
591
593
  case "date":
594
+ case "url":
592
595
  case "error":
593
596
  case "undefined": return;
594
597
  case "array": {
@@ -671,6 +674,7 @@ var RpcPayload = class RpcPayload {
671
674
  case "rpc-target":
672
675
  case "writable":
673
676
  case "readable":
677
+ case "url":
674
678
  case "headers":
675
679
  case "request":
676
680
  case "response": return;
@@ -740,6 +744,7 @@ function followPath(value, parent, path, owner) {
740
744
  case "blob":
741
745
  case "date":
742
746
  case "error":
747
+ case "url":
743
748
  case "headers":
744
749
  case "request":
745
750
  case "response":
@@ -1162,6 +1167,7 @@ var Devaluator = class Devaluator {
1162
1167
  alternateTypeName
1163
1168
  ];
1164
1169
  }
1170
+ case "url": return ["url", value.href];
1165
1171
  case "headers": return ["headers", [...value]];
1166
1172
  case "request": {
1167
1173
  let req = value;
@@ -1481,6 +1487,9 @@ var Evaluator = class Evaluator {
1481
1487
  case "inf": return Infinity;
1482
1488
  case "-inf": return -Infinity;
1483
1489
  case "nan": return NaN;
1490
+ case "url":
1491
+ if (value.length === 2 && typeof value[1] === "string") return new URL(value[1]);
1492
+ break;
1484
1493
  case "headers":
1485
1494
  if (value.length === 2 && value[1] instanceof Array) return new Headers(value[1]);
1486
1495
  break;
@@ -2301,7 +2310,7 @@ var RpcSession$1 = class {
2301
2310
 
2302
2311
  //#endregion
2303
2312
  //#region src/websocket.ts
2304
- /** Close-frame reason max UTF-8 bytes: 125 payload − 2-byte status (RFC 6455 §5.5). */
2313
+ /** Close-frame reason max UTF-8 bytes: 125 payload - 2-byte status (RFC 6455 section 5.5). */
2305
2314
  const MAX_CLOSE_REASON_BYTES = 123;
2306
2315
  function newWebSocketRpcSession$1(webSocket, localMain, options) {
2307
2316
  if (typeof webSocket === "string") webSocket = new WebSocket(webSocket);