stuff
This commit is contained in:
parent
bc92231240
commit
b8225c639e
11904 changed files with 1472749 additions and 133 deletions
21
node_modules/mdurl/lib/format.mjs
generated
vendored
Normal file
21
node_modules/mdurl/lib/format.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
export default function format (url) {
|
||||
let 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
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue