jsonsql
Advanced tools
Comparing version 0.1.1 to 0.2.1
15
index.js
@@ -0,1 +1,3 @@ | ||
var utils = require('./utils') | ||
var AND = '&&' | ||
@@ -28,9 +30,2 @@ , OR = '||' | ||
var print = console.log; | ||
function getObjectType(obj) { | ||
return Object.prototype.toString.call(obj); | ||
} | ||
function isDate(obj) { | ||
return getObjectType(obj) === '[object Date]'; | ||
} | ||
// ------------------ splitter -------------------- // | ||
@@ -198,5 +193,7 @@ | ||
} | ||
// support comparison for Date | ||
if(isDate(res)) res = res.valueOf() | ||
// support comparison for Date/DateString | ||
if(utils.isDate(res)) res = res.valueOf() | ||
else if(utils.isDateString(res)) res = utils.parseDateFromString(res) | ||
else res.toString(); | ||
return res | ||
@@ -203,0 +200,0 @@ } |
{ | ||
"name": "jsonsql", | ||
"version": "0.1.1", | ||
"version": "0.2.1", | ||
"description" : "A SQL-like query language for JSON objects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
21308
9
564