You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
(docs) add jsdoc comments to command parsers (#2984)
* (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
This commit is contained in:
@@ -7,12 +7,22 @@ export interface TsMGetOptions {
|
||||
LATEST?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds LATEST argument to command if specified
|
||||
* @param parser - The command parser
|
||||
* @param latest - Whether to include the LATEST argument
|
||||
*/
|
||||
export function parseLatestArgument(parser: CommandParser, latest?: boolean) {
|
||||
if (latest) {
|
||||
parser.push('LATEST');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds FILTER argument to command
|
||||
* @param parser - The command parser
|
||||
* @param filter - Filter to match time series keys
|
||||
*/
|
||||
export function parseFilterArgument(parser: CommandParser, filter: RedisVariadicArgument) {
|
||||
parser.push('FILTER');
|
||||
parser.pushVariadic(filter);
|
||||
@@ -37,6 +47,12 @@ export type MGetRawReply3 = MapReply<
|
||||
export default {
|
||||
NOT_KEYED_COMMAND: true,
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets the last samples matching a specific filter from multiple time series
|
||||
* @param parser - The command parser
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand(parser: CommandParser, filter: RedisVariadicArgument, options?: TsMGetOptions) {
|
||||
parser.push('TS.MGET');
|
||||
parseLatestArgument(parser, options?.LATEST);
|
||||
|
Reference in New Issue
Block a user