mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
fix(parser): Only assign null values if placeholders were found
This commit is contained in:
1 parent
00f9d0449c
commit
9d8a29388c
1 file changed
+4
-1
+4
-1
@@ -34,7 +34,10 @@ const parseParameters = (query, parameters) => {
|
||||
const obj = parameters.length !== 0 ? parameters : (() => {
|
||||
let obj = {};
|
||||
const [_, paramNames] = convertNamedPlaceholders.parse(query);
|
||||
for (let i = 0; i < paramNames.length; i++) obj[paramNames[i]] = null;
|
||||
if (paramNames) {
|
||||
for (let i = 0; i < paramNames.length; i++)
|
||||
obj[paramNames[i]] = null;
|
||||
}
|
||||
return obj;
|
||||
})();
|
||||
|
||||
|
||||
Reference in new issue
Block a user