react-instantsearch-core
Advanced tools
Comparing version 6.27.0 to 6.28.0
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.default = void 0; | ||
var _default = '6.27.0'; | ||
var _default = '6.28.0'; | ||
exports.default = _default; |
@@ -24,17 +24,21 @@ "use strict"; | ||
function getAttribute(component) { | ||
if ((0, _typeof2.default)(component) !== 'object') { | ||
function isReactElement(element) { | ||
return (0, _typeof2.default)(element) === 'object' && element.props; | ||
} | ||
function getAttribute(element) { | ||
if (!isReactElement(element)) { | ||
return undefined; | ||
} | ||
if (component.props.attribute) { | ||
return component.props.attribute; | ||
if (element.props.attribute) { | ||
return element.props.attribute; | ||
} | ||
if (Array.isArray(component.props.attributes)) { | ||
return component.props.attributes[0]; | ||
if (Array.isArray(element.props.attributes)) { | ||
return element.props.attributes[0]; | ||
} | ||
if (component.props.children) { | ||
return getAttribute(_react.default.Children.only(component.props.children)); | ||
if (element.props.children) { | ||
return getAttribute(_react.default.Children.only(element.props.children)); | ||
} | ||
@@ -41,0 +45,0 @@ |
@@ -1,1 +0,1 @@ | ||
export default '6.27.0'; | ||
export default '6.28.0'; |
@@ -6,17 +6,21 @@ import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
function getAttribute(component) { | ||
if (_typeof(component) !== 'object') { | ||
function isReactElement(element) { | ||
return _typeof(element) === 'object' && element.props; | ||
} | ||
function getAttribute(element) { | ||
if (!isReactElement(element)) { | ||
return undefined; | ||
} | ||
if (component.props.attribute) { | ||
return component.props.attribute; | ||
if (element.props.attribute) { | ||
return element.props.attribute; | ||
} | ||
if (Array.isArray(component.props.attributes)) { | ||
return component.props.attributes[0]; | ||
if (Array.isArray(element.props.attributes)) { | ||
return element.props.attributes[0]; | ||
} | ||
if (component.props.children) { | ||
return getAttribute(React.Children.only(component.props.children)); | ||
if (element.props.children) { | ||
return getAttribute(React.Children.only(element.props.children)); | ||
} | ||
@@ -23,0 +27,0 @@ |
{ | ||
"name": "react-instantsearch-core", | ||
"version": "6.27.0", | ||
"version": "6.28.0", | ||
"description": "⚡ Lightning-fast search for React, by Algolia", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2257189
21261