refactor: replace ignored numeric literals with constants

This commit is contained in:
2026-09-28 16:37:01 +03:00
committed by ksv741
parent a970eaaf7a
commit b78c215ff1
60 changed files with 510 additions and 283 deletions
@@ -1,5 +1,7 @@
import { MILLISECONDS_PER_DAY } from '../../../../common/time';
const FIRST_RANGE_END_INDEX = 1;
export type CandleRange = { from: Date; to: Date };
export type CandleCoverage = CandleRange & {
fetchedAt: Date;
@@ -80,7 +82,7 @@ export function confirmedCandleCoverage(
}
}
const sorted = [...boundaries].sort((a, b) => a - b);
return sorted.slice(1).map((to, index) => {
return sorted.slice(FIRST_RANGE_END_INDEX).map((to, index) => {
// eslint-disable-next-line security/detect-object-injection -- The index comes from the sorted numeric boundary array.
const from = sorted[index];
return {