-first commit
This commit is contained in:
30
node_modules/@redis/client/dist/lib/commands/CLUSTER_SLOTS.js
generated
vendored
Normal file
30
node_modules/@redis/client/dist/lib/commands/CLUSTER_SLOTS.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = {
|
||||
NOT_KEYED_COMMAND: true,
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Returns information about which Redis Cluster node handles which hash slots
|
||||
* @param parser - The Redis command parser
|
||||
*/
|
||||
parseCommand(parser) {
|
||||
parser.push('CLUSTER', 'SLOTS');
|
||||
},
|
||||
transformReply(reply) {
|
||||
return reply.map(([from, to, master, ...replicas]) => ({
|
||||
from,
|
||||
to,
|
||||
master: transformNode(master),
|
||||
replicas: replicas.map(transformNode)
|
||||
}));
|
||||
}
|
||||
};
|
||||
function transformNode(node) {
|
||||
const [host, port, id] = node;
|
||||
return {
|
||||
host,
|
||||
port,
|
||||
id
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=CLUSTER_SLOTS.js.map
|
||||
Reference in New Issue
Block a user