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 += '-';