Comparing version 0.0.22 to 0.0.23
@@ -0,1 +1,3 @@ | ||
var util = require("util"); | ||
exports.escapeId = function () { | ||
@@ -27,2 +29,5 @@ return Array.prototype.slice.apply(arguments).map(function (el) { | ||
} | ||
if (util.isDate(val)) { | ||
return "'" + JSON.stringify(val).substr(1, 24) + "'"; | ||
} | ||
switch (typeof val) { | ||
@@ -29,0 +34,0 @@ case "number": |
@@ -40,3 +40,3 @@ exports.build = function (Dialect, where) { | ||
for (var k in where.w) { | ||
if (!where.w[k]) { | ||
if (where.w[k] === null || where.w[k] === undefined) { | ||
query.push( | ||
@@ -43,0 +43,0 @@ buildComparisonKey(Dialect, where.t, k) + |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"license": "MIT", | ||
@@ -12,0 +12,0 @@ "repository": { |
@@ -20,2 +20,32 @@ var common = require('../common'); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: 0 }).build(), | ||
"SELECT * FROM `table1` WHERE `col` = 0" | ||
); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: null }).build(), | ||
"SELECT * FROM `table1` WHERE `col` IS NULL" | ||
); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: undefined }).build(), | ||
"SELECT * FROM `table1` WHERE `col` IS NULL" | ||
); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: false }).build(), | ||
"SELECT * FROM `table1` WHERE `col` = false" | ||
); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: "" }).build(), | ||
"SELECT * FROM `table1` WHERE `col` = ''" | ||
); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: true }).build(), | ||
"SELECT * FROM `table1` WHERE `col` = true" | ||
); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: 'a' }).build(), | ||
@@ -22,0 +52,0 @@ "SELECT * FROM `table1` WHERE `col` = 'a'" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35238
1220