Skip to content

Commit fc2d338

Browse files
committed
Fixed some tests and diagnostics checks
1 parent 537eee0 commit fc2d338

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
"@types/uuid": "^9.0.8",
190190
"@typescript-eslint/eslint-plugin": "^6.21.0",
191191
"@typescript-eslint/parser": "^6.21.0",
192-
"@valibot/i18n": "^0.16.0",
192+
"@valibot/i18n": "^1.0.0-beta.1",
193193
"decimal.js": "^10.4.3",
194194
"eslint": "^8.57.1",
195195
"eslint-config-prettier": "^9.1.0",

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/(v2)/v2/Navigation.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
'issue-500',
7575
'typebox',
7676
'transport',
77-
'bigint'
77+
'bigint',
78+
'issue-455'
7879
].sort();
7980
</script>
8081

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import i18next from 'i18next';
22
import { z } from 'zod';
3-
import { zodI18nMap } from 'zod-i18n-map';
4-
import translation from 'zod-i18n-map/locales/es/zod.json';
3+
// @ts-expect-error Need to use .mjs, explanation: https://stackoverflow.com/a/77108389/70894
4+
import { zodI18nMap } from 'zod-i18n-map/dist/index.mjs';
5+
import translation from 'zod-i18n-map/locales/es/zod.json?raw';
56

67
i18next.init({
78
lng: 'es',
89
resources: {
9-
es: { zod: translation }
10+
es: { zod: JSON.parse(translation) }
1011
}
1112
});
1213
z.setErrorMap(zodI18nMap);
@@ -16,7 +17,9 @@ export const schema = z.object({
1617
email: z.string().email()
1718
});
1819

20+
/*
1921
const data = schema.safeParse({ name: '', email: '' });
2022
if (!data.success) {
2123
console.dir(data.error.flatten(), { depth: 10 }); //debug
2224
}
25+
*/

src/tests/superValidate.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,11 +1491,11 @@ describe('Customized superValidate', () => {
14911491
type ZodSchema = Parameters<typeof zod>[0];
14921492

14931493
function zodValidate<T extends ZodSchema, M>(
1494-
data: SuperParams<InferIn<T>>[0],
1494+
data: SuperParams<InferIn<T, 'zod'>>[0],
14951495
schema: T,
1496-
options?: SuperParams<Infer<T>>[2]
1496+
options?: SuperParams<Infer<T, 'zod'>>[2]
14971497
) {
1498-
return superValidate<Infer<T>, M, InferIn<T>>(data, zod(schema), options);
1498+
return superValidate<Infer<T, 'zod'>, M, InferIn<T, 'zod'>>(data, zod(schema), options);
14991499
}
15001500

15011501
const zodSchema = z.object({

0 commit comments

Comments
 (0)