 errors = require './errors'
 koding = require '../../bongo'
+
+SUGGESTED_USERNAME_MIN_LENGTH = 4
+SUGGESTED_USERNAME_MAX_LENGTH = 15
 
 sendApiError = (res, error) ->
 

  { JUser } = koding.models
  { minLength, maxLength } = JUser.getValidUsernameLengthRange()

  if minLength <= username?.length <= maxLength
  then yes
  else no



module.exports = {
  sendApiError
  sendApiResponse
  isUsernameLengthValid
  checkApiAvailability
  isSuggestedUsernameLengthValid
}


    return callback null


isSuggestedUsernameLengthValid = (suggestedUsername) ->

  return SUGGESTED_USERNAME_MIN_LENGTH <= suggestedUsername?.length <= SUGGESTED_USERNAME_MAX_LENGTH


isUsernameLengthValid = (username) ->
