Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function prefixStyle(style) {
for (const prop in style) {
const value = style[prop]
if (prop === 'fallbacks' && Array.isArray(value)) {
style[prop] = value.map(prefixStyle)
continue
}
let changeProp = false
const supportedProp = vendor.supportedProperty(prop)
if (supportedProp && supportedProp !== prop) changeProp = true
let changeValue = false
const supportedValue = vendor.supportedValue(supportedProp, toCssValue(value))
if (supportedValue && supportedValue !== value) changeValue = true
if (changeProp || changeValue) {
if (changeProp) delete style[prop]
style[supportedProp || prop] = supportedValue || value
}
}
return style
}
function onChangeValue(value, prop) {
return vendor.supportedValue(prop, toCssValue(value)) || value
}