diff --git a/lib/redis-client.js b/lib/redis-client.js index 1126c02..c34ac26 100644 --- a/lib/redis-client.js +++ b/lib/redis-client.js @@ -721,3 +721,20 @@ Client.prototype.unsubscribeFrom = function (nameOrPattern) { this[method](nameOrPattern); }; +// Multi-bulk replies return an array of other replies. Perhaps all you care +// about is the representation of such buffers as UTF-8 encoded strings? Use +// this to convert each such Buffer to a (UTF-8 encoded) String in-place. + +exports.convertMultiBulkBuffersToUTF8Strings = function (o) { + if (o instanceof Array) { + for (var i=0; i