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 17, 2024
1 parent dbfc0f3 commit 2f518fb
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 2f518fb

Please sign in to comment.