Closed
Description
Describe the problem you are trying to fix (provide as much context as possible)
const baseStringSchema = Joi.string().trim();
const keepWhitespaceSchema = baseStringSchema.trim(false);
This is needed because I want to trim every string by default, but allow sometimes.
Which API (or modification of the current API) do you suggest to solve that problem ?
string.trim()
- Just adding
enabled?: boolean
option to the existingtrim()
implementation will solve above problem, like the existingstring.truncate([enabled])
method.
Are you ready to work on a pull request if your suggestion is accepted ?
👌