From 36e21bb961e9a3a2876114b49b4893d3ca4a93fa Mon Sep 17 00:00:00 2001 From: hyrulelinks <134026642+hyrulelinks@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:48:04 +0800 Subject: [PATCH] fix TypeError: util.isDate is not a function --- lib/encode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/encode.js b/lib/encode.js index ee47929..d43dae2 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)) { // value = new Date(value); throw new TypeError('Not a date: ' + value) }