UNPKG

530 BJavaScriptView Raw
1"use strict";
2
3module.exports = function (url, options) {
4 if (!options) {
5 // eslint-disable-next-line no-param-reassign
6 options = {};
7 }
8
9 if (!url) {
10 return url;
11 } // eslint-disable-next-line no-underscore-dangle, no-param-reassign
12
13
14 url = String(url.__esModule ? url.default : url);
15
16 if (options.hash) {
17 // eslint-disable-next-line no-param-reassign
18 url += options.hash;
19 }
20
21 if (options.maybeNeedQuotes && /[\t\n\f\r "'=<>`]/.test(url)) {
22 return "\"".concat(url, "\"");
23 }
24
25 return url;
26};
\No newline at end of file