1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
node-redis/packages/json/lib/commands/MSET.ts
2023-05-17 15:51:53 +03:00

25 lines
644 B
TypeScript

import { RedisJSON, transformRedisJsonArgument } from '.';
export const FIRST_KEY_INDEX = 1;
export interface KeyPathValue {
key: string;
path: string;
value: RedisJSON;
}
export function transformArguments(keyPathValues: Array<KeyPathValue>): Array<string> {
if (keyPathValues.length === 0) {
throw new Error('ERR wrong number of arguments for \'MSET\' command');
}
const args: string[] = ['JSON.MSET'];
keyPathValues.forEach(({ key, path, value }) => {
args.push(key, path, transformRedisJsonArgument(value));
});
return args;
}
export declare function transformReply(): 'OK' | null;