tedious 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +1 -1
  2. package/lib/bulk-load.js +1 -1
  3. package/lib/connection.js +148 -131
  4. package/lib/data-type.js +79 -1669
  5. package/lib/data-types/bigint.js +46 -0
  6. package/lib/data-types/binary.js +57 -0
  7. package/lib/data-types/bit.js +38 -0
  8. package/lib/data-types/bitn.js +8 -0
  9. package/lib/data-types/char.js +72 -0
  10. package/lib/data-types/daten.js +48 -0
  11. package/lib/data-types/datetime.js +68 -0
  12. package/lib/data-types/datetime2n.js +105 -0
  13. package/lib/data-types/datetimen.js +8 -0
  14. package/lib/data-types/datetimeoffsetn.js +91 -0
  15. package/lib/data-types/decimal.js +88 -0
  16. package/lib/data-types/decimaln.js +10 -0
  17. package/lib/data-types/float.js +38 -0
  18. package/lib/data-types/floatn.js +8 -0
  19. package/lib/data-types/image.js +46 -0
  20. package/lib/data-types/int.js +41 -0
  21. package/lib/data-types/intn.js +8 -0
  22. package/lib/data-types/money.js +38 -0
  23. package/lib/data-types/moneyn.js +8 -0
  24. package/lib/data-types/nchar.js +72 -0
  25. package/lib/data-types/ntext.js +11 -0
  26. package/lib/data-types/null.js +7 -0
  27. package/lib/data-types/numeric.js +88 -0
  28. package/lib/data-types/numericn.js +10 -0
  29. package/lib/data-types/nvarchar.js +86 -0
  30. package/lib/data-types/real.js +38 -0
  31. package/lib/data-types/smalldatetime.js +60 -0
  32. package/lib/data-types/smallint.js +41 -0
  33. package/lib/data-types/smallmoney.js +41 -0
  34. package/lib/data-types/sql-variant.js +12 -0
  35. package/lib/data-types/text.js +51 -0
  36. package/lib/data-types/timen.js +95 -0
  37. package/lib/data-types/tinyint.js +41 -0
  38. package/lib/data-types/tvp.js +83 -0
  39. package/lib/data-types/udt.js +8 -0
  40. package/lib/data-types/uniqueidentifiern.js +46 -0
  41. package/lib/data-types/varbinary.js +77 -0
  42. package/lib/data-types/varchar.js +86 -0
  43. package/lib/data-types/xml.js +8 -0
  44. package/lib/instance-lookup.js +8 -7
  45. package/lib/message-io.js +1 -1
  46. package/lib/packet.js +2 -2
  47. package/lib/prelogin-payload.js +6 -6
  48. package/lib/request.js +8 -8
  49. package/lib/tracking-buffer/writable-tracking-buffer.js +29 -31
  50. package/package.json +1 -1
@@ -44,7 +44,7 @@ module.exports = function () {
44
44
  var length = buffer.length;
45
45
  this.makeRoomFor(length);
46
46
  buffer.copy(this.buffer, this.position);
47
- return this.position += length;
47
+ this.position += length;
48
48
  }
49
49
  }, {
50
50
  key: 'makeRoomFor',
@@ -55,9 +55,9 @@ module.exports = function () {
55
55
  while (size < requiredLength) {
56
56
  size *= 2;
57
57
  }
58
- return this.newBuffer(size);
58
+ this.newBuffer(size);
59
59
  } else {
60
- return this.newBuffer(requiredLength);
60
+ this.newBuffer(requiredLength);
61
61
  }
62
62
  }
63
63
  }
@@ -67,7 +67,7 @@ module.exports = function () {
67
67
  var buffer = this.buffer.slice(0, this.position);
68
68
  this.compositeBuffer = Buffer.concat([this.compositeBuffer, buffer]);
69
69
  this.buffer = size === 0 ? ZERO_LENGTH_BUFFER : new Buffer(size).fill(0);
70
- return this.position = 0;
70
+ this.position = 0;
71
71
  }
