Skip to content

Commit 23ec839

Browse files
committed
Internal Code optimizations
1 parent 6391c39 commit 23ec839

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

lib/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class Connection extends EventEmitter {
206206
value instanceof Float64Array ||
207207
value instanceof Int8Array ||
208208
Buffer.isBuffer(value) ||
209-
util.isDate(value) ||
209+
util.types.isDate(value) ||
210210
value instanceof Lob ||
211211
value instanceof ResultSet ||
212212
value instanceof BaseDbObject

lib/impl/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class ConnectionImpl {
111111
// removed once Node-API version 5 is used in the C extension.
112112
// ---------------------------------------------------------------------------
113113
_isDate(val) {
114-
return (util.isDate(val));
114+
return (util.types.isDate(val));
115115
}
116116

117117
//---------------------------------------------------------------------------

lib/impl/datahandlers/oson.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ class OsonTreeSegment extends GrowableBuffer {
564564
}
565565

566566
// handle dates
567-
} else if (util.isDate(value)) {
567+
} else if (util.types.isDate(value)) {
568568
if (value.getUTCMilliseconds() === 0) {
569569
this.writeUInt8(constants.TNS_JSON_TYPE_TIMESTAMP7);
570570
this.writeOracleDate(value, types.DB_TYPE_DATE, false);

lib/thin/protocol/protocol.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Protocol {
7171
while (true) { // eslint-disable-line
7272
if (this.nsi.isBreak) {
7373
await this.resetMessage();
74-
delete this.readBuf.savedBuffers;
74+
delete this.readBuf.savedPackets;
7575
await this.readBuf.waitForPackets();
7676
}
7777
try {

lib/transformer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function transformJsonValue(value) {
8989
if (value === undefined || value === null ||
9090
typeof value === 'number' || typeof value === 'string' ||
9191
typeof value === 'boolean' || Buffer.isBuffer(value) ||
92-
util.isDate(value) || nodbUtil.isVectorValue(value))
92+
util.types.isDate(value) || nodbUtil.isVectorValue(value))
9393
return value;
9494

9595
// arrays are transformed to a new array with processed values
@@ -189,7 +189,7 @@ function transformValueIn(info, value, options) {
189189
return value;
190190

191191
// handle dates
192-
} else if (util.isDate(value)) {
192+
} else if (util.types.isDate(value)) {
193193
checkType(info, options,
194194
types.DB_TYPE_TIMESTAMP,
195195
types.DB_TYPE_TIMESTAMP_TZ,

lib/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function isShardingKey(value) {
231231
const element = value[i];
232232
const ok = typeof element === 'string' ||
233233
typeof element === 'number' || Buffer.isBuffer(element) ||
234-
util.isDate(element);
234+
util.types.isDate(element);
235235
if (!ok)
236236
return false;
237237
}

0 commit comments

Comments
 (0)