<commit_before>import React from 'react';
import classNames from 'classnames';
import deprecationWarning from '../../utils/deprecationWarning';

const deprecateValue = {
    'safe_success': 'safe-success',
    'safe_warn': 'safe-warn',
    'success_circle': 'success-circle',
    'success_no_circle': 'success-no-circle',
    'waiting_circle': 'waiting-circle',
    'info_circle': 'info-circle'
};

/**
 * WeUI Icons
 *
 */
class Icon extends React.Component {
    static propTypes = {
        /**
         * types of [weui icons](https://github.com/weui/weui/wiki/Icon)
         *
         */
        value: React.PropTypes.string,
        /**
         * size of icon, options: small/large
         *
         */
        size: React.PropTypes.string
    };

    static defaultProps = {
        value: 'success',
        size: 'small'
    };

    render() {
        const {value, size, className, primary, ...others} = this.props;

        if (Object.keys(deprecateValue).find(v=> v === value)){
            deprecationWarning(`Icon ${value}`, `Icon ${deprecateValue[value]}`);
        }

        const cls = classNames({
            ['weui-icon-' + value]: value !== 'loading',
            'weui-icon_msg': size === 'large' && !primary,
            'weui-icon_msg-primary': size === 'large' && primary,
            'weui-loading': value === 'loading',
            [className]: className
        });
<commit_msg>Fix: `Array.prototype.find` throw error in some device<commit_after>import React from 'react';
import classNames from 'classnames';
import deprecationWarning from '../../utils/deprecationWarning';

const deprecateValue = {
    'safe_success': 'safe-success',
    'safe_warn': 'safe-warn',
    'success_circle': 'success-circle',
    'success_no_circle': 'success-no-circle',
    'waiting_circle': 'waiting-circle',
    'info_circle': 'info-circle'
};

/**
 * WeUI Icons
 *
 */
class Icon extends React.Component {
    static propTypes = {
        /**
         * types of [weui icons](https://github.com/weui/weui/wiki/Icon)
         *
         */
        value: React.PropTypes.string,
        /**
         * size of icon, options: small/large
         *
         */
        size: React.PropTypes.string
    };

    static defaultProps = {
        value: 'success',
        size: 'small'
    };

    render() {
        const {value, size, className, primary, ...others} = this.props;

        if (Object.keys(deprecateValue).indexOf(value) !== -1){
            deprecationWarning(`Icon ${value}`, `Icon ${deprecateValue[value]}`);
        }

        const cls = classNames({
            ['weui-icon-' + value]: value !== 'loading',
            'weui-icon_msg': size === 'large' && !primary,
            'weui-icon_msg-primary': size === 'large' && primary,
            'weui-loading': value === 'loading',
            [className]: className
        });

{'fraction_non_alphanumeric': 0.1619546247818499, 'fraction_numerical': 0.00034904013961605586, 'mean_word_length': 2.253121452894438, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '2200157', 'n_tokens_mistral': 860, 'n_tokens_neox': 853, 'n_words': 183}