src/databaseUtil.js
/**
 * This function takes a list of SQL column names and returns a mapping from
 * SQL column names to JS names.
 *
 * Example: If `columnList` is given as:
 * ```
 * [
 *    'id',
 *    'meta_entry_user_id',
 *    'meta_entry_user_company_id',
 *    'is_template'
 * ]
 * ```
 * then the return value will be:
 * ```
 * {
 *    'id': 'id',
 *    'meta_entry_user_id': 'metaEntryUserId',
 *    'meta_entry_user_company_id': 'metaEntryUserCompanyId',
 *    'is_template': 'isTemplate'
 * }
 * ```
 *
 * @memberof module:databaseUtil
 * @public
 *
 * @param {String[]} columnList
 *    An array of SQL column names, as they appear in the actual tables.
 *
 * @returns {Object}
 *    A mapping from SQL column name to its equivalent in JS naming conventions.
 */
This function takes a list of SQL column names and returns a mapping from
SQL column names to JS names.



@memberof module:databaseUtil
@public

@param {String[]} columnList
An array of SQL column names, as they appear in the actual tables.

@returns {Object}
A mapping from SQL column name to its equivalent in JS naming conventions.
This function takes a list of SQL column names and returns a mapping from SQL column names to JS names . @memberof module : databaseUtil @public @param { String [] } columnList An array of SQL column names as they appear in the actual tables . @returns { Object } A mapping from SQL column name to its equivalent in JS naming conventions .
function columnList2ColumnMap(columnList) {
  return _.reduce(columnList, function(result, sqlName) {
    result[sqlName] = sqlName2JsName(sqlName);
    return result;
  }, {});
}
function columnList2ColumnMap ( columnList ) { return _ . reduce ( columnList , function ( result , sqlName ) { result [ sqlName ] = sqlName2JsName ( sqlName ) ; return result ; } , { } ) ; }
This function takes a list of SQL column names and returns a mapping from
 SQL column names to JS names.
This function takes a list of SQL column names and returns a mapping from SQL column names to JS names .