@lahzenegar/react-drop-n-crop
Version:
A combined implementation of react-dropzone and react-cropper (translated to farsi)
20 lines (15 loc) • 577 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _lodash = require('lodash.includes');
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (types, message) {
return function (value) {
return {
isValid: (value instanceof Array || value instanceof Object) && value[0] instanceof File && (0, _lodash2.default)(types, value[0].type),
message: message || 'نوع فایل مجاز نیست!'
};
};
};