12345678910111213141516171819202122232425262728293031323334 |
- "use strict";
- module.exports = function (url, options) {
- if (!options) {
-
- options = {};
- }
- url = url && url.__esModule ? url.default : url;
- if (typeof url !== 'string') {
- return url;
- }
- if (/^['"].*['"]$/.test(url)) {
-
- url = url.slice(1, -1);
- }
- if (options.hash) {
-
- url += options.hash;
- }
-
- if (/["'() \t\n]/.test(url) || options.needQuotes) {
- return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, '\\n'), "\"");
- }
- return url;
- };
|