mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-28 03:25:55 +08:00
Merge pull request #946 from rluvaton/patch-5
docs: convert var to const
This commit is contained in:
@ -11,7 +11,7 @@ Defensive programming is an approach to improve software and source code, in ter
|
|||||||
### Code example: validating complex JSON input using ‘Joi’
|
### Code example: validating complex JSON input using ‘Joi’
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var memberSchema = Joi.object().keys({
|
const memberSchema = Joi.object().keys({
|
||||||
password: Joi.string().regex(/^[a-zA-Z0-9]{3,30}$/),
|
password: Joi.string().regex(/^[a-zA-Z0-9]{3,30}$/),
|
||||||
birthyear: Joi.number().integer().min(1900).max(2013),
|
birthyear: Joi.number().integer().min(1900).max(2013),
|
||||||
email: Joi.string().email()
|
email: Joi.string().email()
|
||||||
|
|||||||
Reference in New Issue
Block a user