<commit_before>var keys = require("./keys.js")

module.exports = size

function size(obj) {
    if (obj == null) {
        return 0
    }

    if (obj.length === +obj.length) {
        return obj.length
    } else {
        return keys(obj).length
    }
}<commit_msg>replace if with ternary in size function<commit_after>var keys = require("./keys.js")

module.exports = size

function size(obj) {
    if (obj == null) {
        return 0
    }

    return (obj.length === +obj.length) ? obj.length : keys(obj).length
}
{'fraction_non_alphanumeric': 0.14671814671814673, 'fraction_numerical': 0.003861003861003861, 'mean_word_length': 2.46, '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': '4052182', 'n_tokens_mistral': 174, 'n_tokens_neox': 167, 'n_words': 43}