elysiajs / elysia

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

no `base64` in `t.String()` `format` option. Also no type support for the `byte` option. #660

Open touhidurrr opened 1 month ago

touhidurrr commented 1 month ago

What version of Elysia.JS is running?

1.0.22

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

try this:

app.guard(
      {
        type: 'text',
        body: t.String({
          format: 'byte', // no typesupport
        }),
      },

What is the expected behavior?

typesupport for byte and add base64

What do you see instead?

No type support for byte in format option also not sure why base64 is renamed as byte. https://github.com/elysiajs/elysia/blob/da63011c213158853e129d9668c1bb95f908c7d1/src/formats.ts#L73-L74

Additional information

Upon further observation, I can see that many other types are also missing. Here is the list:

  1. iso-time
  2. iso-date-time
  3. duration
  4. url
  5. json-pointer-uri-fragment
  6. byte
  7. int32
  8. int64
  9. float
  10. double
  11. password

Here are the types I can see:

image image