export function isDuplicateUsernameError(error: unknown): boolean {
  if (!error || typeof error !== 'object') {
    return false;
  }

  const message = 'message' in error && typeof error.message === 'string'
    ? error.message
    : '';

  return message.includes('UNIQUE constraint failed: users.username');
}