72
72
  }, {
73
73
  key: 'writeUInt8',
@@ -75,7 +75,7 @@ module.exports = function () {
75
75
  var length = 1;
76
76
  this.makeRoomFor(length);
77
77
  this.buffer.writeUInt8(value, this.position);
78
- return this.position += length;
78
+ this.position += length;
79
79
  }
80
80
  }, {
81
81
  key: 'writeUInt16LE',
@@ -83,12 +83,12 @@ module.exports = function () {
83
83
  var length = 2;
84
84
  this.makeRoomFor(length);
85
85
  this.buffer.writeUInt16LE(value, this.position);
86
- return this.position += length;
86
+ this.position += length;
87
87
  }
88
88
  }, {
89
89
  key: 'writeUShort',
90
90
  value: function writeUShort(value) {
91
- return this.writeUInt16LE(value);
91
+ this.writeUInt16LE(value);
92
92
  }
93
93
  }, {
94
94
  key: 'writeUInt16BE',
@@ -96,7 +96,7 @@ module.exports = function () {
96
96
  var length = 2;
97
97
  this.makeRoomFor(length);
98
98
  this.buffer.writeUInt16BE(value, this.position);
99
- return this.position += length;
99
+ this.position += length;
100
100
  }
101
101
  }, {
102
102
  key: 'writeUInt24LE',
@@ -106,7 +106,7 @@ module.exports = function () {
106
106
  this.buffer[this.position + 2] = value >>> 16 & 0xff;
107
107
  this.buffer[this.position + 1] = value >>> 8 & 0xff;
108
108
  this.buffer[this.position] = value & 0xff;
109
- return this.position += length;
109
+ this.position += length;
110
110
  }
111
111
  }, {
112
112
  key: 'writeUInt32LE',
@@ -114,13 +114,13 @@ module.exports = function () {
114
114
  var length = 4;
115
115
  this.makeRoomFor(length);
116
116
  this.buffer.writeUInt32LE(value, this.position);
117
- return this.position += length;
117
+ this.position += length;
118
118
  }
119
119
  }, {
120
120
  key: 'writeInt64LE',
121
121
  value: function writeInt64LE(value) {
122
122
  var buf = bigint.numberToInt64LE(value);
123
- return this.copyFrom(buf);
123
+ this.copyFrom(buf);
124
124
  }
125
125
  }, {
126
126
  key: 'writeUInt32BE',
@@ -128,20 +128,20 @@ module.exports = function () {
128
128
  var length = 4;
129
129
  this.makeRoomFor(length);
130
130
  this.buffer.writeUInt32BE(value, this.position);
131
- return this.position += length;
131
+ this.position += length;
132
132
  }
133
133
  }, {
134
134
  key: 'writeUInt40LE',
135
135
  value: function writeUInt40LE(value) {
136
136
  // inspired by https://github.com/dpw/node-buffer-more-ints
137
137
  this.writeInt32LE(value & -1);
138
- return this.writeUInt8(Math.floor(value * SHIFT_RIGHT_32));
138
+ this.writeUInt8(Math.floor(value * SHIFT_RIGHT_32));
139
139
  }
140
140
  }, {
141
141
  key: 'writeUInt64LE',
142
142
  value: function writeUInt64LE(value) {
143
143
  this.writeInt32LE(value & -1);
144
- return this.writeUInt32LE(Math.floor(value * SHIFT_RIGHT_32));
144
+ this.writeUInt32LE(Math.floor(value * SHIFT_RIGHT_32));
145
145
  }
146
146
  }, {
147
147
  key: 'writeInt8',
@@ -149,7 +149,7 @@ module.exports = function () {
149
149
  var length = 1;
150
150
  this.makeRoomFor(length);
151
151
  this.buffer.writeInt8(value, this.position);
152
- return this.position += length;
152
+ this.position += length;
153
153
  }
154
154
  }, {
155
155
  key: 'writeInt16LE',
@@ -157,7 +157,7 @@ module.exports = function () {
157
157
  var length = 2;
158
158
  this.makeRoomFor(length);
159
159
  this.buffer.writeInt16LE(value, this.position);
160
- return this.position += length;
160
+ this.position += length;
161
161
  }
162
162
  }, {
163
163
  key: 'writeInt16BE',
@@ -165,7 +165,7 @@ module.exports = function () {
165
165
  var length = 2;
166
166
  this.makeRoomFor(length);
167
167
  this.buffer.writeInt16BE(value, this.position);
168
- return this.position += length;
168
+ this.position += length;
169
169
  }
170
170
  }, {
171
171
  key: 'writeInt32LE',
@@ -173,7 +173,7 @@ module.exports = function () {
173
173
  var length = 4;
174
174
  this.makeRoomFor(length);
175
175
  this.buffer.writeInt32LE(value, this.position);
176
- return this.position += length;
176
+ this.position += length;
177
177
  }
178
178
  }, {
179
179
  key: 'writeInt32BE',
@@ -181,7 +181,7 @@ module.exports = function () {
181
181
  var length = 4;
182
182
  this.makeRoomFor(length);
183
183
  this.buffer.writeInt32BE(value, this.position);
184
- return this.position += length;
184
+ this.position += length;
185
185
  }
186
186
  }, {
187
187
  key: 'writeFloatLE',
@@ -189,7 +189,7 @@ module.exports = function () {
189
189
  var length = 4;
190
190
  this.makeRoomFor(length);
191
191
  this.buffer.writeFloatLE(value, this.position);
192
- return this.position += length;
192
+ this.position += length;
193
193
  }
194
194
  }, {
195
195
  key: 'writeDoubleLE',
@@ -197,7 +197,7 @@ module.exports = function () {
197
197
  var length = 8;
198
198
  this.makeRoomFor(length);
199
199
  this.buffer.writeDoubleLE(value, this.position);
200
- return this.position += length;
200
+ this.position += length;
201
201
  }
202
202
  }, {
203
203
  key: 'writeString',
@@ -210,22 +210,20 @@ module.exports = function () {
210
210
  this.makeRoomFor(length);
211
211
 
212
212
  // $FlowFixMe https://github.com/facebook/flow/pull/5398
213
- var bytesWritten = this.buffer.write(value, this.position, encoding);
213
+ this.buffer.write(value, this.position, encoding);
214
214
  this.position += length;
215
-
216
- return bytesWritten;
217
215
  }
218
216
  }, {
219
217
  key: 'writeBVarchar',
220
218
  value: function writeBVarchar(value, encoding) {
221
219
  this.writeUInt8(value.length);
222
- return this.writeString(value, encoding);
220
+ this.writeString(value, encoding);
223
221
  }
224
222
  }, {
225
223
  key: 'writeUsVarchar',
226
224
  value: function writeUsVarchar(value, encoding) {
227
225
  this.writeUInt16LE(value.length);
228
- return this.writeString(value, encoding);
226
+ this.writeString(value, encoding);
229
227
  }
230
228
 
231
229
  // TODO: Figure out what types are passed in other than `Buffer`
@@ -247,12 +245,12 @@ module.exports = function () {
247
245
  this.writeUInt16LE(length);
248
246
 
249
247
  if (value instanceof Buffer) {
250
- return this.writeBuffer(value);
248
+ this.writeBuffer(value);
251
249
  } else {
252
250
  this.makeRoomFor(length);
253
251
  // $FlowFixMe https://github.com/facebook/flow/pull/5398
254
252
  this.buffer.write(value, this.position, encoding);
255
- return this.position += length;
253
+ this.position += length;
256
254
  }
257
255
  }
258
256
  }, {
@@ -290,7 +288,7 @@ module.exports = function () {
290
288
  }
291
289
 
292
290
  // PLP_TERMINATOR (no more chunks).
293
- return this.writeUInt32LE(0);
291
+ this.writeUInt32LE(0);
294
292
  }
295
293
  }, {
296
294
  key: 'writeBuffer',
@@ -298,13 +296,13 @@ module.exports = function () {
298
296
  var length = value.length;
299
297
  this.makeRoomFor(length);
300
298
  value.copy(this.buffer, this.position);
301
- return this.position += length;
299
+ this.position += length;
302
300
  }
303
301
  }, {
304
302
  key: 'writeMoney',
305
303
  value: function writeMoney(value) {
306
304
  this.writeInt32LE(Math.floor(value * SHIFT_RIGHT_32));
307
- return this.writeInt32LE(value & -1);
305
+ this.writeInt32LE(value & -1);
308
306
  }
309
307
  }, {
310
308
  key: 'data',
package/package.json CHANGED
@@ -27,7 +27,7 @@
27
27
  "homepage": "https://github.com/tediousjs/tedious",
28
28
  "bugs": "https://github.com/tediousjs/tedious/issues",
29
29
  "license": "MIT",
30
- "version": "2.2.3",
30
+ "version": "2.2.4",
31
31
  "main": "./lib/tedious.js",
32
32
  "repository": {
33
33
  "type": "git",