Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}) => props => {
const themeVariants = is(key) ? getThemeValue(props, key) : null
const computedVariants = merge(assign({}, variants), themeVariants)
const value = props[prop] !== undefined ? props[prop] : defaultValue
const result = getThemeValue(props, value, computedVariants)
warn(is(result), `variant "${value}" not found`)
return result
}
export function reduceBreakpoints(props, values, getStyle = identity, cache) {
const medias = cache ? getCachedMedias(props, cache) : getMedias(props)
let styles = {}
for (const breakpoint in values) {
const style = getStyle(values[breakpoint])
if (style === null) continue
const media = medias[breakpoint]
if (media === null) {
styles = merge(styles, style)
} else {
styles[media] = styles[media] ? assign(styles[media], style) : style
}
}
return styles
}