firebird-query
Advanced tools
Comparing version
@@ -61,3 +61,3 @@ "use strict"; | ||
}; | ||
const isSingleUndefinedValue = (obj) => Object.values(obj).length === 1 && Object.values(obj)[0] === undefined; | ||
const isSingleUndefinedValue = (obj) => (Object.values(obj).length === 1 && Object.values(obj)[0] === undefined); | ||
const defaultCondition = (clause) => clause === "AND" ? "1=1" : "1=0"; | ||
@@ -138,2 +138,5 @@ const isWhereObject = (val) => typeof val === "object" && !Array.isArray(val) && !(val instanceof Date); | ||
const param = params[i]; | ||
if (param === null) { | ||
return cur + node_firebird_1.default.escape(null); | ||
} | ||
if (isWhereObject(param)) { | ||
@@ -206,3 +209,3 @@ const conditions = param; | ||
const columnsStr = columns.join(", "); | ||
const escapedValues = columns.map((key) => escape(rowValues[key])); | ||
const escapedValues = columns.map((key) => node_firebird_1.default.escape(rowValues[key])); | ||
const valuesStr = escapedValues.join(", "); | ||
@@ -209,0 +212,0 @@ let query = `UPDATE OR INSERT INTO ${tableName} (${columnsStr}) VALUES (${valuesStr})`; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "node-firebird plugin for easy and safe query building.", | ||
@@ -8,0 +8,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
65046
0.35%1301
0.46%