UNPKG

react-file-previewer

Version:

A browser/device-agnostic file previewer for PDF and image file types built on top of React-PDF.

15 lines (12 loc) 251 B
import * as R from 'ramda'; /** * Check if a file is a pdf. * * @param {Object} * @return {Boolean} */ const isPDF = R.either( R.o(R.endsWith('.pdf'), R.propOr('', 'url')), R.propEq('mimeType', 'application/pdf'), ); export default isPDF;