From b8a12905ae5ee790cadc902d82b9213a6701a06e Mon Sep 17 00:00:00 2001 From: Noa Milshtein Date: Thu, 21 Dec 2023 15:45:53 +0200 Subject: [PATCH] add default value to count --- src/redis.ts | 2 +- test/redis.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redis.ts b/src/redis.ts index ea4a7fb..bb8e7bf 100644 --- a/src/redis.ts +++ b/src/redis.ts @@ -106,7 +106,7 @@ class buildRedisStoreWithConfig implements RedisStore { return await this.redisCache.ttl(key); }; - public async scan(pattern: string, cursor: number = 0, count?: number): Promise { + public async scan(pattern: string, cursor: number = 0, count: number = 10): Promise { return await this.redisCache.scan(cursor, { MATCH: pattern, COUNT: count }); } diff --git a/test/redis.test.ts b/test/redis.test.ts index b511078..8f6b94e 100644 --- a/test/redis.test.ts +++ b/test/redis.test.ts @@ -91,7 +91,7 @@ describe('Redis Store', () => { await redisClient.set(key2, value, ttl); await redisClient.set(key3, value, ttl); - const res = await redisClient.scan('ttl:a:*', 0, 10); + const res = await redisClient.scan('ttl:a:*'); expect(res.keys).toEqual([key1, key3]); const firstScanWithCount = await redisClient.scan('ttl:a:*', 0, 1);