You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* Support new expire features * Update PEXPIRETIME.ts * Update EXPIRETIME.ts * fix version skip * clean code Co-authored-by: leibale <leibale1998@gmail.com>
20 lines
458 B
TypeScript
20 lines
458 B
TypeScript
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
|
|
|
export const FIRST_KEY_INDEX = 1;
|
|
|
|
export function transformArguments(
|
|
key: RedisCommandArgument,
|
|
seconds: number,
|
|
mode?: 'NX' | 'XX' | 'GT' | 'LT'
|
|
): RedisCommandArguments {
|
|
const args = ['EXPIRE', key, seconds.toString()];
|
|
|
|
if (mode) {
|
|
args.push(mode);
|
|
}
|
|
|
|
return args;
|
|
}
|
|
|
|
export { transformBooleanReply as transformReply } from './generic-transformers';
|