valibot
valibot copied to clipboard
Create getMetadata/getTitle/getDescription methods
Loops through schema (including nested pipes) to shallowly merge metadata objects.
const schema = v.pipe(
v.string(),
v.title('title'),
v.email(),
v.description('description'),
v.metadata({ key: 'value' }),
v.pipe(v.string(), v.metadata({ extra: 'extra' }))
);
expect(v.getTitle(schema)).toBe('title')
expect(v.getDescription(schema)).toBe('description')
expect(v.getMetadata(schema)).toStrictEqual({
key: 'value',
extra: 'extra',
});
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| valibot | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 6, 2025 4:02am |
As a general feedback. I would not put the metadata method folders in a new folder /metadata folder and put them directly in the /methods folder.
My goal is to finalize and merge this PR tomorrow or Tuesday and release these methods with Valibot v1.1 in the next few days. If it takes us longer than that, I will have to reschedule it for Valibot v1.2.
Website builds locally, I have no visibility on what's upsetting Vercel 🤔
Don't worry. I will make sure everything is ok before merging. Thank you for updating the PR! I will probably merge it on the weekend and publish it with Valibot v1.1.
I started to review this PR and will probably merge it tomorrow. Please don't modify it.
Next, I will review the docs and merge the PR.
Valibot v1.1.0 is available!