react-instantsearch-core 6.27.0 → 6.28.0

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.
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '6.27.0';
7
+ var _default = '6.28.0';
8
8
  exports.default = _default;
@@ -21,21 +21,25 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
23
 
24
- function getAttribute(component) {
25
- if ((0, _typeof2.default)(component) !== 'object') {
24
+ function isReactElement(element) {
25
+ return (0, _typeof2.default)(element) === 'object' && element.props;
26
+ }
27
+
28
+ function getAttribute(element) {
29
+ if (!isReactElement(element)) {
26
30
  return undefined;
27
31
  }
28
32
 
29
- if (component.props.attribute) {
30
- return component.props.attribute;
33
+ if (element.props.attribute) {
34
+ return element.props.attribute;
31
35
  }
32
36
 
33
- if (Array.isArray(component.props.attributes)) {
34
- return component.props.attributes[0];
37
+ if (Array.isArray(element.props.attributes)) {
38
+ return element.props.attributes[0];
35
39
  }
36
40
 
37
- if (component.props.children) {
38
- return getAttribute(_react.default.Children.only(component.props.children));
41
+ if (element.props.children) {
42
+ return getAttribute(_react.default.Children.only(element.props.children));
39
43
  }
40
44
 
41
45
  return undefined;
@@ -1 +1 @@
1
- export default '6.27.0';
1
+ export default '6.28.0';
@@ -3,21 +3,25 @@ import React, { Fragment } from 'react';
3
3
  import { getDisplayName } from "../core/utils.js";
4
4
  import connectDynamicWidgets from "../connectors/connectDynamicWidgets.js";
5
5
 
6
- function getAttribute(component) {
7
- if (_typeof(component) !== 'object') {
6
+ function isReactElement(element) {
7
+ return _typeof(element) === 'object' && element.props;
8
+ }
9
+
10
+ function getAttribute(element) {
11
+ if (!isReactElement(element)) {
8
12
  return undefined;
9
13
  }
10
14
 
11
- if (component.props.attribute) {
12
- return component.props.attribute;
15
+ if (element.props.attribute) {
16
+ return element.props.attribute;
13
17
  }
14
18
 
15
- if (Array.isArray(component.props.attributes)) {
16
- return component.props.attributes[0];
19
+ if (Array.isArray(element.props.attributes)) {
20
+ return element.props.attributes[0];
17
21
  }
18
22
 
19
- if (component.props.children) {
20
- return getAttribute(React.Children.only(component.props.children));
23
+ if (element.props.children) {
24
+ return getAttribute(React.Children.only(element.props.children));
21
25
  }
22
26
 
23
27
  return undefined;
@@ -1,4 +1,4 @@
1
- /*! React InstantSearchCore 6.27.0 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */
1
+ /*! React InstantSearchCore 6.28.0 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
@@ -848,7 +848,7 @@
848
848
  });
849
849
  }
850
850
 
851
- var version = '6.27.0';
851
+ var version = '6.28.0';
852
852
 
853
853
  function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
854
854
 
@@ -7054,21 +7054,25 @@
7054
7054
  }
7055
7055
  });
7056
7056
 
7057
- function getAttribute(component) {
7058
- if (_typeof(component) !== 'object') {
7057
+ function isReactElement(element) {
7058
+ return _typeof(element) === 'object' && element.props;
7059
+ }
7060
+
7061
+ function getAttribute(element) {
7062
+ if (!isReactElement(element)) {
7059
7063
  return undefined;
7060
7064
  }
7061
7065
 
7062
- if (component.props.attribute) {
7063
- return component.props.attribute;
7066
+ if (element.props.attribute) {
7067
+ return element.props.attribute;
7064
7068
  }
7065
7069
 
7066
- if (Array.isArray(component.props.attributes)) {
7067
- return component.props.attributes[0];
7070
+ if (Array.isArray(element.props.attributes)) {
7071
+ return element.props.attributes[0];
7068
7072
  }
7069
7073
 
7070
- if (component.props.children) {
7071
- return getAttribute(React__default.Children.only(component.props.children));
7074
+ if (element.props.children) {
7075
+ return getAttribute(React__default.Children.only(element.props.children));
7072
7076
  }
7073
7077
 
7074
7078
  return undefined;