<commit_before>import _ from 'lodash';

export default function canBeAsserted(vdom) {
    return _.all([].concat(vdom), node =>
        node
        && typeof node === 'object'
        && typeof node.type === 'string'
        && (!node.props || typeof node.props === 'object')
    );
}<commit_msg>Add validation for local component classes as well First try the official method, then fall-back to duck typing.<commit_after>import _ from 'lodash';
import React from 'react';

export default function canBeAsserted(vdom) {
    return _.all([].concat(vdom), node =>
        React.isValidElement(node) ||
        (node
        && typeof node === 'object'
        && typeof node.type === 'string'
        && (!node.props || typeof node.props === 'object'))
    );
}
{'fraction_non_alphanumeric': 0.1513157894736842, 'fraction_numerical': 0.0, 'mean_word_length': 2.9842931937172774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '318442', 'n_tokens_mistral': 215, 'n_tokens_neox': 213, 'n_words': 64}