coveo.analytics 2.27.4 → 2.27.6

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.
@@ -377,7 +377,7 @@
377
377
  };
378
378
  HistoryStore.prototype.getMostRecentElement = function () {
379
379
  var currentHistory = this.getHistoryWithInternalTime();
380
- if (currentHistory != null) {
380
+ if (Array.isArray(currentHistory)) {
381
381
  var sorted = currentHistory.sort(function (first, second) {
382
382
  return (second.internalTime || 0) - (first.internalTime || 0);
383
383
  });
@@ -399,10 +399,13 @@
399
399
  return true;
400
400
  };
401
401
  HistoryStore.prototype.stripInternalTime = function (history) {
402
- return history.map(function (part) {
403
- var name = part.name, time = part.time, value = part.value;
404
- return { name: name, time: time, value: value };
405
- });
402
+ if (Array.isArray(history)) {
403
+ return history.map(function (part) {
404
+ var name = part.name, time = part.time, value = part.value;
405
+ return { name: name, time: time, value: value };
406
+ });
407
+ }
408
+ return [];
406
409
  };
407
410
  HistoryStore.prototype.stripEmptyQuery = function (part) {
408
411
  var name = part.name, time = part.time, value = part.value;
@@ -725,7 +728,7 @@
725
728
  const v5 = v35('v5', 0x50, sha1);
726
729
  var uuidv5 = v5;
727
730
 
728
- var libVersion = "2.27.4" ;
731
+ var libVersion = "2.27.6" ;
729
732
 
730
733
  var getFormattedLocation = function (location) {
731
734
  return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);