Skip to content

Commit 48c9ac6

Browse files
author
KIvanow
committed
RI-6336 added recommendation from the PR
1 parent 13bf38e commit 48c9ac6

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

redisinsight/api/src/modules/browser/keys/scanner/strategies/standalone.scanner.strategy.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,11 @@ export class StandaloneScannerStrategy extends ScannerStrategy {
171171
: await this.getKeysType(client, keys);
172172
const ttlResults = includeTTL ? await this.getKeysTtl(client, keys) : [];
173173

174-
return keys.map(
175-
(key: string, index: number): GetKeyInfoResponse => {
176-
const data: GetKeyInfoResponse = {
177-
name: key,
178-
type: typeResults[index],
179-
}
180-
181-
if (includeTTL) {
182-
data.ttl = ttlResults[index];
183-
}
184-
if (includeSize) {
185-
data.size = sizeResults[index];
186-
}
187-
return data;
188-
},
189-
);
174+
return keys.map((key, index) => ({
175+
name: key,
176+
type: typeResults[index],
177+
...(includeTTL && { ttl: ttlResults[index] }),
178+
...(includeSize && { size: sizeResults[index] }),
179+
}));
190180
}
191-
}
181+
}

0 commit comments

Comments
 (0)