elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
9.23k stars 198 forks source link

Please add custom validation type for `Decimal` #628

Open Hetch3t opened 2 months ago

Hetch3t commented 2 months ago

What is the problem this feature would solve?

Support very popular data type Decimal (decimal.js). Currently there is no way to do anything with it, since it's not built-in into TypeBox and Elysia as well.

What is the feature you are proposing to solve the problem?

Since Elysia already provides custom types it shouldn't be hard to add new custom validation type t.Decimal(). Also I believe it would be quite helpful, since, I believe, Decimals are used quite commonly.

What alternatives have you considered?

Custom implementation