<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import getIn from '@mzvonar/getin';
import isEvent from './../utils/isEvent';
import getPath from './../utils/getPath';
import deepEqual from 'deep-equal';

function deleteChildren(object, children) {
    let deleted = {};

    for(let i = 0, length = children.length; i < length; i += 1) {
        const key = children[i];
        if(Object.prototype.hasOwnProperty.call(object, key)) {
            deleted[key] = object[key];
            delete object[key];
        }
    }

    return deleted;
}

function cleanComponentProps(value, props) {
    const componentProps = Object.assign({}, props);

    const input = componentProps.input;
    // const value = componentProps.value;

    deleteChildren(componentProps, [
        'component',
        '_mrf',
        'input',
        'value',
        'validate',
        'formSubmitted',
        'readOnly',
        'disabled'
    ]);

    const inputProps = {};

    if(componentProps.type === 'radio') {
        inputProps.checked = value === componentProps.value;
    }
    else if(componentProps.type === 'checkbox') {
        inputProps.checked = !!value;
    }
    else {
        inputProps.value = value || /*(!props.input.dirty ? props.initialValue : '') ||*/ '';
    }
<commit_msg>Fixed incorrectly interpreting zero as no value<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import getIn from '@mzvonar/getin';
import isEvent from './../utils/isEvent';
import getPath from './../utils/getPath';
import deepEqual from 'deep-equal';

function deleteChildren(object, children) {
    let deleted = {};

    for(let i = 0, length = children.length; i < length; i += 1) {
        const key = children[i];
        if(Object.prototype.hasOwnProperty.call(object, key)) {
            deleted[key] = object[key];
            delete object[key];
        }
    }

    return deleted;
}

function cleanComponentProps(value, props) {
    const componentProps = Object.assign({}, props);

    const input = componentProps.input;
    // const value = componentProps.value;

    deleteChildren(componentProps, [
        'component',
        '_mrf',
        'input',
        'value',
        'validate',
        'formSubmitted',
        'readOnly',
        'disabled'
    ]);

    const inputProps = {};

    if(componentProps.type === 'radio') {
        inputProps.checked = value === componentProps.value;
    }
    else if(componentProps.type === 'checkbox') {
        inputProps.checked = !!value;
    }
    else {
        inputProps.value = typeof value !== 'undefined' ? value : /*(!props.input.dirty ? props.initialValue : '') ||*/ '';
    }

{'fraction_non_alphanumeric': 0.14548736462093864, 'fraction_numerical': 0.001444043321299639, 'mean_word_length': 2.617493472584856, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6938234', 'n_tokens_mistral': 799, 'n_tokens_neox': 783, 'n_words': 193}