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

fix: limit must allow infinity and max value #192

Merged
merged 1 commit into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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