Skip to content

Commit 7d905c0

Browse files
authored
fix(ts): xtrim threshold accepts string (#2828)
* fix(ts): xtrim threshold accepts string * test: check MINID with text id
1 parent 3d7668e commit 7d905c0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/client/lib/commands/XTRIM.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ describe('XTRIM', () => {
3838
['XTRIM', 'key', 'MAXLEN', '=', '1', 'LIMIT', '1']
3939
);
4040
});
41+
42+
it('with MINID', () => {
43+
assert.deepEqual(
44+
XTRIM.transformArguments('key', 'MINID', '0-0'),
45+
['XTRIM', 'key', 'MINID', '0-0']
46+
);
47+
});
4148
});
4249

4350
testUtils.testAll('xTrim', async client => {

packages/client/lib/commands/XTRIM.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212
transformArguments(
1313
key: RedisArgument,
1414
strategy: 'MAXLEN' | 'MINID',
15-
threshold: number,
15+
threshold: number | string,
1616
options?: XTrimOptions
1717
) {
1818
const args = ['XTRIM', key, strategy];

0 commit comments

Comments
 (0)