<commit_before>
function databaseWalker(node) {
    var result = {};

    result.uuid = node.UUID;

    if (node.Name) {
        result.name = node.Name;
    }

    if (node.Entry) {
        var entry = node.Entry;
        if (!Array.isArray(entry)) { entry = [entry]; }
        result.entries = entry.map(databaseWalker);
    }

    if (node.Group) {
        var group = node.Group;
        if (!Array.isArray(group)) { group = [group]; }
        result.groups = group.map(databaseWalker);
    }

    if (node.String) {
        if (Array.isArray(node.String)) {
            node.String.forEach(function (item) {
                var key = item.Key.toLowerCase();
                if (key === 'password') {
                    result[key] = item.Value._;
                } else {
                    result[key] = item.Value;
                }
            });
        } else if (node.String && typeof node.String === 'object') {
            // String is an object and not null
            // attempt at solving issue #12 - assuming that the weird thing
            // we run into, which is not a list of "String" objects, is now
            // just a "String object"
            var item = node.String;
            var key = item.Key.toLowerCase();
            if (key === 'password') {
                result[key] = item.Value._;
            } else {
                result[key] = item.Value;
            }
        }
    }

    return result;
}

module.exports = function parseRawDatabase(rawDatabase) {
    rawDatabase = rawDatabase.KeePassFile.Root.Group;
    return databaseWalker(rawDatabase);
};<commit_msg>Revert "attempt to solve bug in #12"<commit_after>
function databaseWalker(node) {
    var result = {};

    result.uuid = node.UUID;

    if (node.Name) {
        result.name = node.Name;
    }

    if (node.Entry) {
        var entry = node.Entry;
        if (!Array.isArray(entry)) { entry = [entry]; }
        result.entries = entry.map(databaseWalker);
    }

    if (node.Group) {
        var group = node.Group;
        if (!Array.isArray(group)) { group = [group]; }
        result.groups = group.map(databaseWalker);
    }

    if (node.String) {
        node.String.forEach(function (item) {
            var key = item.Key.toLowerCase();
            if (key === 'password') {
                result[key] = item.Value._;
            } else {
                result[key] = item.Value;
            }
        });
    }

    return result;
}

module.exports = function parseRawDatabase(rawDatabase) {
    rawDatabase = rawDatabase.KeePassFile.Root.Group;
    return databaseWalker(rawDatabase);
};
{'fraction_non_alphanumeric': 0.12973593570608496, 'fraction_numerical': 0.0015308075009567547, 'mean_word_length': 1.7172557172557172, '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': '1743991', 'n_tokens_mistral': 767, 'n_tokens_neox': 746, 'n_words': 176}