解读joi.not(joi.ref(‘oldPwd‘)).concat(password) 规则

解读joi.not(joi.ref(‘oldPwd’)).concat(password) 规则

<script>
    // 1. joi.ref('oldPwd') 表示 newPwd 的值必须和 oldPwd 的值保持一致
    // 2. joi.not(joi.ref('oldPwd')) 表示 newPwd 的值不能等于 oldPwd 的值
    // 3. .concat() 用于合并 joi.not(joi.ref('oldPwd')) 和 password 这两条验证规则
    newPwd: joi.not(joi.ref('oldPwd')).concat(password),
script>

你可能感兴趣的:(node.js,node.js)