2023-09-05 11:29:23 +10:00
|
|
|
export const isErrorCode = (code: unknown): code is ErrorCode => {
|
|
|
|
|
return typeof code === 'string' && code in ErrorCode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
|
|
|
|
|
|
|
|
export const ErrorCode = {
|
|
|
|
|
INCORRECT_EMAIL_PASSWORD: 'INCORRECT_EMAIL_PASSWORD',
|
|
|
|
|
USER_MISSING_PASSWORD: 'USER_MISSING_PASSWORD',
|
|
|
|
|
CREDENTIALS_NOT_FOUND: 'CREDENTIALS_NOT_FOUND',
|
2023-08-27 07:10:41 +05:30
|
|
|
} as const;
|