refactor: replace ignored numeric literals with constants
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user