fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖
https://valibot.dev
MIT License
6k stars 186 forks source link

[suggestion]: mimeType wildcard support #668

Open HugeLetters opened 3 months ago

HugeLetters commented 3 months ago

The way it works currently if you specify expected mimeType as something like image/* - it will not match anything really.

While it would require a more heavy check perhaps if others would also like to see this it would be worthwhile addition. It could be created as a separate action like mimeTypeLoose to still allow previous behavior.

fabian-hiller commented 3 months ago

This has been requested in the past. Honestly, I think most people don't want to accept "any" image, and it's safer to actually specify all the images you want to accept. However, I will think about adding wildcard support in the future.

HugeLetters commented 3 months ago

Yeah, I get that if you really need it - it's really not that hard to implement yourself. So my suggestion only makes sense if that's something community would want as whole