wingbot 3.38.0-alpha.1 → 3.38.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.38.0-alpha.1",
3
+ "version": "3.38.0-alpha.2",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -119,11 +119,17 @@ const compare = (variable, operator, value = undefined) => {
119
119
  return isStringNumber(variable) ? !toNumber(variable) : !variable;
120
120
  case ConditionOperators.contains:
121
121
  if (typeof variable === 'string') {
122
- if (isSimpleWord(value)) return webalize(variable).includes(webalize(`${value}`));
123
- return variable.toLocaleLowerCase().includes(value.toString().toLocaleLowerCase());
122
+ if (isSimpleWord(value)) {
123
+ return webalize(variable).includes(webalize(`${value}`));
124
+ }
125
+ return variable.toLocaleLowerCase().includes(`${value}`.toLocaleLowerCase());
124
126
  }
125
127
 
126
- return variable.toString().includes(value.toString());
128
+ if (variable === null || variable === undefined) {
129
+ return ['null', 'undefined', ''].includes(`${value}`);
130
+ }
131
+
132
+ return `${variable}`.includes(`${value}`);
127
133
 
128
134
  case ConditionOperators['not contains']:
129
135
  return !compare(variable, ConditionOperators.contains, value);