Comparing version 5.2.0 to 5.2.1
@@ -9,3 +9,3 @@ /// <reference types="react" /> | ||
} | ||
export default function enhanceProps(props: EnhancerProps & React.ComponentPropsWithoutRef<any>, selectorHead?: string): EnhancedPropsResult; | ||
export default function enhanceProps(props: EnhancerProps & React.ComponentPropsWithoutRef<any>, selectorHead?: string, parentProperty?: string): EnhancedPropsResult; | ||
export {}; |
@@ -17,6 +17,4 @@ "use strict"; | ||
const styles = __importStar(require("./styles")); | ||
function noAnd(s) { | ||
return s.replace(/&/g, ''); | ||
} | ||
function enhanceProps(props, selectorHead = '') { | ||
const SELECTORS_PROP = 'selectors'; | ||
function enhanceProps(props, selectorHead = '', parentProperty = '') { | ||
const propsMap = expand_aliases_1.default(props); | ||
@@ -26,5 +24,6 @@ const preservedProps = {}; | ||
for (const [property, value] of propsMap) { | ||
if (value && typeof value === 'object') { | ||
const isSelectorOrChildProp = property === SELECTORS_PROP || parentProperty === SELECTORS_PROP; | ||
if (isObject(value) && isSelectorOrChildProp) { | ||
const prop = property === 'selectors' ? '' : property; | ||
const parsed = enhanceProps(value, noAnd(selectorHead + prop)); | ||
const parsed = enhanceProps(value, noAnd(selectorHead + prop), property); | ||
className = `${className} ${parsed.className}`; | ||
@@ -57,1 +56,3 @@ continue; | ||
exports.default = enhanceProps; | ||
const isObject = (value) => value != null && typeof value === 'object'; | ||
const noAnd = (value) => value.replace(/&/g, ''); |
{ | ||
"name": "ui-box", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "Blazing Fast React UI Primitive", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
108110
2323
0