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

Commit 2bffcfd

Browse files
threequartersjohnevilebottnawi
authored andcommitted
fix: limit must allow infinity and max value (#192)
1 parent 1b9dbd1 commit 2bffcfd

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ function shouldTransform(limit, size) {
1616
return limit;
1717
}
1818

19-
if (typeof limit === 'number' || typeof limit === 'string') {
19+
if (typeof limit === 'string') {
2020
return size <= parseInt(limit, 10);
2121
}
2222

23+
if (typeof limit === 'number') {
24+
return size <= limit;
25+
}
26+
2327
return true;
2428
}
2529

0 commit comments

Comments
 (0)