You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* (docs) bloom: add jsdocs for all commands * (docs) json: add jsdocs * (docs) search: add jsdocs for all commands * (docs) jsdocs for std commands * (docs) jsdoc comments to time series commands
32 lines
1014 B
TypeScript
32 lines
1014 B
TypeScript
import { CommandParser } from '../client/parser';
|
|
import { ArrayReply, Command, NumberReply, RedisArgument } from '../RESP/types';
|
|
import { RedisVariadicArgument } from './generic-transformers';
|
|
|
|
export const HASH_EXPIRATION_TIME = {
|
|
/** The field does not exist */
|
|
FIELD_NOT_EXISTS: -2,
|
|
/** The field exists but has no associated expire */
|
|
NO_EXPIRATION: -1,
|
|
} as const;
|
|
|
|
export default {
|
|
IS_READ_ONLY: true,
|
|
/**
|
|
* Returns the absolute Unix timestamp (since January 1, 1970) at which the given hash fields will expire
|
|
* @param parser - The Redis command parser
|
|
* @param key - Key of the hash
|
|
* @param fields - Fields to check expiration time
|
|
*/
|
|
parseCommand(
|
|
parser: CommandParser,
|
|
key: RedisArgument,
|
|
fields: RedisVariadicArgument
|
|
) {
|
|
parser.push('HEXPIRETIME');
|
|
parser.pushKey(key);
|
|
parser.push('FIELDS');
|
|
parser.pushVariadicWithLength(fields);
|
|
},
|
|
transformReply: undefined as unknown as () => ArrayReply<NumberReply>
|
|
} as const satisfies Command;
|