<commit_before>/** Ben (OutdatedVersion) | Apr/29/2017 (11:20 PM) */

import assert from 'assert'
import Debug from 'debug'
import * as config from './config.json'


/**
 * Pretty console printing
 */
const debug = Debug('api:server')

/**
 * Removes the dashes in a UUID
 *
 * @param uuid the unique id for a player
 * @returns {string} the uuid but stripped of dashes
 */
let undash = (uuid) =>
{
    assert(typeof uuid === 'string', 'uuid must be provided as a string')

    return uuid.replace(/-/g, '')
}

/**
 * Add the dashes back into a
 * naked UUID
 *
 * @param val the plain UUID
 * @returns {string} the freshly dashed unique id
 */
let dash = (val) =>
{
    assert(typeof val === 'string', 'we need to work with a string')

    // ok well this is confusing
    return val.substr(0, 8) + '-' + val.substr(8, 11) + '-' + val.substr(11, 18) + '-' + val.substr(19, 23) + '-' + val.substr(24, 36)
}

/**
 * Checks whether the provided String
 * is a valid UUID
 *
 * @param val the string
 * @returns {boolean} yes or no
 */
let isUUID = (val) =>
{
    assert(typeof val === 'string', 'we can only verify a string')

    return val.match(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
}

/**
 * Checks whether the provided String
 * is a valid Minecraft username
 *
 * @param val the string
 * @returns {boolean} yes or no
 */
let isValidUsername = (val) =>
{
    assert(typeof val === 'string', 'we can only verify a string')

    return val.match(/[a-zA-Z0-9_]{1,16}$/)
}


export default {
    debug,
    undash,
    dash,
    isUUID,
    isValidUsername,
    config
}<commit_msg>Switch how we export stuff to clean up space<commit_after>/** Ben (OutdatedVersion) | Apr/29/2017 (11:20 PM) */

import assert from 'assert'
import Debug from 'debug'
import * as config from './config.json'

// make publicly available
export default config

/**
 * Pretty console printing
 */
export default debug = Debug('api:server')

/**
 * Removes the dashes in a UUID
 *
 * @param uuid the unique id for a player
 * @returns {string} the uuid but stripped of dashes
 */
export default undash = (uuid) =>
{
    assert(typeof uuid === 'string', 'uuid must be provided as a string')

    return uuid.replace(/-/g, '')
}

/**
 * Add the dashes back into a
 * naked UUID
 *
 * @param val the plain UUID
 * @returns {string} the freshly dashed unique id
 */
export default dash = (val) =>
{
    assert(typeof val === 'string', 'we need to work with a string')

    // ok well this is confusing
    return val.substr(0, 8) + '-' + val.substr(8, 11) + '-' + val.substr(11, 18) + '-' + val.substr(19, 23) + '-' + val.substr(24, 36)
}

/**
 * Checks whether the provided String
 * is a valid UUID
 *
 * @param val the string
 * @returns {boolean} yes or no
 */
export default isUUID = (val) =>
{
    assert(typeof val === 'string', 'we can only verify a string')

    return val.match(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
}

/**
 * Checks whether the provided String
 * is a valid Minecraft username
 *
 * @param val the string
 * @returns {boolean} yes or no
 */
export default isValidUsername = (val) =>
{
    assert(typeof val === 'string', 'we can only verify a string')

    return val.match(/[a-zA-Z0-9_]{1,16}$/)
}
{'fraction_non_alphanumeric': 0.1682442748091603, 'fraction_numerical': 0.03114503816793893, 'mean_word_length': 3.1001251564455568, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '298575', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1127, 'n_words': 379}