UNPKG

@synapsestudios/react-drop-n-crop

Version:

A combined implementation of react-dropzone and react-cropper

20 lines (15 loc) 560 B
'use strict'; 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 || 'Invalid file type' }; }; };