Apologies for omitting the standard questionnaire it's largely irrelevant. This is using version 1.15.0 of the driver.
The driver currently has the FileAndStageBindStatement methods hasNext and NextResult typed incorrectly, as functions that return functions. This is minor, but generates (for example) a linting warning like "Unnecessary conditional, value is always truthy." when attempting to call .hasNext().
For example, the following code shows a linting error:
const connection = snowflake.createConnection({ account: '' });
connection.execute({
sqlText: 'select 1',
complete(err, stmt, rows) {
console.log(rows);
// typescript-eslint will flag the `stmt.hasNext()` with `Unnecessary conditional, value is always truthy.`
if ('hasNext' in stmt && stmt.hasNext()) {
stmt.NextResult();
}
},
});
and instead expects to see stmt.hasNext()().
The issue seems to be here where the definitions have an extra set of parentheses. For validation, the source here returns a function, the result of which is assigned to this.hasNext.
Apologies for omitting the standard questionnaire it's largely irrelevant. This is using version 1.15.0 of the driver.
The driver currently has the
FileAndStageBindStatement
methodshasNext
andNextResult
typed incorrectly, as functions that return functions. This is minor, but generates (for example) a linting warning like "Unnecessary conditional, value is always truthy." when attempting to call.hasNext()
.For example, the following code shows a linting error:
and instead expects to see
stmt.hasNext()()
.The issue seems to be here where the definitions have an extra set of parentheses. For validation, the source here returns a function, the result of which is assigned to
this.hasNext
.