Is this safe to use require(\"path\").join to concatenate URLs, for example:
require(\"path\").join
require(\"path\").join(\"http://example.com\", \"ok\"); //returns
If you use Angular, you can use Location:
import { Location } from '@angular/common'; // ... Location.joinWithSlash('beginning', 'end');
Works only on 2 arguments though, so you have to chain calls or write a helper function to do that if needed.