1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-11 22:42:42 +03:00
Files
node-redis/lib/commands/HGETALL.ts
2021-05-12 14:27:02 -04:00

15 lines
359 B
TypeScript

export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['HGETALL', key];
}
export function transformReply(reply: Array<string>): Record<string, string> {
const obj = Object.create(null);
for (let i = 0; i < reply.length; i += 2) {
obj[reply[i]] = reply[i + 1];
}
return obj;
}