release v2.0.0 #4
|
@ -8,7 +8,7 @@ import { AxiosError } from 'axios';
|
||||||
*/
|
*/
|
||||||
export function isAxiosError(error: unknown, status?: number) {
|
export function isAxiosError(error: unknown, status?: number) {
|
||||||
// Check if it is an axios error (with axios 1.0 `error instanceof AxiosError` will be possible)
|
// Check if it is an axios error (with axios 1.0 `error instanceof AxiosError` will be possible)
|
||||||
if (!error || typeof error !== 'object' || !('isAxiosError' in <object>error)) return false;
|
if (typeof error !== 'object' || !error || !('isAxiosError' in error)) return false;
|
||||||
// Check status code if status was given
|
// Check status code if status was given
|
||||||
if (status !== undefined)
|
if (status !== undefined)
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue