Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
review: failsafe for sparkline points
Browse files Browse the repository at this point in the history
  • Loading branch information
LFBarreto committed Feb 17, 2022
1 parent 5901c29 commit 69d7278
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/market/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const matchSearch =
};

function distributedCopy(items: number[], n: number): number[] {
if (!items) return [];
if (items.length <= n) return items;
const elements = [items[0]];
const totalItems = items.length - 2;
const interval = Math.floor(totalItems / (n - 2));
Expand Down

0 comments on commit 69d7278

Please sign in to comment.