Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 173a6b5

Browse files
authored
Merge pull request #5 from Interactive3G/master
Fix in factory.len when there is no max value
2 parents e363261 + 2aab810 commit 173a6b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/resty/validation.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ end
205205
function factory.len(min, max)
206206
if max then
207207
if max < min then min, max = max, min end
208+
else
209+
max = min
208210
end
209211
return function(value)
210212
local t = type(value)

0 commit comments

Comments
 (0)