You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
fix: fix various command import issues (#2944)
* fix: fix various command import issues there was some sort of a circular dependency in <module>/lib/commands/index.ts for various modules fixes #2937 fixes #2941 * remove redundant definition
This commit is contained in:
committed by
GitHub
parent
bc4b2101ee
commit
7b737821b2
@@ -1,4 +1,3 @@
|
||||
import { BlobStringReply, NullReply, UnwrapReply } from '@redis/client/dist/lib/RESP/types';
|
||||
import ARRAPPEND from './ARRAPPEND';
|
||||
import ARRINDEX from './ARRINDEX';
|
||||
import ARRINSERT from './ARRINSERT';
|
||||
@@ -23,7 +22,8 @@ import STRAPPEND from './STRAPPEND';
|
||||
import STRLEN from './STRLEN';
|
||||
import TOGGLE from './TOGGLE';
|
||||
import TYPE from './TYPE';
|
||||
import { isNullReply } from '@redis/client/dist/lib/commands/generic-transformers';
|
||||
|
||||
export * from './helpers';
|
||||
|
||||
export default {
|
||||
ARRAPPEND,
|
||||
@@ -82,19 +82,3 @@ export default {
|
||||
type: TYPE
|
||||
};
|
||||
|
||||
export type RedisJSON = null | boolean | number | string | Date | Array<RedisJSON> | {
|
||||
[key: string]: RedisJSON;
|
||||
[key: number]: RedisJSON;
|
||||
};
|
||||
|
||||
export function transformRedisJsonArgument(json: RedisJSON): string {
|
||||
return JSON.stringify(json);
|
||||
}
|
||||
|
||||
export function transformRedisJsonReply(json: BlobStringReply): RedisJSON {
|
||||
return JSON.parse((json as unknown as UnwrapReply<typeof json>).toString());
|
||||
}
|
||||
|
||||
export function transformRedisJsonNullReply(json: NullReply | BlobStringReply): NullReply | RedisJSON {
|
||||
return isNullReply(json) ? json : transformRedisJsonReply(json);
|
||||
}
|
||||
|
Reference in New Issue
Block a user