Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function extend(
style: Object,
type: StyleType,
renderer: DOMRenderer | NativeRenderer
): Object {
objectEach(style, (value, property) => {
if (property === 'extend') {
const extensions = [].concat(value)
arrayEach(extensions, extension =>
extendStyle(style, extension, extend, renderer)
)
delete style[property]
} else if (isObject(value)) {
// support nested extend as well
style[property] = extend(value, type, renderer)
}
})
return style
}