You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-09-11 18:50:46 +03:00
init v4
This commit is contained in:
14
lib/commands/HGETALL.ts
Normal file
14
lib/commands/HGETALL.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user