mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
fix(parser): Check if query is string type not undefined
- Should fix issues when exports is wrong called with `.` instead of `:`
This commit is contained in:
1 parent
4913d6e50a
commit
5d6ca06f49
1 file changed
+2
-1
+2
-1
@@ -26,7 +26,8 @@ const parseTypes = (field, next) => {
|
||||
};
|
||||
|
||||
const parseParameters = (query, parameters) => {
|
||||
if (query === undefined) throw new FormatError(`Undefined query passed`);
|
||||
if (typeof query !== 'string')
|
||||
throw new Error(`Non-string query passed. Make sure you use "oxmysql:execute" instead of "oxmysql.execute" when calling exports.`);
|
||||
|
||||
if (!parameters || typeof parameters === 'function') return [query, []];
|
||||
|
||||
|
||||
Reference in new issue
Block a user