colinhacks / zod

TypeScript-first schema validation with static type inference
https://zod.dev
MIT License
34.3k stars 1.2k forks source link

String format request: xid #2639

Open redxtech opened 1 year ago

redxtech commented 1 year ago

In line with UUID, ULID, CUID, and CUID2, I think it would be great to add an additional format as well: xid.

It seems like it's fairly simple and well supported, and I'm looking to use it in a project that I use zod for, so support would be great.

Here's the source repo: https://github.com/rs/xid Here's a typescript implementation: https://github.com/yiwen-ai/xid-ts

I can start on a PR if that would be appreciated!

redxtech commented 1 year ago

I've opened a PR that implements this, hopefully it is all good!