export default function URLJS(url, baseURL, parseQuery) {
    if (url != undefined) {
        let _url = parseUrl.call(URLJS, url, undefined, parseQuery);
        if (_url !== false) return _url;
        if (baseURL) {
            _url = baseURL instanceof URLJS ? baseURL : parseUrl.call(URLJS, baseURL);
            if (_url === false) return;
            url = String(url);
            if (url.slice(0, 2) == '//') {
                return parseUrl.call(URLJS, _url.protocol + url, undefined, parseQuery);
            }
            let _path;
            if (url.slice(0, 1) == '/') {
                _path = url;
            }
            else {
                _path = _url.pathname.split('/');
                _path[_path.length - 1] = url;
                _path = _path.join('/');
            }
            return parseUrl.call(URLJS, _url.origin + _path, undefined, parseQuery);
        }
        throw new SyntaxError(`Failed to construct 'URL': Invalid URL`);
    }
}
The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.