Skip to content

Commit

Permalink
refactor: remove unused parameter in math.ts:divide
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchal committed Feb 1, 2022
1 parent ebfc329 commit 744507d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ export const divide = (overlap = 1) =>
/**
* Use with array.map() to generate the divided scales.
*/
<T>(value: T, index: number, array: number | T[]) => {
const divisions = typeof array === 'number' ? array : array.length;
const unit = 1 / divisions;
<T>(value: T, index: number, array: T[]) => {
const unit = 1 / array.length;
const min = index * unit;
const max = min + unit * overlap;
return [value, scale(min, max)] as const;
Expand Down

0 comments on commit 744507d

Please sign in to comment.