1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
node-redis/packages/client/lib/commands/BITOP.ts
Bobby I. 20c16e0c2c (docs) add jsdoc comments to command parsers (#2984)
* (docs) bloom: add jsdocs for all commands

* (docs) json: add jsdocs

* (docs) search: add jsdocs for all commands

* (docs) jsdocs for std commands

* (docs) jsdoc comments to time series commands
2025-06-03 14:38:07 +03:00

28 lines
907 B
TypeScript

import { CommandParser } from '../client/parser';
import { NumberReply, Command, RedisArgument } from '../RESP/types';
import { RedisVariadicArgument } from './generic-transformers';
export type BitOperations = 'AND' | 'OR' | 'XOR' | 'NOT';
export default {
IS_READ_ONLY: false,
/**
* Performs bitwise operations between strings
* @param parser - The Redis command parser
* @param operation - Bitwise operation to perform: AND, OR, XOR, NOT
* @param destKey - Destination key to store the result
* @param key - Source key(s) to perform operation on
*/
parseCommand(
parser: CommandParser,
operation: BitOperations,
destKey: RedisArgument,
key: RedisVariadicArgument
) {
parser.push('BITOP', operation);
parser.pushKey(destKey);
parser.pushKeys(key);
},
transformReply: undefined as unknown as () => NumberReply
} as const satisfies Command;