1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

fix legacy mode resp encoder (#2118)

* fix legacy mode resp encoder

* Update encoder.ts
This commit is contained in:
Leibale Eidelman
2022-05-11 14:20:26 -04:00
committed by GitHub
parent 94dbcc847b
commit 3ec17e31b3
2 changed files with 12 additions and 10 deletions

View File

@@ -123,7 +123,11 @@ export function transformCommandArguments<T>(
}
export function transformLegacyCommandArguments(args: Array<any>): Array<any> {
return args.flat().map(x => x?.toString?.());
return args.flat().map(arg => {
return typeof arg === 'number' || arg instanceof Date ?
arg.toString() :
arg;
});
}
export function transformCommandReply<C extends RedisCommand>(