Skip to content

Commit 7585a29

Browse files
Update MGET_WITHLABELS.ts
Use map in transformReply
1 parent e4d99a8 commit 7585a29

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,9 @@ export interface MGetWithLabelsReply extends MGetReply {
3333
};
3434

3535
export function transformReply(reply: MGetRawReply): Array<MGetWithLabelsReply> {
36-
const args = [];
37-
38-
for (const [key, labels, sample] of reply) {
39-
args.push({
40-
key,
41-
labels: transformLablesReply(labels),
42-
sample: transformSampleReply(sample)
43-
});
44-
}
45-
46-
return args;
36+
return reply.map(([key, labels, sample]) => ({
37+
key,
38+
labels: transformLablesReply(labels),
39+
sample: transformSampleReply(sample)
40+
}));
4741
}

0 commit comments

Comments
 (0)