Stricter number parsing when unpacking query

This commit is contained in:
Zaid Abdulla committed 2018-04-30 17:10:01 -07:00
1 parent e6caa36aa0
commit 09defce511
1 file changed
+2 -3
+2 -3
View File
@@ -70,9 +70,8 @@ normalize = (input) ->
if (m = /^\/(.*?)\/(g?i?m?y?)$/.exec(input))
vals.push({'$regex' : new RegExp(m[1], m[2])})
f = parseFloat(input)
if not isNaN(f)
vals.push(f)
if +input == parseFloat(input)
vals.push(+input)
d = new Date(input)
if input.length >= 8 and d.getFullYear() > 1983