S
S
Stanislav2018-10-13 20:14:12
Node.js
Stanislav, 2018-10-13 20:14:12

How to clean up a line from unnecessary characters in the Joi scheme?

Is there such a possibility?
For example, in the diagram

name: Joi.string().min(20).max(120).error(new Error(message.name)),

You need to remove all characters except a-za-yayo0-9\-\,\.\:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladlen Hellsite, 2018-10-15
@ms-dred

name: Joi.string().min(20).max(120).replace(/[^a-zа-яё\d-,.:]/ig, '').error(new Error(message.name)),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question