Files
website/src/lib/server/osu-profile.ts
Stan Runge eca43c82d0
Some checks failed
Test and deploy staging / staging (push) Failing after 1m39s
fix zod imports in bun test build
2026-09-23 04:47:27 +00:00

17 lines
405 B
TypeScript

import * as z from 'zod';
const profileSchema = z.object({
id: z.number().int().positive(),
username: z.string().min(1),
avatar_url: z.string().url()
});
export function osuProfile(value: unknown) {
const profile = profileSchema.parse(value);
return {
id: String(profile.id),
name: profile.username,
image: profile.avatar_url,
email: `${profile.id}@osu.invalid`,
emailVerified: false
};
}