Debian Codegraph @

packages/time-series/lib/commands/GET.ts

raw
1 import { RedisCommandArguments } from '@redis/client/dist/lib/commands';
2 import { pushLatestArgument, SampleRawReply, SampleReply, transformSampleReply } from '.';
3
4 export const FIRST_KEY_INDEX = 1;
5
6 export const IS_READ_ONLY = true;
7
8 interface GetOptions {
9 LATEST?: boolean;
10 }
11
12 export function transformArguments(key: string, options?: GetOptions): RedisCommandArguments {
13 return pushLatestArgument(['TS.GET', key], options?.LATEST);
14 }
15
16 export function transformReply(reply: [] | SampleRawReply): null | SampleReply {
17 if (reply.length === 0) return null;
18
19 return transformSampleReply(reply);
20 }