Skip to content

Commit 804e0bb

Browse files
authored
NODEJS-682 Replace deprecated usages of util.isDate & util.isString (#429)
1 parent eb586f8 commit 804e0bb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/metadata/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ class Metadata {
391391
if (Array.isArray(components)) {
392392
return this.tokenizer.hash(Buffer.concat(components));
393393
}
394-
else if (util.isString(components)) {
394+
else if (typeof components === "string") {
395395
return this.tokenizer.parse(components);
396396
}
397397
return this.tokenizer.hash(components);

lib/types/local-time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ LocalTime.now = function (nanoseconds) {
124124
* @returns {LocalTime}
125125
*/
126126
LocalTime.fromDate = function (date, nanoseconds) {
127-
if (!util.isDate(date)) {
127+
if (!(date instanceof Date)) {
128128
throw new Error('Not a valid date');
129129
}
130130
//Use the local representation, only the milliseconds portion

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function deepExtend(target) {
213213
targetType === 'number' ||
214214
targetType === 'string' ||
215215
Array.isArray(targetProp) ||
216-
util.isDate(targetProp) ||
216+
targetProp instanceof Date ||
217217
targetProp.constructor.name !== 'Object') {
218218
target[prop] = source[prop];
219219
}

0 commit comments

Comments
 (0)