decord/source/__polyfill/14xxx/module_14488.js
github-actions 4f02868c60 chore: update source for alpha 346.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
2026-09-11 10:30:06 +00:00

21 lines
502 B
JavaScript

// Module ID: 14488
// Function ID: 14489
// Dependencies: []
// Exports: getHostFromUrl
// Module 14488
export const getHostFromUrl = function getHostFromUrl(scriptURL) {
const match = scriptURL.match(/^(?:https?:\/\/)?(\[[^\]]+\]|[^/:\s]+)(?::\d+)?(?:[/?#]|$)/);
let tmp2;
if (match != null) {
tmp2 = match[1];
}
if (typeof tmp2 !== "string") {
const _Error = Error;
const error = new Error("Invalid URL - host not found");
throw error;
} else {
return tmp2;
}
};