Skip to content

Commit

Permalink
fix: update typing for Yup err msg fn
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-anderson committed Mar 24, 2024
1 parent 7101fed commit fac9fc5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/localization/setupYup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setLocale } from "yup";
import { setLocale, type Message } from "yup";

setLocale({
mixed: {
Expand All @@ -8,4 +8,10 @@ setLocale({
min: "Must be at least ${min} characters long",
max: "Must be fewer than ${max} characters",
},
});
} as const satisfies Record<
string, // "mixed" | "string"
Record<
string, // "required", "min", "max"
Message<{ [key: string]: unknown }> // <-- overrides Message default type param `any`
>
>);

0 comments on commit fac9fc5

Please sign in to comment.