rc-upload
Advanced tools
Comparing version 4.2.0 to 4.2.1
@@ -1,5 +0,1 @@ | ||
function endsWith(str, suffix) { | ||
return str.indexOf(suffix, str.length - suffix.length) !== -1; | ||
} | ||
export default (function (file, acceptedFiles) { | ||
@@ -19,3 +15,13 @@ if (file && acceptedFiles) { | ||
if (validType.charAt(0) === '.') { | ||
return endsWith(fileName.toLowerCase(), validType.toLowerCase()); | ||
var lowerFileName = fileName.toLowerCase(); | ||
var lowerType = validType.toLowerCase(); | ||
var affixList = [lowerType]; | ||
if (lowerType === '.jpg' || lowerType === '.jpeg') { | ||
affixList = ['.jpg', 'jpeg']; | ||
} | ||
return affixList.some(function (affix) { | ||
return lowerFileName.endsWith(affix); | ||
}); | ||
} | ||
@@ -22,0 +28,0 @@ |
@@ -8,6 +8,2 @@ "use strict"; | ||
function endsWith(str, suffix) { | ||
return str.indexOf(suffix, str.length - suffix.length) !== -1; | ||
} | ||
var _default = function _default(file, acceptedFiles) { | ||
@@ -27,3 +23,13 @@ if (file && acceptedFiles) { | ||
if (validType.charAt(0) === '.') { | ||
return endsWith(fileName.toLowerCase(), validType.toLowerCase()); | ||
var lowerFileName = fileName.toLowerCase(); | ||
var lowerType = validType.toLowerCase(); | ||
var affixList = [lowerType]; | ||
if (lowerType === '.jpg' || lowerType === '.jpeg') { | ||
affixList = ['.jpg', 'jpeg']; | ||
} | ||
return affixList.some(function (affix) { | ||
return lowerFileName.endsWith(affix); | ||
}); | ||
} | ||
@@ -30,0 +36,0 @@ |
{ | ||
"name": "rc-upload", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "upload ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
61609
1496