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

fix client.quit, add error events on cluster, fix some "deepsource.io" warnings

This commit is contained in:
leibale
2021-09-02 14:00:52 -04:00
parent e421dc4bed
commit b80afc6346
9 changed files with 86 additions and 85 deletions

View File

@@ -97,12 +97,12 @@ export function transformCommandArguments<T = unknown>(
export function encodeCommand(args: Array<string>): string {
const encoded = [
`*${args.length}`,
`$${Buffer.byteLength(args[0])}`,
`$${Buffer.byteLength(args[0]).toString()}`,
args[0]
];
for (let i = 1; i < args.length; i++) {
encoded.push(`$${Buffer.byteLength(args[i])}`, args[i]);
encoded.push(`$${Buffer.byteLength(args[i]).toString()}`, args[i]);
}
return encoded.join('\r\n') + '\r\n';