Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* The split/join/trim logic is copied from rework-plugin-url to remove redundant quotes.
* Currently removed due to: https://github.com/reworkcss/rework-plugin-url/issues/7
*/
if (url.indexOf('data:') === 0) {
return `url("${url}")`
}
let formattedUrl = url
.split('"')
.join('')
.split('\'')
.join('')
.trim()
if (isFn(modify)) {
formattedUrl = modify(formattedUrl, filePath)
}
if (typeof prepend === 'string') {
formattedUrl = prepend + formattedUrl
}
if (typeof append === 'string') {
formattedUrl += append
}
return `url("${formattedUrl}")`
}
}, false))