Skip to content

Commit

Permalink
fix: remove throw on empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienIzz committed Sep 18, 2024
1 parent 2e977e6 commit 5ffeda3
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
const getMinSizeOfItems = <T>(data: T[], itemSize: number | ((item: T) => number)) => {
if (data.length === 0) {
throw new Error('The data array is empty.');
}

if (typeof itemSize === 'number') {
return itemSize;
}
Expand Down

0 comments on commit 5ffeda3

Please sign in to comment.