Skip to content

Commit

Permalink
fix(parser): Check if query is string type not undefined
Browse files Browse the repository at this point in the history
- Should fix issues when exports is wrong called with `.` instead of `:`
  • Loading branch information
dunak-debug authored Oct 24, 2021
1 parent 4913d6e commit 5d6ca06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, []];

Expand Down

0 comments on commit 5d6ca06

Please sign in to comment.