@lvce-editor/completion-worker 1.20.0 → 1.21.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/completionWorkerMain.js +25 -17
- package/package.json +1 -1
|
@@ -60,43 +60,51 @@ class AssertionError extends Error {
|
|
|
60
60
|
this.name = 'AssertionError';
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
const Object$1 = 1;
|
|
64
|
+
const Number$1 = 2;
|
|
65
|
+
const Array$1 = 3;
|
|
66
|
+
const String = 4;
|
|
67
|
+
const Boolean$1 = 5;
|
|
68
|
+
const Function$1 = 6;
|
|
69
|
+
const Null = 7;
|
|
70
|
+
const Unknown = 8;
|
|
63
71
|
const getType = value => {
|
|
64
72
|
switch (typeof value) {
|
|
65
73
|
case 'number':
|
|
66
|
-
return
|
|
74
|
+
return Number$1;
|
|
67
75
|
case 'function':
|
|
68
|
-
return
|
|
76
|
+
return Function$1;
|
|
69
77
|
case 'string':
|
|
70
|
-
return
|
|
78
|
+
return String;
|
|
71
79
|
case 'object':
|
|
72
80
|
if (value === null) {
|
|
73
|
-
return
|
|
81
|
+
return Null;
|
|
74
82
|
}
|
|
75
83
|
if (Array.isArray(value)) {
|
|
76
|
-
return
|
|
84
|
+
return Array$1;
|
|
77
85
|
}
|
|
78
|
-
return
|
|
86
|
+
return Object$1;
|
|
79
87
|
case 'boolean':
|
|
80
|
-
return
|
|
88
|
+
return Boolean$1;
|
|
81
89
|
default:
|
|
82
|
-
return
|
|
90
|
+
return Unknown;
|
|
83
91
|
}
|
|
84
92
|
};
|
|
85
93
|
const object = value => {
|
|
86
94
|
const type = getType(value);
|
|
87
|
-
if (type !==
|
|
95
|
+
if (type !== Object$1) {
|
|
88
96
|
throw new AssertionError('expected value to be of type object');
|
|
89
97
|
}
|
|
90
98
|
};
|
|
91
99
|
const number = value => {
|
|
92
100
|
const type = getType(value);
|
|
93
|
-
if (type !==
|
|
101
|
+
if (type !== Number$1) {
|
|
94
102
|
throw new AssertionError('expected value to be of type number');
|
|
95
103
|
}
|
|
96
104
|
};
|
|
97
105
|
const string = value => {
|
|
98
106
|
const type = getType(value);
|
|
99
|
-
if (type !==
|
|
107
|
+
if (type !== String) {
|
|
100
108
|
throw new AssertionError('expected value to be of type string');
|
|
101
109
|
}
|
|
102
110
|
};
|
|
@@ -1001,7 +1009,7 @@ const WebWorkerRpcClient = {
|
|
|
1001
1009
|
};
|
|
1002
1010
|
|
|
1003
1011
|
const rpcs = Object.create(null);
|
|
1004
|
-
const set$
|
|
1012
|
+
const set$g = (id, rpc) => {
|
|
1005
1013
|
rpcs[id] = rpc;
|
|
1006
1014
|
};
|
|
1007
1015
|
const get$1 = id => {
|
|
@@ -1025,7 +1033,7 @@ const create$2 = rpcId => {
|
|
|
1025
1033
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1026
1034
|
},
|
|
1027
1035
|
set(rpc) {
|
|
1028
|
-
set$
|
|
1036
|
+
set$g(rpcId, rpc);
|
|
1029
1037
|
},
|
|
1030
1038
|
async dispose() {
|
|
1031
1039
|
const rpc = get$1(rpcId);
|
|
@@ -1036,21 +1044,21 @@ const create$2 = rpcId => {
|
|
|
1036
1044
|
const EditorWorker$1 = 99;
|
|
1037
1045
|
const ExtensionHostWorker = 44;
|
|
1038
1046
|
const {
|
|
1039
|
-
invoke: invoke$
|
|
1047
|
+
invoke: invoke$d,
|
|
1040
1048
|
invokeAndTransfer: invokeAndTransfer$c,
|
|
1041
1049
|
set: set$c} = create$2(EditorWorker$1);
|
|
1042
1050
|
const EditorWorker = {
|
|
1043
1051
|
__proto__: null,
|
|
1044
|
-
invoke: invoke$
|
|
1052
|
+
invoke: invoke$d,
|
|
1045
1053
|
invokeAndTransfer: invokeAndTransfer$c,
|
|
1046
1054
|
set: set$c
|
|
1047
1055
|
};
|
|
1048
1056
|
const {
|
|
1049
|
-
invoke: invoke$
|
|
1057
|
+
invoke: invoke$a,
|
|
1050
1058
|
set: set$9} = create$2(ExtensionHostWorker);
|
|
1051
1059
|
const ExtensionHost = {
|
|
1052
1060
|
__proto__: null,
|
|
1053
|
-
invoke: invoke$
|
|
1061
|
+
invoke: invoke$a,
|
|
1054
1062
|
set: set$9
|
|
1055
1063
|
};
|
|
1056
1064
|
|