1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00

do not hide bugs in redis

This commit is contained in:
leibale
2021-07-20 13:39:35 -04:00
parent 8b4537ef0c
commit e7bf09644b
2 changed files with 10 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments, transformReplyNumber } from './generic-transformers'; import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1; export const FIRST_KEY_INDEX = 1;
@@ -30,11 +30,10 @@ export function transformArguments(
return args; return args;
} }
export function transformReply(reply: number): number {
if (typeof reply !== 'number') {
throw new TypeError(`https://github.com/redis/redis/issues/9261`);
}
// in versions 6.2.0-6.2.4 Redis will return an empty array when `src` is empty return reply;
// TODO: issue/PR
export function transformReply(reply: number | []): number {
if (typeof reply === 'number') return reply;
return 0;
} }

View File

@@ -46,10 +46,10 @@ export function transformArguments(dst: string, src: string, min: number, max: n
return args; return args;
} }
// in versions 6.2.0-6.2.4 Redis will return an empty array when `src` is empty export function transformReply(reply: number): number {
// https://github.com/redis/redis/pull/9089 if (typeof reply !== 'number') {
export function transformReply(reply: number | []): number { throw new TypeError(`Upgrade to Redis 6.2.5 and up (https://github.com/redis/redis/pull/9089)`);
if (typeof reply === 'number') return reply; };
return 0; return 0;
} }