forked from enviPath/enviPy
Current Dev State
This commit is contained in:
25
static/js/ketcher2/node_modules/mdurl/format.js
generated
vendored
Normal file
25
static/js/ketcher2/node_modules/mdurl/format.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
module.exports = function format(url) {
|
||||
var result = '';
|
||||
|
||||
result += url.protocol || '';
|
||||
result += url.slashes ? '//' : '';
|
||||
result += url.auth ? url.auth + '@' : '';
|
||||
|
||||
if (url.hostname && url.hostname.indexOf(':') !== -1) {
|
||||
// ipv6 address
|
||||
result += '[' + url.hostname + ']';
|
||||
} else {
|
||||
result += url.hostname || '';
|
||||
}
|
||||
|
||||
result += url.port ? ':' + url.port : '';
|
||||
result += url.pathname || '';
|
||||
result += url.search || '';
|
||||
result += url.hash || '';
|
||||
|
||||
return result;
|
||||
};
|
||||
Reference in New Issue
Block a user