chore(http-client): check if length is zero

This commit is contained in:
Sarah Vaupel 2021-08-24 14:43:34 +02:00
parent 8d0241e727
commit dc0d141cd6

View File

@ -21,7 +21,7 @@ export class HttpClient {
if (typeof interceptor !== 'function') {
throw new Error(`Cannot remove Interceptor ${interceptor}, because it is not of type function`);
}
if(this._responseInterceptors.filter(el => el == interceptor).length !== 1) {
if(this._responseInterceptors.filter(el => el == interceptor).length === 0) {
throw new Error(`Could not find Response Interceptor ${interceptor}.`);
}
this._responseInterceptors = this._responseInterceptors.filter(el => el !== interceptor);