wingbot 3.43.0 → 3.43.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.43.0",
3
+ "version": "3.43.1",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Ai.js CHANGED
@@ -49,6 +49,8 @@ let uq = 1;
49
49
  /** @typedef {import('./wingbot/CustomEntityDetectionModel').EntityDetector} EntityDetector */
50
50
  /** @typedef {import('./wingbot/CustomEntityDetectionModel').DetectorOptions} DetectorOptions */
51
51
 
52
+ /** @typedef {[string,EntityDetector|RegExp,DetectorOptions]} DetectorArgs */
53
+
52
54
  /**
53
55
  * @class Ai
54
56
  */
@@ -63,7 +65,7 @@ class Ai {
63
65
 
64
66
  /**
65
67
  * @private
66
- * @type {Map<string,[string,EntityDetector|RegExp,DetectorOptions]>}
68
+ * @type {Map<string,DetectorArgs>}
67
69
  */
68
70
  this._detectors = new Map(
69
71
  systemEntities.map((a) => [a[0], a])
@@ -40,6 +40,13 @@ function getVoiceControlFromParams (params, lang = null) {
40
40
  }
41
41
  });
42
42
 
43
+ // remove empty values ("")
44
+ Object.keys(voiceControl).forEach((key) => {
45
+ if (voiceControl[key] === '') {
46
+ delete voiceControl[key];
47
+ }
48
+ });
49
+
43
50
  // if voiceControl is empty, return null
44
51
  return Object.keys(voiceControl).length > 0 ? voiceControl : null;
45
52
  }