@lvce-editor/extension-host-worker 5.6.0 → 5.7.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.
@@ -30,6 +30,21 @@ const getJson$1 = async url => {
30
30
  throw new DepecratedError(`vscode.getJson is deprecated, use createNodeRpc instead`);
31
31
  };
32
32
 
33
+ class NonError extends Error {
34
+ name = 'NonError';
35
+ constructor(message) {
36
+ super(message);
37
+ }
38
+ }
39
+
40
+ // ensureError based on https://github.com/sindresorhus/ensure-error/blob/main/index.ts (License MIT)
41
+ const ensureError = input => {
42
+ if (!(input instanceof Error)) {
43
+ return new NonError(input);
44
+ }
45
+ return input;
46
+ };
47
+
33
48
  class AssertionError extends Error {
34
49
  constructor(message) {
35
50
  super(message);
@@ -510,20 +525,6 @@ const improveValidationError = (name, validationError) => {
510
525
  const post = improveValidationErrorPostMessage(validationError, camelCaseName);
511
526
  return pre + ': ' + post;
512
527
  };
513
- class NonError extends Error {
514
- name = 'NonError';
515
- constructor(message) {
516
- super(message);
517
- }
518
- }
519
-
520
- // ensureError based on https://github.com/sindresorhus/ensure-error/blob/main/index.ts (License MIT)
521
- const ensureError = input => {
522
- if (!(input instanceof Error)) {
523
- return new NonError(input);
524
- }
525
- return input;
526
- };
527
528
  const registerMethod = ({
528
529
  context,
529
530
  providers,
@@ -550,7 +551,6 @@ const registerMethod = ({
550
551
  const error = validate(result, resultShape);
551
552
  if (error) {
552
553
  const improvedError = improveValidationError(name, error);
553
- // @ts-ignore
554
554
  throw new VError(improvedError);
555
555
  }
556
556
  return result;
@@ -560,11 +560,9 @@ const registerMethod = ({
560
560
  if (actualError && actualError.message) {
561
561
  if (actualError.message === 'provider[methodName] is not a function') {
562
562
  const camelCaseName = toCamelCase(name);
563
- // @ts-ignore
564
563
  throw new VError(`Failed to execute ${spacedOutName} provider: VError: ${camelCaseName}Provider.${methodName} is not a function`);
565
564
  }
566
- const message = actualError.name === 'Error' ? actualError.message : `${actualError.name}: ${actualError.message}`;
567
- actualError.message = `Failed to execute ${spacedOutName} provider: ${message}`;
565
+ throw new VError(actualError, `Failed to execute ${spacedOutName} provider`);
568
566
  }
569
567
  throw actualError;
570
568
  }
@@ -756,7 +754,7 @@ const setConfigurations = preferences => {
756
754
  };
757
755
 
758
756
  const rpcs$2 = Object.create(null);
759
- const set$5$1 = (id, rpc) => {
757
+ const set$a = (id, rpc) => {
760
758
  rpcs$2[id] = rpc;
761
759
  };
762
760
  const get$a = id => {
@@ -5002,7 +5000,7 @@ const handleMessagePort2 = async (port, rpcId) => {
5002
5000
  commandMap: {}
5003
5001
  });
5004
5002
  if (rpcId) {
5005
- set$5$1(rpcId, rpc);
5003
+ set$a(rpcId, rpc);
5006
5004
  }
5007
5005
  };
5008
5006
 
@@ -5012,7 +5010,7 @@ const handleMessagePort = async (port, rpcId) => {
5012
5010
  commandMap: {}
5013
5011
  });
5014
5012
  if (rpcId) {
5015
- set$5$1(rpcId, rpc);
5013
+ set$a(rpcId, rpc);
5016
5014
  }
5017
5015
  };
5018
5016
 
@@ -5688,7 +5686,7 @@ const listen = async () => {
5688
5686
  const rpc = await WebWorkerRpcClient.create({
5689
5687
  commandMap: commandMap
5690
5688
  });
5691
- set$5$1(RendererWorker, rpc);
5689
+ set$a(RendererWorker, rpc);
5692
5690
  };
5693
5691
 
5694
5692
  const main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"