eligius 1.0.6 → 1.0.7

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.
@@ -9,6 +9,8 @@ import { v4 } from 'uuid';
9
9
  function prepareValueForSerialization(value) {
10
10
  if (Array.isArray(value)) {
11
11
  return value.map(prepareValueForSerialization);
12
+ } else if (value instanceof jQuery) {
13
+ return 'jQuery object';
12
14
  } else if (typeof value === 'object') {
13
15
  return Object.fromEntries(Object.entries(value).map(function (_ref) {
14
16
  var name = _ref[0],
@@ -16,7 +18,8 @@ function prepareValueForSerialization(value) {
16
18
  return [name, prepareValueForSerialization(value)];
17
19
  }));
18
20
  } else if (typeof value === 'function') {
19
- return value.toString();
21
+ var funcString = value.toString();
22
+ return funcString.substring(0, funcString.indexOf('{') + 1);
20
23
  }
21
24
 
22
25
  return value;
@@ -31,11 +34,19 @@ var DevToolEventListener = /*#__PURE__*/function () {
31
34
  var _proto = DevToolEventListener.prototype;
32
35
 
33
36
  _proto.handleEvent = function handleEvent(eventName, eventTopic, args) {
34
- this.agent.postMessage('eligius-diagnostics-event', {
37
+ var message = {
35
38
  eventName: eventName,
36
39
  eventTopic: eventTopic,
37
40
  args: prepareValueForSerialization(args)
38
- });
41
+ };
42
+
43
+ try {
44
+ this.agent.postMessage('eligius-diagnostics-event', message);
45
+ } catch (e) {
46
+ console.error('postmessage failed');
47
+ console.error(e);
48
+ console.log('message', message);
49
+ }
39
50
  };
40
51
 
41
52
  return DevToolEventListener;
@@ -2912,7 +2923,15 @@ var EngineFactory = /*#__PURE__*/function () {
2912
2923
  eventbus.registerEventlistener(eventbusListener);
2913
2924
 
2914
2925
  Diagnostics.send = function (name, data) {
2915
- agent.postMessage(name, data);
2926
+ var message = prepareValueForSerialization(data);
2927
+
2928
+ try {
2929
+ agent.postMessage(name, message);
2930
+ } catch (e) {
2931
+ console.error('postmessage failed');
2932
+ console.error(e);
2933
+ console.log('message', message);
2934
+ }
2916
2935
  };
2917
2936
 
2918
2937
  Diagnostics.send('eligius-diagnostics-factory', 'Diagnostics initialized');