<commit_before><commit_msg>created as a stopgap measure for dealing with the fact that my client's requests were turning the booleans and integers into strings within the object I was sending, Googled around and couldn't find a better solution, but I may revisit this issue when I'm older and wiser<commit_after>"use strict";

exports.destringify = function destringify(game_state) {

    for (var attribute in game_state.character) {
        if (game_state.character[attribute] === "false") {
            game_state.character[attribute] = false;
        } else if (game_state.character[attribute] === "true") {    
            game_state.character[attribute] = true;
        } else if (!isNaN(parseInt(game_state.character[attribute]))) {
            game_state.character[attribute] = 
            parseInt(game_state.character[attribute]);
        }
    }

    for (var item in game_state.character.items) {
        game_state.character.items[item] =
        parseInt(game_state.character.items[item]);
    }

    for (var person in game_state.persons) {

        if (game_state.persons[person].alive === "true") {
            game_state.persons[person].alive = true;
        } else {
            game_state.persons[person].alive = false; 
        }

        game_state.persons[person].attack =
        parseInt(game_state.persons[person].attack);

        game_state.persons[person].attracted =
        parseInt(game_state.persons[person].attracted);

    } 

    for (var place in game_state.places) {

        if (game_state.places[place].burnable === "true") {
            game_state.places[place].burnable = true;
        } else {
            game_state.places[place].burnable = false;
        }

        if (game_state.places[place].locked === "true") {
            game_state.places[place].locked = true;
        } else {
            game_state.places[place].locked = false;
        }

        if (game_state.places[place].outside === "true") {
            game_state.places[place].outside = true;
        } else {
            game_state.places[place].outside = false;
        }

        if (game_state.places[place].populated === "true") {
            game_state.places[place].populated = true;
        } else {
            game_state.places[place].populated = false;
        }

        if (game_state.places[place].town === "true") {
            game_state.places[place].town = true;
        } else {
            game_state.places[place].town = false;
        }

        if (game_state.places[place].trashable === "true") {
            game_state.places[place].trashable = true;
        } else {
            game_state.places[place].trashable = false;
        }

    }
}
{'fraction_non_alphanumeric': 0.12010443864229765, 'fraction_numerical': 0.0, 'mean_word_length': 2.315203955500618, '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': '6799862', 'n_tokens_mistral': 808, 'n_tokens_neox': 762, 'n_words': 149}