Since strip() is used only for sanitizing purposes, typesafe-joi can handle it just like forbidden(). So the type definitions of strip() and forbidden() can be same.
In this case,
But if we change type definitions of strip and make it behave like forbidden, generated type from PostUser will be
{
firstname: string;
}
which is more accurate.
P.S. I know that this project is not maintained, but please consider this enhancement. It will only take a mere minute to replace type definitions of strip() with same as forbidden()
Here is my proposal of enhancing Joi.strip()
Since strip() is used only for sanitizing purposes, typesafe-joi can handle it just like forbidden(). So the type definitions of strip() and forbidden() can be same. In this case,
generated type from PostUser is be
But if we change type definitions of strip and make it behave like forbidden, generated type from PostUser will be
which is more accurate.
P.S. I know that this project is not maintained, but please consider this enhancement. It will only take a mere minute to replace type definitions of strip() with same as forbidden()
Thanks!