Some checks failed
Test and deploy staging / staging (push) Failing after 1m39s
17 lines
405 B
TypeScript
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
|
|
};
|
|
}
|