Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function prefixValue(value: string, propertyPrefixMap: Object): string {
if (isPrefixedValue(value)) {
return value
}
// only split multi values, not cubic beziers
const multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g)
for (let i = 0, len = multipleValues.length; i < len; ++i) {
const singleValue = multipleValues[i]
const values = [singleValue]
for (const property in propertyPrefixMap) {
const dashCaseProperty = hyphenateProperty(property)
if (
singleValue.indexOf(dashCaseProperty) > -1 &&
dashCaseProperty !== 'order'
) {
export default function gradient(property: string, value: any): ?Array {
if (
typeof value === 'string' &&
!isPrefixedValue(value) &&
values.test(value)
) {
return prefixes.map(prefix => value.replace(values, grad => prefix + grad))
}
}
export default function calc(property: string, value: any): ?Array {
if (
typeof value === 'string' &&
!isPrefixedValue(value) &&
value.indexOf('calc(') > -1
) {
return prefixes.map(prefix => value.replace(/calc\(/g, `${prefix}calc(`))
}
}
export default function filter(property: string, value: any): ?Array {
if (
typeof value === 'string' &&
!isPrefixedValue(value) &&
value.indexOf('filter(') > -1
) {
return prefixes.map(prefix =>
value.replace(/filter\(/g, `${prefix}filter(`)
)
}
}
export default function imageSet(property: string, value: any): ?Array {
if (
typeof value === 'string' &&
!isPrefixedValue(value) &&
value.indexOf('image-set(') > -1
) {
return prefixes.map(prefix =>
value.replace(/image-set\(/g, `${prefix}image-set(`)
)
}
}
export default function crossFade(
property: string,
value: any
): ?Array {
if (
typeof value === 'string' &&
!isPrefixedValue(value) &&
value.indexOf('cross-fade(') > -1
) {
return prefixes.map(prefix =>
value.replace(/cross-fade\(/g, `${prefix}cross-fade(`)
)
}
}