@coveo/atomic-react 3.11.19 → 3.11.20

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.
@@ -7133,7 +7133,7 @@ function getWindow$1() {
7133
7133
  }
7134
7134
  function getAtomicEnvironment(headlessVersion) {
7135
7135
  return {
7136
- version: "3.57.2",
7136
+ version: "3.57.3",
7137
7137
  headlessVersion
7138
7138
  };
7139
7139
  }
@@ -7188,16 +7188,28 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
7188
7188
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7189
7189
  function _typeof$2(o) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$2(o); }
7190
7190
  var UNSAFE_KEYS$1 = ['__proto__', 'constructor', 'prototype'];
7191
- function isSafeUrlSegment(v) {
7191
+ function isSafeUrlSegmentBase(v) {
7192
7192
  if (typeof v !== 'string') return false;
7193
7193
  if (v.length === 0 || v.length > 128) return false;
7194
7194
  if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
7195
7195
  if (v.indexOf('..') > -1) return false;
7196
- if (v.indexOf('/') > -1 || v.indexOf('\\') > -1) return false;
7196
+ if (v.indexOf('\\') > -1) return false;
7197
7197
  if (/[?#%\s@]/.test(v)) return false;
7198
7198
  if (/[\x00-\x1F\x7F]/.test(v)) return false;
7199
7199
  return true;
7200
7200
  }
7201
+ function isSafeLangUrlSegment(v) {
7202
+ if (!isSafeUrlSegmentBase(v)) return false;
7203
+ if (v.indexOf('/') > -1) return false;
7204
+ return true;
7205
+ }
7206
+ function isSafeNsUrlSegment(v) {
7207
+ return isSafeUrlSegmentBase(v);
7208
+ }
7209
+ var SAFETY_CHECK_BY_KEY = {
7210
+ lng: isSafeLangUrlSegment,
7211
+ ns: isSafeNsUrlSegment
7212
+ };
7201
7213
  function sanitizeLogValue(v) {
7202
7214
  if (typeof v !== 'string') return v;
7203
7215
  return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
@@ -7236,13 +7248,14 @@ function interpolateUrl(str, data) {
7236
7248
  if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
7237
7249
  var value = data[k];
7238
7250
  if (value == null) return match;
7251
+ var check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
7239
7252
  var segments = String(value).split('+');
7240
7253
  var _iterator = _createForOfIteratorHelper(segments),
7241
7254
  _step;
7242
7255
  try {
7243
7256
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
7244
7257
  var seg = _step.value;
7245
- if (!isSafeUrlSegment(seg)) {
7258
+ if (!check(seg)) {
7246
7259
  unsafe = true;
7247
7260
  return match;
7248
7261
  }