function deleteFile(firebase, { path, dbPath }) {
  return firebase
    .storage()
    .ref(path)
    .delete()
    .then(() => {
      // return path if dbPath or a database does not exist
      if (!dbPath || (!firebase.database && !firebase.firestore)) {
        return { path }
      }

      // Choose delete function based on config (Handling Firestore and RTDB)
      const metaDeletePromise = () =>
        firebase._.config.useFirestoreForStorageMeta
          ? firebase.firestore().doc(dbPath).delete() // file meta in Firestore
          : firebase.database().ref(dbPath).remove() // file meta in RTDB

      return metaDeletePromise().then(() => ({ path, dbPath }))
    })
}
Delete file from Firebase Storage with support for deleteing meta
data from database (either Real Time Database or Firestore depending on
config)
@param {object} firebase - Internal firebase object
@param {object} settings - Settings object
@param {string} settings.path - Path to File which should be deleted
@param {string} settings.dbPath - Path of meta data with Database (Real Time Or
Firestore depnding on config)
@returns {Promise} Resolves with path and dbPath