1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-13 10:02:24 +03:00

chore: add print helper again and refactor some code

Expose the RedisClient directly instead of only being a property
This commit is contained in:
Ruben Bridgewater
2017-05-29 18:23:24 +02:00
parent 4e593587cb
commit 0276e15f04
14 changed files with 169 additions and 104 deletions

View File

@@ -23,6 +23,12 @@ function addCommand (clientProto, multiProto, command) {
})
}
}
Object.defineProperty(clientProto, commandName.toUpperCase(), {
enumerable: false,
configurable: false,
writable: false,
value: clientProto[commandName]
})
// Do not override existing functions
if (!multiProto[command] && command !== 'multi') {
@@ -41,6 +47,12 @@ function addCommand (clientProto, multiProto, command) {
})
}
}
Object.defineProperty(multiProto, commandName.toUpperCase(), {
enumerable: false,
configurable: false,
writable: false,
value: clientProto[commandName]
})
}
module.exports = addCommand