function stripUrlQueryAndFragment(urlPath) {
    // eslint-disable-next-line no-useless-escape
    return urlPath.split(/[\?#]/, 1)[0];
}
Strip the query string and fragment off of a given URL or path (if present)

@param urlPath Full URL or path, including possible query string and/or fragment
@returns URL or path without query string or fragment