1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Add support for BF.CARD command (#2376)

* Add support for BF.CARD command

* Update index.ts

* Update CARD.ts

* Update CARD.spec.ts

Co-authored-by: Leibale Eidelman <me@leibale.com>
This commit is contained in:
shacharPash
2023-01-18 19:53:00 +02:00
committed by GitHub
parent c5b6f77c33
commit a55fbafb88
3 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../../test-utils';
import { transformArguments } from './CARD';
describe('BF CARD', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments('bloom'),
['BF.CARD', 'bloom']
);
});
testUtils.testWithClient('client.bf.card', async client => {
assert.equal(
await client.bf.card('key'),
0
);
}, GLOBAL.SERVERS.OPEN);
});

View File

@@ -0,0 +1,9 @@
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
export function transformArguments(key: string): Array<string> {
return ['BF.CARD', key];
}
export declare function transformReply(): number;

View File

@@ -1,4 +1,5 @@
import * as ADD from './ADD';
import * as CARD from './CARD';
import * as EXISTS from './EXISTS';
import * as INFO from './INFO';
import * as INSERT from './INSERT';
@@ -11,6 +12,8 @@ import * as SCANDUMP from './SCANDUMP';
export default {
ADD,
add: ADD,
CARD,
card: CARD,
EXISTS,
exists: EXISTS,
INFO,