You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
WIP
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
import { RedisArgument, ArrayReply, NumberReply, NullReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisArgument, NumberReply, ArrayReply, NullReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisJSON, transformRedisJsonArgument } from '.';
|
||||
|
||||
export default {
|
||||
FIRST_KEY_INDEX: 1,
|
||||
IS_READ_ONLY: false,
|
||||
transformArguments(key: RedisArgument, path: RedisArgument, index: number, ...jsons: Array<RedisJSON>) {
|
||||
const args = ['JSON.ARRINSERT', key, path, index.toString()];
|
||||
transformArguments(
|
||||
key: RedisArgument,
|
||||
path: RedisArgument,
|
||||
index: number,
|
||||
json: RedisJSON,
|
||||
...jsons: Array<RedisJSON>
|
||||
) {
|
||||
const args = [
|
||||
'JSON.ARRINSERT',
|
||||
key,
|
||||
path,
|
||||
index.toString(),
|
||||
transformRedisJsonArgument(json)
|
||||
];
|
||||
|
||||
for (const json of jsons) {
|
||||
args.push(transformRedisJsonArgument(json));
|
||||
@@ -13,5 +25,5 @@ export default {
|
||||
|
||||
return args;
|
||||
},
|
||||
transformReply: undefined as unknown as () => NumberReply | NullReply | ArrayReply<NumberReply | NullReply>
|
||||
transformReply: undefined as unknown as () => NumberReply | ArrayReply<NumberReply | NullReply>
|
||||
} as const satisfies Command;
|
||||
|
Reference in New Issue
Block a user