You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
chore: refactor parts out of the index.js file
This commit is contained in:
17
lib/utils.js
17
lib/utils.js
@@ -115,11 +115,26 @@ function replyInOrder (client, callback, err, res, queue) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Emit or print a warning. E.g. deprecations
|
||||
*
|
||||
* @param {RedisClient} client
|
||||
* @param {string} msg
|
||||
*/
|
||||
function warn (client, msg) {
|
||||
if (client.listeners('warning').length !== 0) {
|
||||
client.emit('warning', msg)
|
||||
} else {
|
||||
console.warn('NodeRedis:', msg)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
replyToStrings,
|
||||
replyToObject,
|
||||
errCode: /^([A-Z]+)\s+(.+)$/,
|
||||
monitorRegex: /^[0-9]{10,11}\.[0-9]+ \[[0-9]+ .+]( ".+?")+$/,
|
||||
clone: convenienceClone,
|
||||
replyInOrder
|
||||
replyInOrder,
|
||||
warn
|
||||
}
|
||||
|
Reference in New Issue
Block a user