botium-core 1.14.4 → 1.14.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.
@@ -77,7 +77,7 @@ var express__default = /*#__PURE__*/_interopDefaultLegacy(express);
77
77
  var bodyParser__default = /*#__PURE__*/_interopDefaultLegacy(bodyParser);
78
78
 
79
79
  var name = "botium-core";
80
- var version$1 = "1.14.4";
80
+ var version$1 = "1.14.5";
81
81
  var description = "The Selenium for Chatbots";
82
82
  var main = "index.js";
83
83
  var module$1 = "dist/botium-es.js";
@@ -1821,7 +1821,7 @@ const linesToConvoStep$5 = (lines, sender, context, eol, singleLineMode = false)
1821
1821
  if (eol === null) {
1822
1822
  throw new Error('eol cant be null');
1823
1823
  }
1824
- convoStep.messageText = textLines.join(eol).replace(WHITE_SPACES_EXCEPT_SPACE_CHAR_AT_THE_END, '');
1824
+ convoStep.messageText = trimExceptSpaceEnd$1(textLines.join(eol));
1825
1825
  }
1826
1826
  }
1827
1827
  } else {
@@ -1842,6 +1842,9 @@ const linesToConvoStep$5 = (lines, sender, context, eol, singleLineMode = false)
1842
1842
  }
1843
1843
  return convoStep;
1844
1844
  };
1845
+ const trimExceptSpaceEnd$1 = string => {
1846
+ return string?.replace(WHITE_SPACES_EXCEPT_SPACE_CHAR_AT_THE_END, '');
1847
+ };
1845
1848
  const convoStepToObject$1 = step => {
1846
1849
  const result = [];
1847
1850
  if (step.sender === 'me') {
@@ -2171,7 +2174,8 @@ var helper = {
2171
2174
  validateConvo: validateConvo$2,
2172
2175
  linesToScriptingMemories: linesToScriptingMemories$2,
2173
2176
  calculateWer: calculateWer$2,
2174
- toPercent: toPercent$1
2177
+ toPercent: toPercent$1,
2178
+ trimExceptSpaceEnd: trimExceptSpaceEnd$1
2175
2179
  };
2176
2180
 
2177
2181
  const BotiumError$4 = class BotiumError extends Error {
@@ -4867,7 +4871,8 @@ const {
4867
4871
  convoStepToLines,
4868
4872
  validateConvo,
4869
4873
  validSenders: validSenders$2,
4870
- linesToScriptingMemories: linesToScriptingMemories$1
4874
+ linesToScriptingMemories: linesToScriptingMemories$1,
4875
+ trimExceptSpaceEnd
4871
4876
  } = helper;
4872
4877
  var CompilerTxt_1 = class CompilerTxt extends CompilerBase_1 {
4873
4878
  constructor(context, caps = {}) {
@@ -4967,8 +4972,8 @@ var CompilerTxt_1 = class CompilerTxt extends CompilerBase_1 {
4967
4972
  _compileUtterances(lines) {
4968
4973
  if (lines && lines.length > 0) {
4969
4974
  const result = [new Utterance_1({
4970
- name: lines[0],
4971
- utterances: lines.length > 1 ? lines.slice(1) : []
4975
+ name: lines[0].trim(),
4976
+ utterances: lines.length > 1 ? lines.slice(1).map(line => trimExceptSpaceEnd(line)) : []
4972
4977
  })];
4973
4978
  this.context.AddUtterances(result);
4974
4979
  return result;
@@ -6939,18 +6944,19 @@ var ScriptingProvider_1 = class ScriptingProvider {
6939
6944
  }
6940
6945
  if (utterances) {
6941
6946
  lodash__default["default"].forEach(utterances, utt => {
6942
- const eu = this.utterances[utt.name];
6947
+ const uttName = utt.name?.trim();
6948
+ const eu = this.utterances[uttName];
6943
6949
  if (eu) {
6944
6950
  eu.utterances = lodash__default["default"].uniq(lodash__default["default"].concat(eu.utterances, utt.utterances));
6945
6951
  } else {
6946
- this.utterances[utt.name] = utt;
6952
+ this.utterances[uttName] = utt;
6947
6953
  }
6948
6954
  const {
6949
6955
  ambiguous,
6950
6956
  expected
6951
- } = findAmbiguous(this.utterances[utt.name].utterances);
6957
+ } = findAmbiguous(this.utterances[uttName].utterances);
6952
6958
  if (ambiguous && ambiguous.length > 0) {
6953
- debug$9(`Ambigous utterance "${utt.name}", expecting exact ${expected.length ? '"' + expected.join(', ') + '"' : '<none>'} scripting memory variables in following user examples: ${ambiguous.map(d => `"${d}"`).join(', ')}`);
6959
+ debug$9(`Ambigous utterance "${uttName}", expecting exact ${expected.length ? '"' + expected.join(', ') + '"' : '<none>'} scripting memory variables in following user examples: ${ambiguous.map(d => `"${d}"`).join(', ')}`);
6954
6960
  }
6955
6961
  });
6956
6962
  }