chore(http-client): check if length is zero
This commit is contained in:
parent
8d0241e727
commit
dc0d141cd6
@ -21,7 +21,7 @@ export class HttpClient {
|
|||||||
if (typeof interceptor !== 'function') {
|
if (typeof interceptor !== 'function') {
|
||||||
throw new Error(`Cannot remove Interceptor ${interceptor}, because it is not of type 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}.`);
|
throw new Error(`Could not find Response Interceptor ${interceptor}.`);
|
||||||
}
|
}
|
||||||
this._responseInterceptors = this._responseInterceptors.filter(el => el !== interceptor);
|
this._responseInterceptors = this._responseInterceptors.filter(el => el !== interceptor);
|
||||||
|
|||||||
Reference in New Issue
Block a user