1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 18:29:39 +02:00

Update node modules

This commit is contained in:
Daniel Neto 2024-10-27 13:39:07 -03:00
parent d429e6f7d8
commit c05a371397
1993 changed files with 9729 additions and 44041 deletions

View file

@ -7,11 +7,9 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = void 0;
var _urlToolkit = _interopRequireDefault(require("url-toolkit"));
var _window = _interopRequireDefault(require("global/window"));
var DEFAULT_LOCATION = 'http://example.com';
var DEFAULT_LOCATION = 'https://example.com';
var resolveUrl = function resolveUrl(baseUrl, relativeUrl) {
// return early if we don't need to resolve
@ -22,37 +20,25 @@ var resolveUrl = function resolveUrl(baseUrl, relativeUrl) {
if (/^data:/.test(baseUrl)) {
baseUrl = _window.default.location && _window.default.location.href || '';
} // IE11 supports URL but not the URL constructor
// feature detect the behavior we want
}
var nativeURL = typeof _window.default.URL === 'function';
var protocolLess = /^\/\//.test(baseUrl); // remove location if window.location isn't available (i.e. we're in node)
// and if baseUrl isn't an absolute url
var removeLocation = !_window.default.location && !/\/\//i.test(baseUrl); // if the base URL is relative then combine with the current location
if (nativeURL) {
baseUrl = new _window.default.URL(baseUrl, _window.default.location || DEFAULT_LOCATION);
} else if (!/\/\//i.test(baseUrl)) {
baseUrl = _urlToolkit.default.buildAbsoluteURL(_window.default.location && _window.default.location.href || '', baseUrl);
baseUrl = new _window.default.URL(baseUrl, _window.default.location || DEFAULT_LOCATION);
var newUrl = new URL(relativeUrl, baseUrl); // if we're a protocol-less url, remove the protocol
// and if we're location-less, remove the location
// otherwise, return the url unmodified
if (removeLocation) {
return newUrl.href.slice(DEFAULT_LOCATION.length);
} else if (protocolLess) {
return newUrl.href.slice(newUrl.protocol.length);
}
if (nativeURL) {
var newUrl = new URL(relativeUrl, baseUrl); // if we're a protocol-less url, remove the protocol
// and if we're location-less, remove the location
// otherwise, return the url unmodified
if (removeLocation) {
return newUrl.href.slice(DEFAULT_LOCATION.length);
} else if (protocolLess) {
return newUrl.href.slice(newUrl.protocol.length);
}
return newUrl.href;
}
return _urlToolkit.default.buildAbsoluteURL(baseUrl, relativeUrl);
return newUrl.href;
};
var _default = resolveUrl;