<commit_before>var _      = require('lodash')
var config = require('../../config')
var error  = require('../../error')
var router = require('express').Router()
var User   = require('../../models/User')
var fields = ['username', 'gravatarId', 'bio', 'teamspeakOnline', 'teamspeakConnections', 'teamspeakLinked', 'teamspeakRank', 'createdAt']

/**
 * Sanitize user profile
 */
function makeUserObject(user, url) {
  user = _.pick(user, fields)

  if(!user.teamspeakLinked)
    user.teamspeakOnline = null

  if(!user.teamspeakLinked || !user.teamspeakOnline)
    user.teamspeakConnections = []

  user.url     = config.url + url
  user.htmlUrl = config.url + '/' + user.username

  return user
}

/**
 * Username param
 */<commit_msg>API: Fix users listing<commit_after>var _      = require('lodash')
var config = require('../../config')
var error  = require('../../error')
var router = require('express').Router()
var User   = require('../../models/User')
var fields = ['username', 'gravatarId', 'bio', 'teamspeakUid', 'teamspeakOnline', 'teamspeakConnections', 'teamspeakLinked', 'teamspeakRank', 'createdAt']

/**
 * Sanitize user profile
 */
function makeUserObject(user, url) {
  user = _.pick(user, fields)

  if(!user.teamspeakLinked)
    user.teamspeakOnline = null

  if(!user.teamspeakLinked || !user.teamspeakOnline)
    user.teamspeakConnections = []

  user.url     = config.url + url
  user.htmlUrl = config.url + '/' + user.username

  return user
}

/**
 * Username param
 */
{'fraction_non_alphanumeric': 0.17595701813297515, 'fraction_numerical': 0.0, 'mean_word_length': 3.822006472491909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2857626', 'n_tokens_mistral': 509, 'n_tokens_neox': 475, 'n_words': 102}