You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-11 09:22:35 +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),
|
parseArgs(XTRIM, 'key', 'MINID', 123),
|
||||||
['XTRIM', 'key', 'MINID', '123']
|
['XTRIM', 'key', 'MINID', '123']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
assert.deepEqual(
|
||||||
|
parseArgs(XTRIM, 'key', 'MINID', '0-0'),
|
||||||
|
['XTRIM', 'key', 'MINID', '0-0']
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with strategyModifier', () => {
|
it('with strategyModifier', () => {
|
||||||
@@ -89,6 +94,16 @@ describe('XTRIM', () => {
|
|||||||
cluster: GLOBAL.CLUSTERS.OPEN,
|
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(
|
testUtils.testAll(
|
||||||
'xTrim with LIMIT',
|
'xTrim with LIMIT',
|
||||||
async (client) => {
|
async (client) => {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default {
|
|||||||
parser: CommandParser,
|
parser: CommandParser,
|
||||||
key: RedisArgument,
|
key: RedisArgument,
|
||||||
strategy: 'MAXLEN' | 'MINID',
|
strategy: 'MAXLEN' | 'MINID',
|
||||||
threshold: number,
|
threshold: number | string,
|
||||||
options?: XTrimOptions
|
options?: XTrimOptions
|
||||||
) {
|
) {
|
||||||
parser.push('XTRIM')
|
parser.push('XTRIM')
|
||||||
|
|||||||
Reference in New Issue
Block a user