Eomm / fastify-raw-body

Request raw body
MIT License
44 stars 10 forks source link

Add typings #11

Closed cyyynthia closed 3 years ago

cyyynthia commented 3 years ago

The typings are super simple but just what's needed: types the options the plugin takes and adds the rawBody property to the FastifyRequest interface (it doesn't take into account the field configuration flag, but there's no way of doing this unfortunately; people who want to use a custom field will have to type it on their own as well).

Closes #6

cyyynthia commented 3 years ago

I've added a few tests as requested; as of the FastifyPlugin vs FastifyPluginCallback, as I mentioned it's marked as deprecated, and is most likely a remain of previous Fastify versions where the Plugin type was a simple union.