1 line
4.9 KiB
JSON
1 line
4.9 KiB
JSON
|
{"ast":null,"code":"import warning from \"rc-util/es/warning\";\nexport default (function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = file.type || '';\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim();\n // This is something like */*,* allow all files\n if (/^\\*(\\/\\*)?$/.test(type)) {\n return true;\n }\n\n // like .jpg, .png\n if (validType.charAt(0) === '.') {\n var lowerFileName = fileName.toLowerCase();\n var lowerType = validType.toLowerCase();\n var affixList = [lowerType];\n if (lowerType === '.jpg' || lowerType === '.jpeg') {\n affixList = ['.jpg', '.jpeg'];\n }\n return affixList.some(function (affix) {\n return lowerFileName.endsWith(affix);\n });\n }\n\n // This is something like a image/* mime type\n if (/\\/\\*$/.test(validType)) {\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n // Full match\n if (mimeType === validType) {\n return true;\n }\n\n // Invalidate type should skip\n if (/^\\w+$/.test(validType)) {\n warning(false, \"Upload takes an invalidate 'accept' type '\".concat(validType, \"'.Skip for check.\"));\n return true;\n }\n return false;\n });\n }\n return true;\n});","map":{"version":3,"names":["warning","file","acceptedFiles","acceptedFilesArray","Array","isArray","split","fileName","name","mimeType","type","baseMimeType","replace","some","validType","trim","test","charAt","lowerFileName","toLowerCase","lowerType","affixList","affix","endsWith","concat"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-upload/es/attr-accept.js"],"sourcesContent":["import warning from \"rc-util/es/warning\";\nexport default (function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = file.type || '';\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim();\n // This is something like */*,* allow all files\n if (/^\\*(\\/\\*)?$/.test(type)) {\n return true;\n }\n\n // like .jpg, .png\n if (validType.charAt(0) === '.') {\n var lowerFileName = fileName.toLowerCase();\n var lowerType = validType.toLowerCase();\n var affixList = [lowerType];\n if (lowerType === '.jpg' || lowerType === '.jpeg') {\n affixList = ['.jpg', '.jpeg'];\n }\n return affixList.some(function (affix) {\n return lowerFileName.endsWith(affix);\n });\n }\n\n // This is something like a image/* mime type\n if (/\\/\\*$/.test(validType)) {\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n // Full match\n if (mimeType === validType) {\n return true;\n }\n\n // Invalidate type should skip\n if (/^\\w+$/.test(validType)) {\n warning(false, \"Upload takes an invalidate 'accept' type '\".concat(validType, \"'.Skip for check.\"));\n return true;\n }\n return false;\n });\n }\n return true;\n});"],"mappings":"AAAA,OAAOA,OAAO,MAAM,oBAAoB;AACxC,gBAAgB,UAAUC,IAAI,EAAEC,aAAa,EAAE;EAC7C,IAAID,IAAI,IAAIC,aAAa,EAAE;IACzB,IAAIC,kBAAkB,GAAGC,KAAK,CAACC,OAAO,CAACH,aAAa,CAAC,GAAGA,aAAa,GAAGA,aAAa,CAACI,KAAK,CAAC,GAAG,CAAC;IAChG,IAAIC,QAAQ,GAAGN,IAAI,CAACO,IAAI,IAAI,EAAE;IAC9B,IAAIC,QAAQ,GAAGR,IAAI,CAACS,IAAI,IAAI,EAAE;IAC9B,IAAIC,YAAY,GAAGF,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD,OAAOT,kBAAkB,CAACU,IAAI,CAAC,UAAUH,IAAI,EAAE;MAC7C,IAAII,SAAS,GAAGJ,IAAI,CAACK,IAAI,CAAC,CAAC;MAC3B;MACA,IAAI,aAAa,CAACC,IAAI,CAACN,IAAI,CAAC,EAAE;
|