You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
WIP
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { RedisArgument, ArrayReply, BlobStringReply, Command, NumberReply, Resp2Reply, RespVersions, TuplesToMapReply } from '../RESP/types';
|
||||
|
||||
export interface HelloOptions {
|
||||
protover?: RespVersions;
|
||||
AUTH?: {
|
||||
username: RedisArgument;
|
||||
password: RedisArgument;
|
||||
@@ -19,22 +20,26 @@ export type HelloReply = TuplesToMapReply<[
|
||||
]>;
|
||||
|
||||
export default {
|
||||
transformArguments(protoover: RespVersions, options?: HelloOptions) {
|
||||
const args: Array<RedisArgument> = ['HELLO', protoover.toString()];
|
||||
transformArguments(protover?: RespVersions, options?: HelloOptions) {
|
||||
const args: Array<RedisArgument> = ['HELLO'];
|
||||
|
||||
if (options?.AUTH) {
|
||||
args.push(
|
||||
'AUTH',
|
||||
options.AUTH.username,
|
||||
options.AUTH.password
|
||||
);
|
||||
}
|
||||
if (protover) {
|
||||
args.push(protover.toString());
|
||||
|
||||
if (options?.SETNAME) {
|
||||
args.push(
|
||||
'SETNAME',
|
||||
options.SETNAME
|
||||
);
|
||||
if (options?.AUTH) {
|
||||
args.push(
|
||||
'AUTH',
|
||||
options.AUTH.username,
|
||||
options.AUTH.password
|
||||
);
|
||||
}
|
||||
|
||||
if (options?.SETNAME) {
|
||||
args.push(
|
||||
'SETNAME',
|
||||
options.SETNAME
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return args;
|
||||
|
Reference in New Issue
Block a user