1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-12 21:21:15 +03:00

fix(ts): xtrim threshold accepts string (#2828)

* fix(ts): xtrim threshold accepts string

* test: check MINID with text id
This commit is contained in:
Manuel Spigolon
2025-08-15 12:36:04 +02:00
committed by GitHub
parent 3d7668e543
commit 7d905c0027
2 changed files with 8 additions and 1 deletions

View File

@@ -38,6 +38,13 @@ describe('XTRIM', () => {
['XTRIM', 'key', 'MAXLEN', '=', '1', 'LIMIT', '1']
);
});
it('with MINID', () => {
assert.deepEqual(
XTRIM.transformArguments('key', 'MINID', '0-0'),
['XTRIM', 'key', 'MINID', '0-0']
);
});
});
testUtils.testAll('xTrim', async client => {

View File

@@ -12,7 +12,7 @@ export default {
transformArguments(
key: RedisArgument,
strategy: 'MAXLEN' | 'MINID',
threshold: number,
threshold: number | string,
options?: XTrimOptions
) {
const args = ['XTRIM', key, strategy];