@lvce-editor/editor-worker 4.10.0 → 4.11.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/editorWorkerMain.js +11 -24
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -24,7 +24,7 @@ let AssertionError$1 = class AssertionError extends Error {
|
|
|
24
24
|
this.name = 'AssertionError';
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
const getType$
|
|
27
|
+
const getType$1 = value => {
|
|
28
28
|
switch (typeof value) {
|
|
29
29
|
case 'number':
|
|
30
30
|
return 'number';
|
|
@@ -47,31 +47,31 @@ const getType$2 = value => {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
const object = value => {
|
|
50
|
-
const type = getType$
|
|
50
|
+
const type = getType$1(value);
|
|
51
51
|
if (type !== 'object') {
|
|
52
52
|
throw new AssertionError$1('expected value to be of type object');
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
const number$1 = value => {
|
|
56
|
-
const type = getType$
|
|
56
|
+
const type = getType$1(value);
|
|
57
57
|
if (type !== 'number') {
|
|
58
58
|
throw new AssertionError$1('expected value to be of type number');
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
const array = value => {
|
|
62
|
-
const type = getType$
|
|
62
|
+
const type = getType$1(value);
|
|
63
63
|
if (type !== 'array') {
|
|
64
64
|
throw new AssertionError$1('expected value to be of type array');
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
const string = value => {
|
|
68
|
-
const type = getType$
|
|
68
|
+
const type = getType$1(value);
|
|
69
69
|
if (type !== 'string') {
|
|
70
70
|
throw new AssertionError$1('expected value to be of type string');
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
const boolean = value => {
|
|
74
|
-
const type = getType$
|
|
74
|
+
const type = getType$1(value);
|
|
75
75
|
if (type !== 'boolean') {
|
|
76
76
|
throw new AssertionError$1('expected value to be of type boolean');
|
|
77
77
|
}
|
|
@@ -1048,7 +1048,7 @@ class AssertionError extends Error {
|
|
|
1048
1048
|
this.name = 'AssertionError';
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
|
-
const getType
|
|
1051
|
+
const getType = value => {
|
|
1052
1052
|
switch (typeof value) {
|
|
1053
1053
|
case 'number':
|
|
1054
1054
|
return 'number';
|
|
@@ -1071,7 +1071,7 @@ const getType$1 = value => {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
};
|
|
1073
1073
|
const number = value => {
|
|
1074
|
-
const type = getType
|
|
1074
|
+
const type = getType(value);
|
|
1075
1075
|
if (type !== 'number') {
|
|
1076
1076
|
throw new AssertionError('expected value to be of type number');
|
|
1077
1077
|
}
|
|
@@ -1097,25 +1097,12 @@ const create$3$1 = () => {
|
|
|
1097
1097
|
const warn$1 = (...args) => {
|
|
1098
1098
|
console.warn(...args);
|
|
1099
1099
|
};
|
|
1100
|
-
const withResolvers$2 = () => {
|
|
1101
|
-
/**
|
|
1102
|
-
* @type {any}
|
|
1103
|
-
*/
|
|
1104
|
-
let _resolve;
|
|
1105
|
-
const promise = new Promise(resolve => {
|
|
1106
|
-
_resolve = resolve;
|
|
1107
|
-
});
|
|
1108
|
-
return {
|
|
1109
|
-
resolve: _resolve,
|
|
1110
|
-
promise
|
|
1111
|
-
};
|
|
1112
|
-
};
|
|
1113
1100
|
const registerPromise = () => {
|
|
1114
1101
|
const id = create$3$1();
|
|
1115
1102
|
const {
|
|
1116
1103
|
resolve,
|
|
1117
1104
|
promise
|
|
1118
|
-
} = withResolvers
|
|
1105
|
+
} = Promise.withResolvers();
|
|
1119
1106
|
set$5(id, resolve);
|
|
1120
1107
|
return {
|
|
1121
1108
|
id,
|
|
@@ -1281,7 +1268,7 @@ const unwrapJsonRpcResult = responseMessage => {
|
|
|
1281
1268
|
throw new JsonRpcError('unexpected response message');
|
|
1282
1269
|
};
|
|
1283
1270
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
1284
|
-
const
|
|
1271
|
+
const getErrorType = prettyError => {
|
|
1285
1272
|
if (prettyError && prettyError.type) {
|
|
1286
1273
|
return prettyError.type;
|
|
1287
1274
|
}
|
|
@@ -1304,7 +1291,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
1304
1291
|
data: {
|
|
1305
1292
|
stack: prettyError.stack,
|
|
1306
1293
|
codeFrame: prettyError.codeFrame,
|
|
1307
|
-
type:
|
|
1294
|
+
type: getErrorType(prettyError),
|
|
1308
1295
|
code: prettyError.code,
|
|
1309
1296
|
name: prettyError.name
|
|
1310
1297
|
}
|