<commit_before>import Matches from "./matches";

// Maps symbols to matches.
const SYMBOL_MATCHES = {
    "#": Matches.id,
    ".": Matches.className
};

// TODO: Use better variables names.
function ReactShallowQuery(object, query) {
    var fragments = query.split(" ");
    var results = [object];
    var recursive = true;

    // Loop through each fragement.
    // TODO: Use Array.reduce.
    fragments.forEach((fragment, index) => {
        var prefix = fragment.charAt(0);
        var newResults = [];
        var matcher;
        
        if (fragment == ">") 
            return recursive = false;

        // Handle prefix symbols.<commit_msg>Fixed a bug where passing in an array of objects would throw an error.<commit_after>import Matches from "./matches";

// Maps symbols to matches.
const SYMBOL_MATCHES = {
    "#": Matches.id,
    ".": Matches.className
};

// TODO: Use better variables names.
function ReactShallowQuery(object, query) {
    var results = Array.isArray(object) ? object : [object];
    var fragments = query.split(" ");
    var recursive = true;

    // Loop through each fragement.
    // TODO: Use Array.reduce.
    fragments.forEach((fragment, index) => {
        var prefix = fragment.charAt(0);
        var newResults = [];
        var matcher;
        
        if (fragment == ">") 
            return recursive = false;

        // Handle prefix symbols.
{'fraction_non_alphanumeric': 0.12589413447782546, 'fraction_numerical': 0.001430615164520744, 'mean_word_length': 2.3792270531400965, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 7, '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': '1915216', 'n_tokens_mistral': 398, 'n_tokens_neox': 382, 'n_words': 120}