Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BauerPh authored Oct 14, 2023
1 parent ccbcbc7 commit 62c5066
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,19 @@ class Connection extends EventEmitter {
};
if (typeof sql === 'object') {
// execute(options, cb)
options = {
...options,
sql: sql.sql,
values: sql.values
};
// check if sql-template-tag or sql-template-string lib
if (!sql.hasOwnProperty('sql') && 'sql' in sql) {

Check failure on line 624 in lib/connection.js

View workflow job for this annotation

GitHub Actions / lint-js

Do not access Object.prototype method 'hasOwnProperty' from target object
options = {
...options,
sql: sql.sql,
values: sql.values,
};
} else {
options = {
...options,
...sql,
};
}
if (typeof values === 'function') {
cb = values;
} else {
Expand Down Expand Up @@ -910,11 +918,19 @@ class Connection extends EventEmitter {
};
if (typeof sql === 'object') {
// query(options, cb)
options = {
...options,
sql: sql.sql,
values: sql.values
};
// check if sql-template-tag or sql-template-string lib
if (!sql.hasOwnProperty('sql') && 'sql' in sql) {

Check failure on line 922 in lib/connection.js

View workflow job for this annotation

GitHub Actions / lint-js

Do not access Object.prototype method 'hasOwnProperty' from target object
options = {
...options,
sql: sql.sql,
values: sql.values,
};
} else {
options = {
...options,
...sql,
};
}
if (typeof values === 'function') {
cb = values;
} else if (values !== undefined) {
Expand Down

0 comments on commit 62c5066

Please sign in to comment.