Debian Codegraph @

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

raw
1 import { Timestamp, transformTimestampArgument } from '.';
2
3 export const FIRST_KEY_INDEX = 1;
4
5 interface MAddSample {
6 key: string;
7 timestamp: Timestamp;
8 value: number;
9 }
10
11 export function transformArguments(toAdd: Array<MAddSample>): Array<string> {
12 const args = ['TS.MADD'];
13
14 for (const { key, timestamp, value } of toAdd) {
15 args.push(
16 key,
17 transformTimestampArgument(timestamp),
18 value.toString()
19 );
20 }
21
22 return args;
23 }
24
25 export declare function transformReply(): Array<number>;