/********************************************************************************
 * Copyright (c) 2020 Contributors to the Eclipse Foundation
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 ********************************************************************************/
import {HttpErrorResponse} from "@angular/common/http";
import {EHttpStatusCodes} from "./EHttpStatusCodes";

export function isHttpErrorWithStatus(error: any, status?: EHttpStatusCodes): boolean {
    return error instanceof HttpErrorResponse && (status == null || error.status === status);
}

export function urlJoin(...args: string[]): string {
    let result = args.reduce((previous, current) => previous + "/" + current);
    const indexOfProtocolSlashes = result.indexOf("://");
    while (result.indexOf("//", indexOfProtocolSlashes === -1 ? undefined : indexOfProtocolSlashes + 3) > -1) {
        result = result.replace("//", "/");
    }
    return result;
}
