react-dropzone / attr-accept

JavaScript implementation of the "accept" attribute for HTML5 input element
MIT License
110 stars 24 forks source link

fix(types): make `acceptedFiles` optional #59

Closed iamandrewluca closed 3 years ago

iamandrewluca commented 3 years ago

From implementation we can see that acceptedFiles can be optional.
This change would allow to pass undefined to second param

import attrAccept from 'attr-accept'

export function validate(file: File, accept: string | undefined) {
  return attrAccept(file, accept)
}