capnweb 0.2.0 → 0.3.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 +4 -0
- package/dist/index-workers.cjs +7 -4
- package/dist/index-workers.cjs.map +1 -1
- package/dist/index-workers.d.cts +1 -1
- package/dist/index-workers.d.ts +1 -1
- package/dist/index-workers.js +7 -4
- package/dist/index-workers.js.map +1 -1
- package/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -21
- package/dist/index.d.ts +29 -21
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index-workers.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RpcPromise, RpcSession, RpcSessionOptions, RpcStub, RpcTarget, RpcTransport, deserialize, newHttpBatchRpcResponse, newHttpBatchRpcSession, newMessagePortRpcSession, newWebSocketRpcSession, newWorkersRpcResponse, newWorkersWebSocketRpcResponse, nodeHttpBatchRpcResponse, serialize } from './index.cjs';
|
|
1
|
+
export { RpcCompatible, RpcPromise, RpcSession, RpcSessionOptions, RpcStub, RpcTarget, RpcTransport, deserialize, newHttpBatchRpcResponse, newHttpBatchRpcSession, newMessagePortRpcSession, newWebSocketRpcSession, newWorkersRpcResponse, newWorkersWebSocketRpcResponse, nodeHttpBatchRpcResponse, serialize } from './index.cjs';
|
|
2
2
|
import 'node:http';
|
package/dist/index-workers.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RpcPromise, RpcSession, RpcSessionOptions, RpcStub, RpcTarget, RpcTransport, deserialize, newHttpBatchRpcResponse, newHttpBatchRpcSession, newMessagePortRpcSession, newWebSocketRpcSession, newWorkersRpcResponse, newWorkersWebSocketRpcResponse, nodeHttpBatchRpcResponse, serialize } from './index.js';
|
|
1
|
+
export { RpcCompatible, RpcPromise, RpcSession, RpcSessionOptions, RpcStub, RpcTarget, RpcTransport, deserialize, newHttpBatchRpcResponse, newHttpBatchRpcSession, newMessagePortRpcSession, newWebSocketRpcSession, newWorkersRpcResponse, newWorkersWebSocketRpcResponse, nodeHttpBatchRpcResponse, serialize } from './index.js';
|
|
2
2
|
import 'node:http';
|
package/dist/index-workers.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as cfw from 'cloudflare:workers';
|
|
2
2
|
|
|
3
3
|
// src/symbols.ts
|
|
4
|
-
var WORKERS_MODULE_SYMBOL = Symbol("workers-module");
|
|
4
|
+
var WORKERS_MODULE_SYMBOL = /* @__PURE__ */ Symbol("workers-module");
|
|
5
5
|
globalThis[WORKERS_MODULE_SYMBOL] = cfw;
|
|
6
6
|
|
|
7
7
|
// src/core.ts
|
|
8
8
|
if (!Symbol.dispose) {
|
|
9
|
-
Symbol.dispose = Symbol.for("dispose");
|
|
9
|
+
Symbol.dispose = /* @__PURE__ */ Symbol.for("dispose");
|
|
10
10
|
}
|
|
11
11
|
if (!Symbol.asyncDispose) {
|
|
12
|
-
Symbol.asyncDispose = Symbol.for("asyncDispose");
|
|
12
|
+
Symbol.asyncDispose = /* @__PURE__ */ Symbol.for("asyncDispose");
|
|
13
13
|
}
|
|
14
14
|
if (!Promise.withResolvers) {
|
|
15
15
|
Promise.withResolvers = function() {
|
|
@@ -25,6 +25,8 @@ if (!Promise.withResolvers) {
|
|
|
25
25
|
var workersModule = globalThis[WORKERS_MODULE_SYMBOL];
|
|
26
26
|
var RpcTarget = workersModule ? workersModule.RpcTarget : class {
|
|
27
27
|
};
|
|
28
|
+
var AsyncFunction = (async function() {
|
|
29
|
+
}).constructor;
|
|
28
30
|
function typeForRpc(value) {
|
|
29
31
|
switch (typeof value) {
|
|
30
32
|
case "boolean":
|
|
@@ -49,6 +51,7 @@ function typeForRpc(value) {
|
|
|
49
51
|
case Object.prototype:
|
|
50
52
|
return "object";
|
|
51
53
|
case Function.prototype:
|
|
54
|
+
case AsyncFunction.prototype:
|
|
52
55
|
return "function";
|
|
53
56
|
case Array.prototype:
|
|
54
57
|
return "array";
|
|
@@ -132,7 +135,7 @@ function withCallInterceptor(interceptor, callback) {
|
|
|
132
135
|
doCall = oldValue;
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
|
-
var RAW_STUB = Symbol("realStub");
|
|
138
|
+
var RAW_STUB = /* @__PURE__ */ Symbol("realStub");
|
|
136
139
|
var PROXY_HANDLERS = {
|
|
137
140
|
apply(target, thisArg, argumentsList) {
|
|
138
141
|
let stub = target.raw;
|