From ffb36a513cbae2993329894fa86402244b646bab Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 16 Jul 2024 03:59:48 -0700 Subject: [PATCH] [DEP0047] DeprecationWarning Fix Fix [DEP0047] DeprecationWarning: The `util.isDate` API is deprecated. Please use `arg instanceof Date` instead. --- lib/encode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/encode.js b/lib/encode.js index ee47929..d4da127 100644 --- a/lib/encode.js +++ b/lib/encode.js @@ -5,7 +5,7 @@ var values = require('./values') var appleEpoch = Date.UTC(1904, 0, 1) var appleDate = function (value) { - if (util.isDate(value) === false) { + if (value instanceof Date === false) { // value = new Date(value); throw new TypeError('Not a date: ' + value) }