Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
}
})
export default function rehydrateCache(renderer: DOMRenderer): void {
if (renderer.enableRehydration) {
arrayEach(document.querySelectorAll('[data-fela-type]'), node => {
const type = node.getAttribute('data-fela-type') || ''
const media = node.getAttribute('media') || ''
const css = node.textContent
const handler = rehydrationHandlers[type]
if (handler) {
handler(renderer, css, media)
}
})
}
}