media-helper.js
function isImage (path) {
  return new Promise((resolve, reject) => {
    getMimeType(path)
      .then((type) => {
        ;(type.indexOf('image') > -1) ? resolve(true) : resolve(false)
      })
      .catch(err => reject(err))
  })
}
function isImage (path) {
  return new Promise((resolve, reject) => {
    getMimeType(path)
      .then((type) => {
        ;(type.indexOf('image') > -1) ? resolve(true) : resolve(false)
      })
      .catch(err => reject(err))
  })
}
function isImage ( path ) { return new Promise ( ( resolve , reject ) => { getMimeType ( path ) . then ( ( type ) => { ; ( type . indexOf ( 'image' ) > - 1 ) ? resolve ( true ) : resolve ( false ) } ) . catch ( err => reject ( err ) ) } ) }
Determines if a file is an image
@param {string} path - Path to a file
@returns {Promise}
Determines if a file is an image