@lvce-editor/iframe-worker 3.0.0 → 3.1.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/dist/iframeWorkerMain.js +19 -2
- package/package.json +1 -1
package/dist/iframeWorkerMain.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
const Two = '2.0';
|
|
2
|
+
const create$4 = (method, params) => {
|
|
3
|
+
return {
|
|
4
|
+
jsonrpc: Two,
|
|
5
|
+
method,
|
|
6
|
+
params
|
|
7
|
+
};
|
|
8
|
+
};
|
|
2
9
|
const state$2 = {
|
|
3
10
|
callbacks: Object.create(null)
|
|
4
11
|
};
|
|
@@ -230,7 +237,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
|
|
|
230
237
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
231
238
|
return create$1$2(message, errorProperty);
|
|
232
239
|
};
|
|
233
|
-
const create$
|
|
240
|
+
const create$5 = (message, result) => {
|
|
234
241
|
return {
|
|
235
242
|
jsonrpc: Two,
|
|
236
243
|
id: message.id,
|
|
@@ -239,7 +246,7 @@ const create$4 = (message, result) => {
|
|
|
239
246
|
};
|
|
240
247
|
const getSuccessResponse = (message, result) => {
|
|
241
248
|
const resultProperty = result ?? null;
|
|
242
|
-
return create$
|
|
249
|
+
return create$5(message, resultProperty);
|
|
243
250
|
};
|
|
244
251
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
245
252
|
try {
|
|
@@ -328,6 +335,10 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
328
335
|
const responseMessage = await promise;
|
|
329
336
|
return unwrapJsonRpcResult(responseMessage);
|
|
330
337
|
};
|
|
338
|
+
const send = (transport, method, ...params) => {
|
|
339
|
+
const message = create$4(method, params);
|
|
340
|
+
transport.send(message);
|
|
341
|
+
};
|
|
331
342
|
const invoke$4 = (ipc, method, ...params) => {
|
|
332
343
|
return invokeHelper(ipc, method, params, false);
|
|
333
344
|
};
|
|
@@ -735,6 +746,12 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
|
735
746
|
|
|
736
747
|
const createRpc = ipc => {
|
|
737
748
|
const rpc = {
|
|
749
|
+
/**
|
|
750
|
+
* @deprecated
|
|
751
|
+
*/
|
|
752
|
+
send(method, ...params) {
|
|
753
|
+
send(ipc, method, ...params);
|
|
754
|
+
},
|
|
738
755
|
invoke(method, ...params) {
|
|
739
756
|
return invoke$4(ipc, method, ...params);
|
|
740
757
|
},
|