Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const propValue = (props as any)[key]
return modValue === propValue || (modValue === '*' && Boolean(propValue))
})
if (isModifierMatched) {
const modifiers = modNames.reduce((acc: Dictionary, key: string) => {
if (mod[key] !== '*') acc[key] = mod[key]
return acc
}, {})
modifierClassName = modifierClassName || entity(modifiers)
const nextProps = Object.assign({}, props)
nextProps.className = classnames(modifierClassName, props.className)
// Replace first entityClassName for remove duplcates from className.
.replace(`${entityClassName} `, '')
if (enhance !== undefined) {
if (ModifiedComponent === undefined) {
ModifiedComponent = enhance(WrappedComponent as any)
if (__DEV__) {
setDisplayName(ModifiedComponent, {
wrapper: 'WithBemModEnhance',
wrapped: WrappedComponent,
})
}
}
} else {
ModifiedComponent = WrappedComponent as any