joi extension semver:Joi验证库的Semver扩展 源码
joi-extension-semver 验证库的Semver扩展 用法 const { semver , semverRange } = require ( 'joi-extension-semver' ) const Joi = require ( 'joi' ) . extend ( semver ) . extend ( semverRange ) Joi . attempt ( '1.2.3' , Joi . semver ( ) . valid ( ) ) // '1.2.3' Joi . attempt ( '>=1.2.3' , Joi . semverRange ( ) . valid ( ) ) // '>=1.2.3' Joi . attempt ( '1.2.3' , Joi . semver ( ) . gte ( '1.2.3' ) ) //
用户评论