Comparing version 0.1.2 to 0.1.3
@@ -0,1 +1,3 @@ | ||
var util = require("util"); | ||
exports.escapeId = function () { | ||
@@ -21,13 +23,2 @@ return Array.prototype.slice.apply(arguments).map(function (el) { | ||
switch (typeof val) { | ||
case 'boolean': | ||
return (val) ? 'true' : 'false'; | ||
case 'number': | ||
return val + ''; | ||
} | ||
if (val instanceof Date) { | ||
val = dateToString(val, timeZone || "Z"); | ||
} | ||
if (Buffer.isBuffer(val)) { | ||
@@ -41,4 +32,15 @@ return bufferToString(val); | ||
if (typeof val === 'object') { | ||
return objectToValues(val, timeZone || "Z"); | ||
if (util.isDate(val)) { | ||
val = dateToString(val, timeZone || "Z"); | ||
} else { | ||
switch (typeof val) { | ||
case 'boolean': | ||
return (val) ? 'true' : 'false'; | ||
case 'number': | ||
return val + ''; | ||
case "object": | ||
return objectToValues(val, timeZone || "Z"); | ||
case "function": | ||
return val(exports); | ||
} | ||
} | ||
@@ -45,0 +47,0 @@ |
@@ -29,8 +29,11 @@ var util = require("util"); | ||
} | ||
if (util.isDate(val)) { | ||
return "'" + JSON.stringify(val).substr(1, 24) + "'"; | ||
} | ||
if (Buffer.isBuffer(val)) { | ||
return "'\\x" + val.toString("hex") + "'"; | ||
} | ||
switch (typeof val) { | ||
@@ -41,2 +44,4 @@ case "number": | ||
return val ? "true" : "false"; | ||
case "function": | ||
return val(exports); | ||
} | ||
@@ -43,0 +48,0 @@ // No need to escape backslashes with default PostgreSQL 9.1+ config. |
@@ -16,8 +16,11 @@ var util = require("util"); | ||
} | ||
if (util.isDate(val)) { | ||
return "'" + JSON.stringify(val).substr(1, 24) + "'"; | ||
} | ||
if (Buffer.isBuffer(val)) { | ||
return "X'" + val.toString("hex") + "'"; | ||
} | ||
switch (typeof val) { | ||
@@ -28,3 +31,6 @@ case "number": | ||
return val ? "true" : "false"; | ||
case "function": | ||
return val(exports); | ||
} | ||
// No need to escape backslashes with default PostgreSQL 9.1+ config. | ||
@@ -31,0 +37,0 @@ // Google 'postgresql standard_conforming_strings' for details. |
@@ -221,2 +221,7 @@ var Where = require("./Where"); | ||
if (typeof sql.from[i].select[j] == "function") { | ||
tmp.push(sql.from[i].select[j](Dialect)); | ||
continue; | ||
} | ||
if (!sql.from[i].select[j].f) continue; | ||
@@ -223,0 +228,0 @@ |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"license": "MIT", | ||
@@ -12,0 +12,0 @@ "repository": { |
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
40511
34
1390