<commit_before>import _                    from 'lodash';
import approximator         from '../../lib/approximator';
import error                from '../../lib/error';
import fragment             from '../../lib/fragment';
import route                from '../../lib/route';
import vars                 from '../../lib/vars';
import dataStores           from './lib/data-stores';
import transientInitializer from './lib/transient-initializer';

export default stateParams => 
  new Promise((resolve, reject) => {
    let {direct: directParams, route: routeParams, name: stateName, routeValues, silent} = stateParams;
    let stateConfigs = vars.states.registry[stateName];
    
    delete stateParams.useResolves;
    
    if(vars.configs.showRuntime && !stateConfigs.transient) {
      stateParams.time = _.now();
    }
  
    if(!stateConfigs) {
      error.throw(`invalid [${stateName}] state name`, 'initializer');
    }
    
    if(_.isObject(stateConfigs.transient)) {
      _.extend(stateParams, _.pick(stateConfigs.transient, ['noResolves']));
    }<commit_msg>Remove reject()<commit_after>import _                    from 'lodash';
import approximator         from '../../lib/approximator';
import error                from '../../lib/error';
import fragment             from '../../lib/fragment';
import route                from '../../lib/route';
import vars                 from '../../lib/vars';
import dataStores           from './lib/data-stores';
import transientInitializer from './lib/transient-initializer';

export default stateParams => 
  new Promise(resolve => {
    let {direct: directParams, route: routeParams, name: stateName, routeValues, silent} = stateParams;
    let stateConfigs = vars.states.registry[stateName];
    
    delete stateParams.useResolves;
    
    if(vars.configs.showRuntime && !stateConfigs.transient) {
      stateParams.time = _.now();
    }
  
    if(!stateConfigs) {
      error.throw(`invalid [${stateName}] state name`, 'initializer');
    }
    
    if(_.isObject(stateConfigs.transient)) {
      _.extend(stateParams, _.pick(stateConfigs.transient, ['noResolves']));
    }
{'fraction_non_alphanumeric': 0.1449343339587242, 'fraction_numerical': 0.0, 'mean_word_length': 2.4682926829268292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2389154', 'n_tokens_mistral': 588, 'n_tokens_neox': 582, 'n_words': 132}