1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
node-redis/lib/commands/BITOP.ts
2021-07-13 19:35:07 -04:00

20 lines
502 B
TypeScript

import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 2;
type BitOperations = 'AND' | 'OR' | 'XOR' | 'NOT';
export function transformArguments(operation: BitOperations, destKey: string, key: string | Array<string>): Array<string> {
const args = ['BITOP', operation, destKey];
if (typeof key === 'string') {
args.push(key);
} else {
args.push(...key);
}
return args;
}
export const transformReply = transformReplyNumber;