@lvce-editor/json-rpc 5.3.0 → 5.5.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.
Files changed (2) hide show
  1. package/dist/index.js +15 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -29,10 +29,6 @@ const create$3 = () => {
29
29
  return ++id;
30
30
  };
31
31
 
32
- const warn = (...args) => {
33
- console.warn(...args);
34
- };
35
-
36
32
  const registerPromise = () => {
37
33
  const id = create$3();
38
34
  const {
@@ -45,16 +41,6 @@ const registerPromise = () => {
45
41
  promise
46
42
  };
47
43
  };
48
- const resolve = (id, response) => {
49
- const fn = get(id);
50
- if (!fn) {
51
- console.log(response);
52
- warn(`callback ${id} may already be disposed`);
53
- return;
54
- }
55
- fn(response);
56
- remove(id);
57
- };
58
44
 
59
45
  const create$2 = (method, params) => {
60
46
  const {
@@ -221,6 +207,21 @@ const unwrapJsonRpcResult = responseMessage => {
221
207
  throw new JsonRpcError('unexpected response message');
222
208
  };
223
209
 
210
+ const warn = (...args) => {
211
+ console.warn(...args);
212
+ };
213
+
214
+ const resolve = (id, response) => {
215
+ const fn = get(id);
216
+ if (!fn) {
217
+ console.log(response);
218
+ warn(`callback ${id} may already be disposed`);
219
+ return;
220
+ }
221
+ fn(response);
222
+ remove(id);
223
+ };
224
+
224
225
  const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
225
226
 
226
227
  const getErrorType = prettyError => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/json-rpc",
3
- "version": "5.3.0",
3
+ "version": "5.5.0",
4
4
  "description": "JsonRpc implementation",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",