Closed danneu closed 9 years ago
If I want to ensure a parameter is 0-100 chars long with .isLength(0, 100), isn't this line messing that up?
.isLength(0, 100)
https://github.com/RocksonZeta/koa-validate/blob/0a95252b119babb97623268f97b424e2e5c43a3d/lib/validate.js#L123
Example: this.checkBody('markup').trim().isLength(0, 100) will always trigger isLength error when { markup: '' }. optional() didn't change anything.
this.checkBody('markup').trim().isLength(0, 100)
optional()
this problem has fixed in 0.2.7,and I add a test case, thanks a lot!
If I want to ensure a parameter is 0-100 chars long with
.isLength(0, 100)
, isn't this line messing that up?https://github.com/RocksonZeta/koa-validate/blob/0a95252b119babb97623268f97b424e2e5c43a3d/lib/validate.js#L123
Example:
this.checkBody('markup').trim().isLength(0, 100)
will always trigger isLength error when { markup: '' }.optional()
didn't change anything.