Skip to content

Commit

Permalink
fix: check first and last point for xyGrowingX (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny authored Nov 3, 2024
1 parent f8904b1 commit e5a832f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/xy/xyGrowingX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function xyGrowingX(data: DataXY): DataXY {
throw new TypeError('length of x and y must be identical');
}

if (x.length < 2 || x[0] < x[1]) return data;
if (x.length < 2 || x[0] < x[x.at(-1) as number]) return data;

return {
x: x.slice(0).reverse(),
Expand Down

0 comments on commit e5a832f

Please sign in to comment.