lib/utils.js
function compile_constraints(request, constraints) {
  const Constraints = require("./constraints")
  
  // Exit if there aren't any constraints.
  if (!constraints)
    return {}

  return new Constraints()
    .set_source(request)
    .set_rules(constraints)
    .compile()
    .results
}
function compile_constraints(request, constraints) {
  const Constraints = require("./constraints")
  
  // Exit if there aren't any constraints.
  if (!constraints)
    return {}

  return new Constraints()
    .set_source(request)
    .set_rules(constraints)
    .compile()
    .results
}
function compile_constraints ( request , constraints ) { const Constraints = require ( "./constraints" ) // Exit if there aren't any constraints. if ( ! constraints ) return { } return new Constraints ( ) . set_source ( request ) . set_rules ( constraints ) . compile ( ) . results }
Compile any constraints and return an object.
@param  {Hapi.Request} request to the server.
@param  {Waterline.Collection} collection to get constraints from.
@return {Object} compiled constraints.
Compile any constraints and return an object .