code: function State(config) {
    this._ = require('lodash');
  
    this._name = config.name;
    this._isInitial = config.isInitial;
    this._isTerminal = config.isTerminal;
    this._outgoingTransitions = config.outgoingTransitions;
  
    this.accept = config.accept;
  
    this._validateConfig(config);
  
    // Transform any value-based transition criteria to be a function
    this._.forEach(this._outgoingTransitions, function (transition) {
      var criteria = transition.criteria;
  
      // Replace the value-based criteria with a simple comparison function
      if (typeof criteria !== 'function') {
        transition.criteria = function (input) {
          return (input === criteria);
        }
      }
    });
  }
docs: Represents an automata or state within a Finite State Machine.
  
  Provides mechanisms for