module.exports=functionescape(url){if(typeofurl!=='string'){returnurl}// If url is already wrapped in quotes, remove themif(/^['"].*['"]$/.test(url)){url=url.slice(1,-1);}// Should url be wrapped?// See https://drafts.csswg.org/css-values-3/#urlsif(/["'() \t\n]/.test(url)){return'"'+url.replace(/"/g,'\\"').replace(/\n/g,'\\n')+'"'}returnurl}