Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
fix: limit must allow infinity and max value (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
threequartersjohn authored and evilebottnawi committed Oct 3, 2019
1 parent 1b9dbd1 commit 2bffcfd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ function shouldTransform(limit, size) {
return limit;
}

if (typeof limit === 'number' || typeof limit === 'string') {
if (typeof limit === 'string') {
return size <= parseInt(limit, 10);
}

if (typeof limit === 'number') {
return size <= limit;
}

return true;
}

Expand Down
Loading

0 comments on commit 2bffcfd

Please sign in to comment.