# Improve line items descriptions ## Points 1. Get rid of regular expression in validation 2. Make more readable validation rules 3. Get possibility to add allowed locales ## Implementation ```typescript= const allowedChars = ['\\', ':', ]; const allowedLocales = ['en-US', 'fr-FR']; function checkLineItemDescriptionLanguage(value: string) { return allowedLocales .some(locale => isAlphanumeric(value, locale, allowedChars)); } ``` ## Helpful links - https://github.com/validatorjs/validator.js/blob/master/src/lib/isAlphanumeric.js#L4 - https://github.com/validatorjs/validator.js/blob/master/src/lib/alpha.js
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up