From 09defce511609b00ba74fcdabc82dd917a47e935 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 30 Apr 2018 17:10:01 -0700 Subject: [PATCH] Stricter number parsing when unpacking query --- lib/query.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/query.coffee b/lib/query.coffee index 74a0963..e67923f 100644 --- a/lib/query.coffee +++ b/lib/query.coffee @@ -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