filepond-plugin-file-validate-size
Advanced tools
Comparing version 2.2.4 to 2.2.5
/*! | ||
* FilePondPluginFileValidateSize 2.2.4 | ||
* FilePondPluginFileValidateSize 2.2.5 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
@@ -60,3 +60,4 @@ * Please visit https://pqina.nl/filepond/ for details. | ||
'.', | ||
query('GET_FILE_SIZE_BASE') | ||
query('GET_FILE_SIZE_BASE'), | ||
query('GET_FILE_SIZE_LABELS', query) | ||
), | ||
@@ -79,3 +80,4 @@ }), | ||
'.', | ||
query('GET_FILE_SIZE_BASE') | ||
query('GET_FILE_SIZE_BASE'), | ||
query('GET_FILE_SIZE_LABELS', query) | ||
), | ||
@@ -102,3 +104,8 @@ }), | ||
sub: replaceInString(query('GET_LABEL_MAX_TOTAL_FILE_SIZE'), { | ||
filesize: toNaturalFileSize(totalSizeMax), | ||
filesize: toNaturalFileSize( | ||
totalSizeMax, | ||
'.', | ||
query('GET_FILE_SIZE_BASE'), | ||
query('GET_FILE_SIZE_LABELS', query) | ||
), | ||
}), | ||
@@ -105,0 +112,0 @@ }, |
/*! | ||
* FilePondPluginFileValidateSize 2.2.4 | ||
* FilePondPluginFileValidateSize 2.2.5 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
@@ -9,2 +9,2 @@ * Please visit https://pqina.nl/filepond/ for details. | ||
const e=({addFilter:e,utils:i})=>{const{Type:E,replaceInString:l,toNaturalFileSize:_}=i;return e("ALLOW_HOPPER_ITEM",(e,{query:i})=>{if(!i("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;const E=i("GET_MAX_FILE_SIZE");if(null!==E&&e.size>=E)return!1;const l=i("GET_MIN_FILE_SIZE");return!(null!==l&&e.size<=l)}),e("LOAD_FILE",(e,{query:i})=>new Promise((E,I)=>{if(!i("GET_ALLOW_FILE_SIZE_VALIDATION"))return E(e);const t=i("GET_FILE_VALIDATE_SIZE_FILTER");if(t&&!t(e))return E(e);const n=i("GET_MAX_FILE_SIZE");if(null!==n&&e.size>=n)return void I({status:{main:i("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MAX_FILE_SIZE"),{filesize:_(n,".",i("GET_FILE_SIZE_BASE"))})}});const L=i("GET_MIN_FILE_SIZE");if(null!==L&&e.size<=L)return void I({status:{main:i("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MIN_FILE_SIZE"),{filesize:_(L,".",i("GET_FILE_SIZE_BASE"))})}});const T=i("GET_MAX_TOTAL_FILE_SIZE");if(null!==T){if(i("GET_ACTIVE_ITEMS").reduce((e,i)=>e+i.fileSize,0)>T)return void I({status:{main:i("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:_(T)})}})}E(e)})),{options:{allowFileSizeValidation:[!0,E.BOOLEAN],maxFileSize:[null,E.INT],minFileSize:[null,E.INT],maxTotalFileSize:[null,E.INT],fileValidateSizeFilter:[null,E.FUNCTION],labelMinFileSizeExceeded:["File is too small",E.STRING],labelMinFileSize:["Minimum file size is {filesize}",E.STRING],labelMaxFileSizeExceeded:["File is too large",E.STRING],labelMaxFileSize:["Maximum file size is {filesize}",E.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",E.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",E.STRING]}}};"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e}));export default e; | ||
const e=({addFilter:e,utils:E})=>{const{Type:i,replaceInString:_,toNaturalFileSize:l}=E;return e("ALLOW_HOPPER_ITEM",(e,{query:E})=>{if(!E("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;const i=E("GET_MAX_FILE_SIZE");if(null!==i&&e.size>=i)return!1;const _=E("GET_MIN_FILE_SIZE");return!(null!==_&&e.size<=_)}),e("LOAD_FILE",(e,{query:E})=>new Promise((i,I)=>{if(!E("GET_ALLOW_FILE_SIZE_VALIDATION"))return i(e);const L=E("GET_FILE_VALIDATE_SIZE_FILTER");if(L&&!L(e))return i(e);const t=E("GET_MAX_FILE_SIZE");if(null!==t&&e.size>=t)return void I({status:{main:E("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:_(E("GET_LABEL_MAX_FILE_SIZE"),{filesize:l(t,".",E("GET_FILE_SIZE_BASE"),E("GET_FILE_SIZE_LABELS",E))})}});const n=E("GET_MIN_FILE_SIZE");if(null!==n&&e.size<=n)return void I({status:{main:E("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:_(E("GET_LABEL_MIN_FILE_SIZE"),{filesize:l(n,".",E("GET_FILE_SIZE_BASE"),E("GET_FILE_SIZE_LABELS",E))})}});const T=E("GET_MAX_TOTAL_FILE_SIZE");if(null!==T){if(E("GET_ACTIVE_ITEMS").reduce((e,E)=>e+E.fileSize,0)>T)return void I({status:{main:E("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:_(E("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:l(T,".",E("GET_FILE_SIZE_BASE"),E("GET_FILE_SIZE_LABELS",E))})}})}i(e)})),{options:{allowFileSizeValidation:[!0,i.BOOLEAN],maxFileSize:[null,i.INT],minFileSize:[null,i.INT],maxTotalFileSize:[null,i.INT],fileValidateSizeFilter:[null,i.FUNCTION],labelMinFileSizeExceeded:["File is too small",i.STRING],labelMinFileSize:["Minimum file size is {filesize}",i.STRING],labelMaxFileSizeExceeded:["File is too large",i.STRING],labelMaxFileSize:["Maximum file size is {filesize}",i.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",i.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",i.STRING]}}};"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e}));export default e; |
/*! | ||
* FilePondPluginFileValidateSize 2.2.4 | ||
* FilePondPluginFileValidateSize 2.2.5 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
@@ -73,3 +73,4 @@ * Please visit https://pqina.nl/filepond/ for details. | ||
'.', | ||
query('GET_FILE_SIZE_BASE') | ||
query('GET_FILE_SIZE_BASE'), | ||
query('GET_FILE_SIZE_LABELS', query) | ||
), | ||
@@ -93,3 +94,4 @@ }), | ||
'.', | ||
query('GET_FILE_SIZE_BASE') | ||
query('GET_FILE_SIZE_BASE'), | ||
query('GET_FILE_SIZE_LABELS', query) | ||
), | ||
@@ -117,3 +119,8 @@ }), | ||
sub: replaceInString(query('GET_LABEL_MAX_TOTAL_FILE_SIZE'), { | ||
filesize: toNaturalFileSize(totalSizeMax), | ||
filesize: toNaturalFileSize( | ||
totalSizeMax, | ||
'.', | ||
query('GET_FILE_SIZE_BASE'), | ||
query('GET_FILE_SIZE_LABELS', query) | ||
), | ||
}), | ||
@@ -120,0 +127,0 @@ }, |
/*! | ||
* FilePondPluginFileValidateSize 2.2.4 | ||
* FilePondPluginFileValidateSize 2.2.5 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
@@ -9,2 +9,2 @@ * Please visit https://pqina.nl/filepond/ for details. | ||
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(e=e||self).FilePondPluginFileValidateSize=i()}(this,function(){"use strict";var e=function(e){var i=e.addFilter,l=e.utils,E=l.Type,_=l.replaceInString,n=l.toNaturalFileSize;return i("ALLOW_HOPPER_ITEM",function(e,i){var l=i.query;if(!l("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;var E=l("GET_MAX_FILE_SIZE");if(null!==E&&e.size>=E)return!1;var _=l("GET_MIN_FILE_SIZE");return!(null!==_&&e.size<=_)}),i("LOAD_FILE",function(e,i){var l=i.query;return new Promise(function(i,E){if(!l("GET_ALLOW_FILE_SIZE_VALIDATION"))return i(e);var t=l("GET_FILE_VALIDATE_SIZE_FILTER");if(t&&!t(e))return i(e);var I=l("GET_MAX_FILE_SIZE");if(null!==I&&e.size>=I)E({status:{main:l("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:_(l("GET_LABEL_MAX_FILE_SIZE"),{filesize:n(I,".",l("GET_FILE_SIZE_BASE"))})}});else{var a=l("GET_MIN_FILE_SIZE");if(null!==a&&e.size<=a)E({status:{main:l("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:_(l("GET_LABEL_MIN_FILE_SIZE"),{filesize:n(a,".",l("GET_FILE_SIZE_BASE"))})}});else{var u=l("GET_MAX_TOTAL_FILE_SIZE");if(null!==u)if(l("GET_ACTIVE_ITEMS").reduce(function(e,i){return e+i.fileSize},0)>u)return void E({status:{main:l("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:_(l("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:n(u)})}});i(e)}}})}),{options:{allowFileSizeValidation:[!0,E.BOOLEAN],maxFileSize:[null,E.INT],minFileSize:[null,E.INT],maxTotalFileSize:[null,E.INT],fileValidateSizeFilter:[null,E.FUNCTION],labelMinFileSizeExceeded:["File is too small",E.STRING],labelMinFileSize:["Minimum file size is {filesize}",E.STRING],labelMaxFileSizeExceeded:["File is too large",E.STRING],labelMaxFileSize:["Maximum file size is {filesize}",E.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",E.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",E.STRING]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e}); | ||
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(e=e||self).FilePondPluginFileValidateSize=i()}(this,function(){"use strict";var e=function(e){var i=e.addFilter,E=e.utils,l=E.Type,_=E.replaceInString,n=E.toNaturalFileSize;return i("ALLOW_HOPPER_ITEM",function(e,i){var E=i.query;if(!E("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;var l=E("GET_MAX_FILE_SIZE");if(null!==l&&e.size>=l)return!1;var _=E("GET_MIN_FILE_SIZE");return!(null!==_&&e.size<=_)}),i("LOAD_FILE",function(e,i){var E=i.query;return new Promise(function(i,l){if(!E("GET_ALLOW_FILE_SIZE_VALIDATION"))return i(e);var I=E("GET_FILE_VALIDATE_SIZE_FILTER");if(I&&!I(e))return i(e);var t=E("GET_MAX_FILE_SIZE");if(null!==t&&e.size>=t)l({status:{main:E("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:_(E("GET_LABEL_MAX_FILE_SIZE"),{filesize:n(t,".",E("GET_FILE_SIZE_BASE"),E("GET_FILE_SIZE_LABELS",E))})}});else{var L=E("GET_MIN_FILE_SIZE");if(null!==L&&e.size<=L)l({status:{main:E("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:_(E("GET_LABEL_MIN_FILE_SIZE"),{filesize:n(L,".",E("GET_FILE_SIZE_BASE"),E("GET_FILE_SIZE_LABELS",E))})}});else{var a=E("GET_MAX_TOTAL_FILE_SIZE");if(null!==a)if(E("GET_ACTIVE_ITEMS").reduce(function(e,i){return e+i.fileSize},0)>a)return void l({status:{main:E("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:_(E("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:n(a,".",E("GET_FILE_SIZE_BASE"),E("GET_FILE_SIZE_LABELS",E))})}});i(e)}}})}),{options:{allowFileSizeValidation:[!0,l.BOOLEAN],maxFileSize:[null,l.INT],minFileSize:[null,l.INT],maxTotalFileSize:[null,l.INT],fileValidateSizeFilter:[null,l.FUNCTION],labelMinFileSizeExceeded:["File is too small",l.STRING],labelMinFileSize:["Minimum file size is {filesize}",l.STRING],labelMaxFileSizeExceeded:["File is too large",l.STRING],labelMaxFileSize:["Maximum file size is {filesize}",l.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",l.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",l.STRING]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e}); |
{ | ||
"name": "filepond-plugin-file-validate-size", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "File Size Validation Plugin for FilePond", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21085
328