@miso.ai/client-sdk-dev-tool 1.3.0 → 1.3.2
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/es/debug.js +19 -4
- package/package.json +2 -3
package/dist/es/debug.js
CHANGED
|
@@ -8,7 +8,17 @@ const _log = function (path, name) {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
return console.log(TAG, STYLE, _path(path), _name(name), ...data);
|
|
11
|
-
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function _logw(path, name, data) {
|
|
14
|
+
if (data === undefined) {
|
|
15
|
+
_log(path, name);
|
|
16
|
+
} else if (Array.isArray(data)) {
|
|
17
|
+
_log(path, name, ...data.map(_wrapObj));
|
|
18
|
+
} else {
|
|
19
|
+
_log(path, name, _wrapObj(data));
|
|
20
|
+
}
|
|
21
|
+
} // format path
|
|
12
22
|
|
|
13
23
|
|
|
14
24
|
function _path(path) {
|
|
@@ -20,6 +30,11 @@ function _name(name) {
|
|
|
20
30
|
return "[".concat(name, "]");
|
|
21
31
|
}
|
|
22
32
|
|
|
33
|
+
function _wrapObj(value) {
|
|
34
|
+
const type = typeof value;
|
|
35
|
+
return type === 'function' || type === 'object' && !Array.isArray(value) ? [value] : value;
|
|
36
|
+
}
|
|
37
|
+
|
|
23
38
|
export default class DebugPlugin {
|
|
24
39
|
constructor() {
|
|
25
40
|
this._log = console.log.bind(console, TAG, STYLE);
|
|
@@ -85,11 +100,11 @@ export default class DebugPlugin {
|
|
|
85
100
|
return;
|
|
86
101
|
}
|
|
87
102
|
|
|
88
|
-
|
|
103
|
+
_logw(path.join('.'), name, data);
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
_handleCreateClient(eventName, data) {
|
|
92
|
-
|
|
107
|
+
_logw('client', eventName, data);
|
|
93
108
|
}
|
|
94
109
|
|
|
95
110
|
_handleApiEvent(eventName, _ref2) {
|
|
@@ -125,7 +140,7 @@ export default class DebugPlugin {
|
|
|
125
140
|
}
|
|
126
141
|
|
|
127
142
|
_handlePluginSpecificEvent(pluginId, path, name, data) {
|
|
128
|
-
|
|
143
|
+
_logw([pluginId, path.join('.')], name, data);
|
|
129
144
|
}
|
|
130
145
|
|
|
131
146
|
_getPath(component) {
|
package/package.json
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"start": "npx babel src --root-mode upward --out-dir dist/es --watch",
|
|
14
|
-
"test": "echo later",
|
|
15
14
|
"build:clean": "npx rimraf dist",
|
|
16
15
|
"build:esm": "npx babel src --root-mode upward --out-dir dist/es",
|
|
17
16
|
"build": "npm run build:clean && npm run build:esm"
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
"url": "https://github.com/MisoAI/miso-client-js-sdk/issues"
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
|
-
"@miso.ai/commons": "1.3.
|
|
28
|
+
"@miso.ai/commons": "1.3.2"
|
|
30
29
|
},
|
|
31
|
-
"version": "1.3.
|
|
30
|
+
"version": "1.3.2"
|
|
32
31
|
}
|