import { AxiosError } from "axios";

export const isError = (error: unknown, code: string): boolean => {
	const axiosError = error as AxiosError<string>;

	if (!axiosError.response) {
		return false;
	}

	return code === axiosError.response.data;
};
