<commit_before>import React from 'react';


class TemplateCreator extends React.Component {
    static propTypes = {
        createTemplate: React.PropTypes.func.isRequired,
    }

    submit = () => {
        const validated = this.keys.every(key =>
             this.refs[key].value.length > 0
        );

        if (validated) {
            const template = {};
            this.keys.forEach(key => template[key] = this.refs[key].value);
            this.props.createTemplate(template);
            
            this.clearForm();
        }
    }<commit_msg>Trim whitespace on template save<commit_after>import React from 'react';


class TemplateCreator extends React.Component {
    static propTypes = {
        createTemplate: React.PropTypes.func.isRequired,
    }

    submit = () => {
        const validated = this.keys.every(key =>
             this.refs[key].value.trim().length > 0
        );

        if (validated) {
            const template = {};
            this.keys.forEach(key => template[key] = this.refs[key].value.trim());
            this.props.createTemplate(template);
            
            this.clearForm();
        }
    }
{'fraction_non_alphanumeric': 0.12294372294372294, 'fraction_numerical': 0.0017316017316017316, 'mean_word_length': 1.9118387909319898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7042965', 'n_tokens_mistral': 323, 'n_tokens_neox': 306, 'n_words': 58}