wingbot 3.38.0-alpha.4 → 3.38.0-alpha.5

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.4",
3
+ "version": "3.38.0-alpha.5",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -88,11 +88,13 @@ const ARRAY_LENGTH_OPERATORS = [
88
88
  const compare = (variable, operator, value = undefined) => {
89
89
  const isArrayLengthCompare = ARRAY_LENGTH_OPERATORS.includes(operator);
90
90
  if (Array.isArray(variable) && !isArrayLengthCompare) {
91
- if (operator === ConditionOperators['==']
91
+ if ((operator === ConditionOperators['=='] || operator === ConditionOperators['!='])
92
92
  && (typeof value === 'number' || isStringNumber(value))) {
93
93
 
94
94
  const numeric = toNumber(value);
95
- return numeric === variable.length;
95
+ return operator === ConditionOperators['==']
96
+ ? numeric === variable.length
97
+ : numeric !== variable.length;
96
98
  }
97
99
 
98
100
  if (operator === ConditionOperators['not contains']) {
@@ -175,9 +175,9 @@ function getSetState (setState, req, res = null, useState = null, configuration
175
175
  values = [];
176
176
  } else {
177
177
  const useValue = typeof value === 'string'
178
- ? handlebars.compile(value)(state)
179
- .split(/(?<!\\),/g)
180
- .map((v) => v.replace(/\\,/g, ',').trim())
178
+ ? handlebars.compile(value.replace(/(?<!\\),/g, '#-S-2-@#').replace(/\\,/g, ','))(state)
179
+ .split(/#-S-2-@#/g)
180
+ .map((v) => v.trim())
181
181
  : value;
182
182
  values = toArray(useValue);
183
183
  }