@algolia/autocomplete-core 1.9.2 → 1.9.3

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.
@@ -1,4 +1,4 @@
1
- var regex = /((gt|sm)-|galaxy nexus)|samsung[- ]/i;
1
+ var regex = /((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;
2
2
  export function isSamsung(userAgent) {
3
3
  return Boolean(userAgent && userAgent.match(regex));
4
4
  }
@@ -1,28 +1,10 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  export function mapToAlgoliaResponse(rawResults) {
8
- var results = rawResults.map(function (result) {
9
- var _hits;
10
- return _objectSpread(_objectSpread({}, result), {}, {
11
- hits: (_hits = result.hits) === null || _hits === void 0 ? void 0 : _hits.map(function (hit) {
12
- // Bring support for the Insights plugin.
13
- return _objectSpread(_objectSpread({}, hit), {}, {
14
- __autocomplete_indexName: result.index,
15
- __autocomplete_queryID: result.queryID
16
- });
17
- })
18
- });
19
- });
20
2
  return {
21
- results: results,
22
- hits: results.map(function (result) {
3
+ results: rawResults,
4
+ hits: rawResults.map(function (result) {
23
5
  return result.hits;
24
6
  }).filter(Boolean),
25
- facetHits: results.map(function (result) {
7
+ facetHits: rawResults.map(function (result) {
26
8
  var _facetHits;
27
9
  return (_facetHits = result.facetHits) === null || _facetHits === void 0 ? void 0 : _facetHits.map(function (facetHit) {
28
10
  // Bring support for the highlighting components.
@@ -1,4 +1,4 @@
1
- /*! @algolia/autocomplete-core 1.9.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1
+ /*! @algolia/autocomplete-core 1.9.3 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -291,7 +291,7 @@
291
291
  return undefined;
292
292
  }
293
293
 
294
- var version = '1.9.2';
294
+ var version = '1.9.3';
295
295
 
296
296
  var userAgents = [{
297
297
  segment: 'autocomplete-core',
@@ -1248,30 +1248,18 @@
1248
1248
  return parent === child || parent.contains(child);
1249
1249
  }
1250
1250
 
1251
- var regex = /((gt|sm)-|galaxy nexus)|samsung[- ]/i;
1251
+ var regex = /((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;
1252
1252
  function isSamsung(userAgent) {
1253
1253
  return Boolean(userAgent && userAgent.match(regex));
1254
1254
  }
1255
1255
 
1256
1256
  function mapToAlgoliaResponse(rawResults) {
1257
- var results = rawResults.map(function (result) {
1258
- var _hits;
1259
- return _objectSpread2(_objectSpread2({}, result), {}, {
1260
- hits: (_hits = result.hits) === null || _hits === void 0 ? void 0 : _hits.map(function (hit) {
1261
- // Bring support for the Insights plugin.
1262
- return _objectSpread2(_objectSpread2({}, hit), {}, {
1263
- __autocomplete_indexName: result.index,
1264
- __autocomplete_queryID: result.queryID
1265
- });
1266
- })
1267
- });
1268
- });
1269
1257
  return {
1270
- results: results,
1271
- hits: results.map(function (result) {
1258
+ results: rawResults,
1259
+ hits: rawResults.map(function (result) {
1272
1260
  return result.hits;
1273
1261
  }).filter(Boolean),
1274
- facetHits: results.map(function (result) {
1262
+ facetHits: rawResults.map(function (result) {
1275
1263
  var _facetHits;
1276
1264
  return (_facetHits = result.facetHits) === null || _facetHits === void 0 ? void 0 : _facetHits.map(function (facetHit) {
1277
1265
  // Bring support for the highlighting components.