lib/database/query.js
function mergeQueries(query, options) {
  if (options == null) {
    return query;
  }

  Object.keys(options).forEach(key => {
    let label = key;
    let value = options[key];

    validateProp(key, value);

    switch (key) {
    case 'orderByKey':
      label = orderedBy;
      value = orderByKey;
      break;

    case 'orderByPriority':
      label = orderedBy;
      value = orderByPriority;
      break;

    case 'orderByValue':
      label = orderedBy;
      value = orderByValue;
      break;

    case 'orderByChild':
      label = orderedBy;
      break;

    default:
      break;
    }

    query[label] = value;
  });

  return query;
}
function mergeQueries(query, options) {
  if (options == null) {
    return query;
  }

  Object.keys(options).forEach(key => {
    let label = key;
    let value = options[key];

    validateProp(key, value);

    switch (key) {
    case 'orderByKey':
      label = orderedBy;
      value = orderByKey;
      break;

    case 'orderByPriority':
      label = orderedBy;
      value = orderByPriority;
      break;

    case 'orderByValue':
      label = orderedBy;
      value = orderByValue;
      break;

    case 'orderByChild':
      label = orderedBy;
      break;

    default:
      break;
    }

    query[label] = value;
  });

  return query;
}
function mergeQueries ( query , options ) { if ( options == null ) { return query ; } Object . keys ( options ) . forEach ( key => { let label = key ; let value = options [ key ] ; validateProp ( key , value ) ; switch ( key ) { case 'orderByKey' : label = orderedBy ; value = orderByKey ; break ; case 'orderByPriority' : label = orderedBy ; value = orderByPriority ; break ; case 'orderByValue' : label = orderedBy ; value = orderByValue ; break ; case 'orderByChild' : label = orderedBy ; break ; default : break ; } query [ label ] = value ; } ) ; return query ; }
Validate and merge partial query parameters to a query object.

@param {Query} query Query to merges properties to
@param {Partial<Query>} options Partial query parameters
@returns {Query}
Validate and merge partial query parameters to a query object .