I am using library to parse urls on my page:
import * as urlParse from 'url-parse';
const parseUrl = url => {
try {
return urlParse(url);
} catch (e) {
return null;
}
};
The issue is when the url 'www.stackoverflow.com' is passed to the function, parseUrl returns http:localhost\www.stackoverflow.com
should I use to obtain the value http://www.stackoverflow.com?
'www.stackoverflow.com'isn't a URL.parseUrlrecursively? This is an unending recursionURL(), that's how the library works.