@vastblast/capnweb 0.5.0 → 0.5.1

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/index.d.cts CHANGED
@@ -70,9 +70,11 @@ interface StubBase<T = unknown> extends Disposable {
70
70
  // The reason for using a generic type here is to build a serializable subset of structured
71
71
  // cloneable composite types. This allows types defined with the "interface" keyword to pass the
72
72
  // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
73
- type RpcCompatible<T> =
74
- // Structured cloneables
75
- | BaseType
73
+ type RpcCompatible<T> =
74
+ // Allow `unknown` as a leaf so records/interfaces with `unknown` fields remain compatible.
75
+ | (IsUnknown<T> extends true ? unknown : never)
76
+ // Structured cloneables
77
+ | BaseType
76
78
  // Structured cloneable composites
77
79
  | Map<
78
80
  T extends Map<infer U, unknown> ? RpcCompatible<U> : never,
package/dist/index.d.ts CHANGED
@@ -70,9 +70,11 @@ interface StubBase<T = unknown> extends Disposable {
70
70
  // The reason for using a generic type here is to build a serializable subset of structured
71
71
  // cloneable composite types. This allows types defined with the "interface" keyword to pass the
72
72
  // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
73
- type RpcCompatible<T> =
74
- // Structured cloneables
75
- | BaseType
73
+ type RpcCompatible<T> =
74
+ // Allow `unknown` as a leaf so records/interfaces with `unknown` fields remain compatible.
75
+ | (IsUnknown<T> extends true ? unknown : never)
76
+ // Structured cloneables
77
+ | BaseType
76
78
  // Structured cloneable composites
77
79
  | Map<
78
80
  T extends Map<infer U, unknown> ? RpcCompatible<U> : never,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vastblast/capnweb",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "JavaScript/TypeScript-native RPC library with Promise Pipelining",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",