<commit_before>import noVelocity from './noVelocity';
import hasReachedStyle from './hasReachedStyle';
import mergeDiff from './mergeDiff';
import configAnimation from './animationLoop';
import zero from './zero';
import {interpolateValue, updateCurrentStyle, updateCurrentVelocity} from './updateTree';
import deprecatedSprings from './deprecatedSprings';
import stripStyle from './stripStyle';

const startAnimation = configAnimation();

function mapObject(f, obj) {
  let ret = {};
  for (let key in obj) {
    if (!obj.hasOwnProperty(key)) {
      continue;
    }
    ret[key] = f(obj[key], key);
  }
  return ret;
}

function everyObj(f, obj) {
  for (let key in obj) {
    if (!obj.hasOwnProperty(key)) {
      continue;
    }
    if (!f(obj[key], key)) {
      return false;
    }
  }
  return true;
}

export default function components(React) {
  const {PropTypes} = React;

  const Motion = React.createClass({
    // TODO: check props, provide more descriptive warning.
    // warn against endValue/defaultValue
    propTypes: {
      // TOOD: warn against putting a config in here
      defaultStyle: PropTypes.object,
      style: PropTypes.object,
      children: PropTypes.func,
    },

    getInitialState() {
      const {defaultStyle, style} = this.props;
      const currentStyle = defaultStyle || style;
      return {
        currentStyle: currentStyle,
        currentVelocity: mapObject(zero, currentStyle),<commit_msg>Make Motion `style` propType required<commit_after>import noVelocity from './noVelocity';
import hasReachedStyle from './hasReachedStyle';
import mergeDiff from './mergeDiff';
import configAnimation from './animationLoop';
import zero from './zero';
import {interpolateValue, updateCurrentStyle, updateCurrentVelocity} from './updateTree';
import deprecatedSprings from './deprecatedSprings';
import stripStyle from './stripStyle';

const startAnimation = configAnimation();

function mapObject(f, obj) {
  let ret = {};
  for (let key in obj) {
    if (!obj.hasOwnProperty(key)) {
      continue;
    }
    ret[key] = f(obj[key], key);
  }
  return ret;
}

function everyObj(f, obj) {
  for (let key in obj) {
    if (!obj.hasOwnProperty(key)) {
      continue;
    }
    if (!f(obj[key], key)) {
      return false;
    }
  }
  return true;
}

export default function components(React) {
  const {PropTypes} = React;

  const Motion = React.createClass({
    // TODO: check props, provide more descriptive warning.
    // warn against endValue/defaultValue
    propTypes: {
      // TOOD: warn against putting a config in here
      defaultStyle: PropTypes.object,
      style: PropTypes.object.isRequired,
      children: PropTypes.func,
    },

    getInitialState() {
      const {defaultStyle, style} = this.props;
      const currentStyle = defaultStyle || style;
      return {
        currentStyle: currentStyle,
        currentVelocity: mapObject(zero, currentStyle),
{'fraction_non_alphanumeric': 0.11682082905104488, 'fraction_numerical': 0.0, 'mean_word_length': 3.3582089552238807, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3990921', 'n_tokens_mistral': 838, 'n_tokens_neox': 838, 'n_words': 249}