UNPKG

webappengine

Version:

A web application server that can host multiple web apps running with Node.js.

13 lines (10 loc) 287 B
const normalize = (str) => str .replace(/[\/]+/g, '/') .replace(/\/\?/g, '?') .replace(/\/#/g, '#') .replace(/:\//g, '://'); const urljoin = function(...args) { let joined = [].slice.call(args, 0).join('/'); return normalize(joined); }; export default urljoin;