diff --git a/components/WeaponSelector.tsx b/components/WeaponSelector.tsx index e3e424e95..ac74b7213 100644 --- a/components/WeaponSelector.tsx +++ b/components/WeaponSelector.tsx @@ -13,7 +13,10 @@ const WeaponSelector: React.FC = ({ name, value, onChange }) => { <> {(Object.keys(countries) as Array).map( (countryCode) => ( diff --git a/tsconfig.json b/tsconfig.json index a5efb59d1..6eada9173 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,8 @@ }, "ts-node": { "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "types": ["node"] } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], diff --git a/validators/Profile.ts b/validators/Profile.ts index 4d225c4ba..a1f9c3d9f 100644 --- a/validators/Profile.ts +++ b/validators/Profile.ts @@ -26,7 +26,8 @@ const profileRootSchema = z.object({ weaponPool: z .array(z.string()) .max(5) - .refine((arr) => arr.every((val) => weaponsWithHero.includes(val as any))), + .refine((arr) => arr.every((val) => weaponsWithHero.includes(val as any))) + .refine((arr) => new Set(arr).size === arr.length), }); export const profileSchemaFrontend = profileRootSchema.extend({ @@ -37,16 +38,16 @@ export const profileSchemaFrontend = profileRootSchema.extend({ export const profileSchemaBackend = profileRootSchema.extend({ sensMotion: z .number() - .min(-50) - .max(50) - .refine((val) => val % 5 === 0) + .min(-5) + .max(5) + .refine((val) => (val * 10) % 5 === 0) .optional() .nullable(), sensStick: z .number() .min(-50) .max(50) - .refine((val) => val % 5 === 0) + .refine((val) => (val * 10) % 5 === 0) .optional() .nullable(), });