Skip to content

Commit 42a70b4

Browse files
authored
Merge pull request #26 from iadcode/minMaxRange
Allow files of size minFileSize or maxFileSize
2 parents 7eb9452 + 1f94063 commit 42a70b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/js/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ const plugin = ({ addFilter, utils }) => {
99
}
1010

1111
const sizeMax = query('GET_MAX_FILE_SIZE');
12-
if (sizeMax !== null && file.size >= sizeMax) {
12+
if (sizeMax !== null && file.size > sizeMax) {
1313
return false;
1414
}
1515

1616
const sizeMin = query('GET_MIN_FILE_SIZE');
17-
if (sizeMin !== null && file.size <= sizeMin) {
17+
if (sizeMin !== null && file.size < sizeMin) {
1818
return false;
1919
}
2020

@@ -41,7 +41,7 @@ const plugin = ({ addFilter, utils }) => {
4141

4242
// reject or resolve based on file size
4343
const sizeMax = query('GET_MAX_FILE_SIZE');
44-
if (sizeMax !== null && file.size >= sizeMax) {
44+
if (sizeMax !== null && file.size > sizeMax) {
4545
reject({
4646
status: {
4747
main: query('GET_LABEL_MAX_FILE_SIZE_EXCEEDED'),
@@ -60,7 +60,7 @@ const plugin = ({ addFilter, utils }) => {
6060

6161
// reject or resolve based on file size
6262
const sizeMin = query('GET_MIN_FILE_SIZE');
63-
if (sizeMin !== null && file.size <= sizeMin) {
63+
if (sizeMin !== null && file.size < sizeMin) {
6464
reject({
6565
status: {
6666
main: query('GET_LABEL_MIN_FILE_SIZE_EXCEEDED'),

0 commit comments

Comments
 (0)