ianstormtaylor / superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).

Home Page:https://docs.superstructjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible to validate data that is not present in the Struct?

notflip opened this issue · comments

I want to validate user input to be entered into the database, I like the simplicity of this library for validating that a certain value is present, however, can I validate that a value in the input is present that does not exist in the struct? Thank you

Hi @notflip, not sure if your question is still relevant given that you asked it about a year ago, but in case it is — what exactly are you trying to achieve?

Generally speaking, only stuff that is included in the struct definition is validated.

@arturmuller I don't even remember! A lot changes in a year, thanks for getting back to me and good luck with this repo.

Thank you! Indeed, time flies 😅