1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
Not inheriting from the prototype is a BC
This commit is contained in:
Ruben Bridgewater
2016-05-25 22:52:31 +03:00
parent fe00bf271d
commit 55528d8b1b
5 changed files with 10 additions and 18 deletions

View File

@@ -1,7 +1,5 @@
'use strict';
var RawObject = require('./rawObject');
// hgetall converts its replies to an Object. If the reply is empty, null is returned.
// These function are only called with internal data and have therefore always the same instanceof X
function replyToObject (reply) {
@@ -9,7 +7,7 @@ function replyToObject (reply) {
if (reply.length === 0 || !(reply instanceof Array)) {
return null;
}
var obj = new RawObject();
var obj = {};
for (var i = 0; i < reply.length; i += 2) {
obj[reply[i].toString('binary')] = reply[i + 1];
}