@lvce-editor/ipc 9.5.0 → 9.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.
Files changed (2) hide show
  1. package/dist/browser.js +17 -11
  2. package/package.json +1 -1
package/dist/browser.js CHANGED
@@ -352,7 +352,7 @@ const listen$2 = () => {
352
352
  const signal$2 = global => {
353
353
  global.postMessage(readyMessage);
354
354
  };
355
- let IpcChildWithWindow$1 = class IpcChildWithWindow extends Ipc {
355
+ class IpcChildWithWindow extends Ipc {
356
356
  getData(event) {
357
357
  return getData$1(event);
358
358
  }
@@ -381,12 +381,12 @@ let IpcChildWithWindow$1 = class IpcChildWithWindow extends Ipc {
381
381
  };
382
382
  this._rawIpc.addEventListener('message', wrapped);
383
383
  }
384
- };
384
+ }
385
385
  const wrap$4 = window => {
386
- return new IpcChildWithWindow$1(window);
386
+ return new IpcChildWithWindow(window);
387
387
  };
388
388
 
389
- const IpcChildWithWindow$2 = {
389
+ const IpcChildWithWindow$1 = {
390
390
  __proto__: null,
391
391
  listen: listen$2,
392
392
  signal: signal$2,
@@ -397,19 +397,23 @@ const isTransferrable = value => {
397
397
  return value instanceof MessagePort;
398
398
  };
399
399
 
400
+ const UntransferrableValue = {};
401
+
400
402
  const walkValue = (value, transferrables) => {
401
403
  if (!value) {
402
404
  return value;
403
405
  }
404
406
  if (isTransferrable(value)) {
405
407
  transferrables.push(value);
406
- return undefined;
408
+ return UntransferrableValue;
407
409
  }
408
410
  if (Array.isArray(value)) {
409
411
  const newItems = [];
410
412
  for (const item of value) {
411
413
  const newItem = walkValue(item, transferrables);
412
- newItems.push(newItem);
414
+ if (newItem !== UntransferrableValue) {
415
+ newItems.push(newItem);
416
+ }
413
417
  }
414
418
  return newItems;
415
419
  }
@@ -417,7 +421,9 @@ const walkValue = (value, transferrables) => {
417
421
  const newObject = Object.create(null);
418
422
  for (const [key, property] of Object.entries(value)) {
419
423
  const newValue = walkValue(property, transferrables);
420
- newObject[key] = newValue;
424
+ if (newValue !== UntransferrableValue) {
425
+ newObject[key] = newValue;
426
+ }
421
427
  }
422
428
  return newObject;
423
429
  }
@@ -442,7 +448,7 @@ const listen$1 = () => {
442
448
  const signal$1 = global => {
443
449
  global.postMessage(readyMessage);
444
450
  };
445
- class IpcChildWithWindow extends Ipc {
451
+ class IpcChildWithElectronWindow extends Ipc {
446
452
  getData(event) {
447
453
  return getData$1(event);
448
454
  }
@@ -477,10 +483,10 @@ class IpcChildWithWindow extends Ipc {
477
483
  }
478
484
  }
479
485
  const wrap$3 = window => {
480
- return new IpcChildWithWindow(window);
486
+ return new IpcChildWithElectronWindow(window);
481
487
  };
482
488
 
483
- const IpcChildWithElectronWindow = {
489
+ const IpcChildWithElectronWindow$1 = {
484
490
  __proto__: null,
485
491
  listen: listen$1,
486
492
  signal: signal$1,
@@ -744,4 +750,4 @@ const IpcParentWithWebSocket$1 = {
744
750
  wrap
745
751
  };
746
752
 
747
- export { IpcChildWithElectronWindow, IpcChildWithMessagePort$1 as IpcChildWithMessagePort, IpcChildWithModuleWorker$1 as IpcChildWithModuleWorker, IpcChildWithModuleWorkerAndMessagePort$1 as IpcChildWithModuleWorkerAndMessagePort, IpcChildWithWindow$2 as IpcChildWithWindow, IpcParentWithModuleWorker$1 as IpcParentWithModuleWorker, IpcParentWithWebSocket$1 as IpcParentWithWebSocket };
753
+ export { IpcChildWithElectronWindow$1 as IpcChildWithElectronWindow, IpcChildWithMessagePort$1 as IpcChildWithMessagePort, IpcChildWithModuleWorker$1 as IpcChildWithModuleWorker, IpcChildWithModuleWorkerAndMessagePort$1 as IpcChildWithModuleWorkerAndMessagePort, IpcChildWithWindow$1 as IpcChildWithWindow, IpcParentWithModuleWorker$1 as IpcParentWithModuleWorker, IpcParentWithWebSocket$1 as IpcParentWithWebSocket };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/ipc",
3
- "version": "9.5.0",
3
+ "version": "9.5.1",
4
4
  "description": "Inter Process Communication for Lvce Editor",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",