You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-13 10:02:24 +03:00
22 lines
573 B
TypeScript
22 lines
573 B
TypeScript
import { transformReplyStringArray } from './generic-transformers';
|
|
|
|
export const FIRST_KEY_INDEX = 1;
|
|
|
|
export function transformArguments(key: string, count?: number, withValues?: boolean): Array<string> {
|
|
const args = ['HRANDFIELD', key];
|
|
if (count) {
|
|
args.push(count.toString());
|
|
|
|
if (withValues) {
|
|
args.push('WITHVALUES');
|
|
}
|
|
}
|
|
|
|
return args;
|
|
}
|
|
|
|
export function transformReply(reply: null | string | Array<string>): null | string | Array<string> {
|
|
// TODO: convert to object when `withValues`?
|
|
return reply;
|
|
};
|