From ce072c5d84e9fe893a9a572e83cba193df56fa3f Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 28 Dec 2012 22:43:56 -0500 Subject: [PATCH] use util.isDate instead of instanceof --- lib/imap.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/imap.js b/lib/imap.js index 9e64af8..767135e 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -1,4 +1,5 @@ var assert = require('assert'), + isDate = require('util').isDate, inspect = require('util').inspect, inherits = require('util').inherits, Socket = require('net').Socket, @@ -795,8 +796,8 @@ ImapConnection.prototype.append = function(data, options, cb) { cmd += " (\\" + options.flags.join(' \\') + ")"; } if (options.date) { - if (!(options.date instanceof Date)) - throw new Error('Expected null or Date object for date'); + if (!isDate(options.date)) + throw new Error("`date` isn't a Date object"); cmd += ' "'; cmd += options.date.getDate(); cmd += '-';