From 5e14598e40d5cc4a594688e9a526632f051a2e5c Mon Sep 17 00:00:00 2001 From: XadillaX Date: Tue, 25 Aug 2015 18:38:50 +0800 Subject: [PATCH] fix a bug to send date --- lib/isocket.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/isocket.js b/lib/isocket.js index 17bd477..ec191f6 100644 --- a/lib/isocket.js +++ b/lib/isocket.js @@ -11,11 +11,21 @@ var msgpack = require("msgpack"); var helper = require("./helper"); var emptyFunc = function(){}; + +/** + * _formatSendBody + * @param {*} _body the body to be formatted + * @return {*} the body formatted + */ var _formatSendBody = function(_body) { if(undefined === _body || null === _body) { return null; } + if(_body instanceof Date || _body instanceof Error) { + return _body; + } + if(util.isArray(_body)) { return _body.map(function(body) { return _formatSendBody(body);