You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
do not hide bugs in redis
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -30,11 +30,10 @@ export function transformArguments(
|
||||
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
|
||||
// TODO: issue/PR
|
||||
export function transformReply(reply: number | []): number {
|
||||
if (typeof reply === 'number') return reply;
|
||||
|
||||
return 0;
|
||||
return reply;
|
||||
}
|
||||
|
@@ -46,10 +46,10 @@ export function transformArguments(dst: string, src: string, min: number, max: n
|
||||
return args;
|
||||
}
|
||||
|
||||
// in versions 6.2.0-6.2.4 Redis will return an empty array when `src` is empty
|
||||
// https://github.com/redis/redis/pull/9089
|
||||
export function transformReply(reply: number | []): number {
|
||||
if (typeof reply === 'number') return reply;
|
||||
export function transformReply(reply: number): number {
|
||||
if (typeof reply !== 'number') {
|
||||
throw new TypeError(`Upgrade to Redis 6.2.5 and up (https://github.com/redis/redis/pull/9089)`);
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user