Skip to content

Add boolean flag to Joi.string().trim() #1525

Closed
@rokoroku

Description

@rokoroku

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 ?

Are you ready to work on a pull request if your suggestion is accepted ?

👌

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions