Normalize a URL.
URLs with custom protocols are not normalized and just passed through by default. Supported protocols are: https, http, file, and data.
https
http
file
data
Optional
import normalizeUrl from 'normalize-url';normalizeUrl('sindresorhus.com');//=> 'http://sindresorhus.com'normalizeUrl('//www.sindresorhus.com:80/../baz?b=bar&a=foo');//=> 'http://sindresorhus.com/baz?a=foo&b=bar' Copy
import normalizeUrl from 'normalize-url';normalizeUrl('sindresorhus.com');//=> 'http://sindresorhus.com'normalizeUrl('//www.sindresorhus.com:80/../baz?b=bar&a=foo');//=> 'http://sindresorhus.com/baz?a=foo&b=bar'
Normalize a URL.
URLs with custom protocols are not normalized and just passed through by default. Supported protocols are:
https
,http
,file
, anddata
.