rudiment.js
function(db) {
    if (!db.type) {
      return defaultDbType;
    }

    return dbTypes.find(function(dbType) {
      return dbType.name === db.type;
    }) || null;
  }
function(db) {
    if (!db.type) {
      return defaultDbType;
    }

    return dbTypes.find(function(dbType) {
      return dbType.name === db.type;
    }) || null;
  }
function ( db ) { if ( ! db . type ) { return defaultDbType ; } return dbTypes . find ( function ( dbType ) { return dbType . name === db . type ; } ) || null ; }
Given a database object, get the database type

@param {Object} db - database object passed to Rudiment constructor
@return {Object|null} object from dbTypes
Given a database object get the database type