function merge_relative_paths(base_path, new_path) {
    // handle both roots merger case
    if (base_path == '/' && new_path == '/') return '/';

    // Inject leading slash to new_path
    if (!new_path.startsWith('/')) new_path = '/' + new_path;

    // handle base root merger case
    if (base_path == '/') return new_path;

    // handle new path root merger case
    if (new_path == '/') return base_path;

    // strip away leading slash from base path
    if (base_path.endsWith('/')) base_path = base_path.substr(0, base_path.length - 1);

    // Merge path and add a slash in between if new_path does not have a starting slash
    return `${base_path}${new_path}`;
}
Merges provided relative paths into a singular relative path.

@param {String} base_path
@param {String} new_path
@returns {String} path