You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-09 21:21:11 +03:00
fix(ts): xtrim threshold accepts string (#3058)
* fix(ts): xtrim threshold accepts string * test: check MINID with text id
This commit is contained in:
@@ -18,6 +18,11 @@ describe('XTRIM', () => {
|
||||
parseArgs(XTRIM, 'key', 'MINID', 123),
|
||||
['XTRIM', 'key', 'MINID', '123']
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
parseArgs(XTRIM, 'key', 'MINID', '0-0'),
|
||||
['XTRIM', 'key', 'MINID', '0-0']
|
||||
);
|
||||
});
|
||||
|
||||
it('with strategyModifier', () => {
|
||||
@@ -89,6 +94,16 @@ describe('XTRIM', () => {
|
||||
cluster: GLOBAL.CLUSTERS.OPEN,
|
||||
});
|
||||
|
||||
testUtils.testAll('xTrim with string MINID', async client => {
|
||||
assert.equal(
|
||||
typeof await client.xTrim('key', 'MINID', '0-0'),
|
||||
'number'
|
||||
);
|
||||
}, {
|
||||
client: GLOBAL.SERVERS.OPEN,
|
||||
cluster: GLOBAL.CLUSTERS.OPEN,
|
||||
});
|
||||
|
||||
testUtils.testAll(
|
||||
'xTrim with LIMIT',
|
||||
async (client) => {
|
||||
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
parser: CommandParser,
|
||||
key: RedisArgument,
|
||||
strategy: 'MAXLEN' | 'MINID',
|
||||
threshold: number,
|
||||
threshold: number | string,
|
||||
options?: XTrimOptions
|
||||
) {
|
||||
parser.push('XTRIM')
|
||||
|
||||
Reference in New Issue
Block a user