Skip to content

Commit

Permalink
Code style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksimek committed Jul 4, 2018
1 parent 3a5d176 commit f8b3a4b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
28 changes: 14 additions & 14 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const IDS = new WeakMap()
const INCREMENT = {
Connection: 1,
ConnectionPool: 1,
Request: 1,
Transaction: 1,
PreparedStatement: 1
Connection: 1,
ConnectionPool: 1,
Request: 1,
Transaction: 1,
PreparedStatement: 1
}

module.exports = {
INCREMENT: INCREMENT,
IDS: {
get: IDS.get.bind(IDS),
add: (object, type, id) => {
if (id) return IDS.set(object, id)
IDS.set(object, INCREMENT[type]++)
}
}
}
INCREMENT: INCREMENT,
IDS: {
get: IDS.get.bind(IDS),
add: (object, type, id) => {
if (id) return IDS.set(object, id)
IDS.set(object, INCREMENT[type]++)
}
}
}
2 changes: 1 addition & 1 deletion test/common/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports = (sql, driver) => {
class MSSQLTestType extends sql.Table {
constructor () {
super('dbo.MSSQLTestType')

this.columns.add('a', sql.VarChar(50))
this.columns.add('b', sql.Int)
}
Expand Down
9 changes: 9 additions & 0 deletions test/tedious/tedious.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ describe('tedious', () => {
it('new Table', done => TESTS['new Table'](done))
it('Recordset.toTable()', done => TESTS['Recordset.toTable()'](done))

class MSSQLTestType extends sql.Table {
constructor () {
super('dbo.MSSQLTestType')

this.columns.add('a', sql.VarChar(50))
this.columns.add('b', sql.Int)
}
}

it.skip('query (todo)', function (done) {
let tvp = new MSSQLTestType()
tvp.rows.add('asdf', 15)
Expand Down

0 comments on commit f8b3a4b

Please sign in to comment.