node-state
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -1,7 +0,7 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
var EventEmitter2, NodeState, | ||
var EventEmitter, NodeState, | ||
__slice = [].slice; | ||
EventEmitter2 = require('eventemitter2').EventEmitter2; | ||
EventEmitter = require('events').EventEmitter; | ||
@@ -11,7 +11,5 @@ NodeState = (function() { | ||
function NodeState(config) { | ||
var event, events, fn, from_state, state, state_name, states, to, to_states, transitions, _base, _base1, _base2, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; | ||
var event, events, fn, from_state, state, state_name, states, to, to_states, transitions, _base, _base1, _ref, _ref1, _ref2, _ref3, _ref4; | ||
this.config = config != null ? config : {}; | ||
this._notifier = new EventEmitter2({ | ||
wildcard: true | ||
}); | ||
this._notifier = new EventEmitter; | ||
this.disabled = false; | ||
@@ -57,11 +55,2 @@ states = {}; | ||
} | ||
_ref5 = this.states; | ||
for (state_name in _ref5) { | ||
events = _ref5[state_name]; | ||
if ((_ref6 = (_base2 = this.states[state_name])['Enter']) == null) { | ||
_base2['Enter'] = function(data) { | ||
return this.current_data = data; | ||
}; | ||
} | ||
} | ||
if (this.config.autostart) { | ||
@@ -99,5 +88,2 @@ this.goto(this.current_state_name); | ||
}; | ||
transition = function(data, cb) { | ||
return cb(data); | ||
}; | ||
transition = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_ref6 = this.transitions[previous_state_name]) != null ? _ref6[state_name] : void 0) != null ? _ref5 : (_ref7 = this.transitions['*']) != null ? _ref7[state_name] : void 0) != null ? _ref4 : (_ref8 = this.transitions[previous_state_name]) != null ? _ref8['*'] : void 0) != null ? _ref3 : (_ref9 = this.transitions['*']) != null ? _ref9['*'] : void 0) != null ? _ref2 : function(data, cb) { | ||
@@ -104,0 +90,0 @@ return cb(data); |
@@ -8,3 +8,3 @@ { | ||
"description": "A finite state machine (FSM) implementation for node.js", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"main": "index", | ||
@@ -11,0 +11,0 @@ "homepage": "https://github.com/ichernev/node-state", |
@@ -133,2 +133,4 @@ # Node-State: A finite state machine (FSM) implementation for Node.js and CoffeeScript | ||
## History | ||
+ v1.4.1 | ||
- properly build js file, upgrade! | ||
+ v1.4.0 | ||
@@ -135,0 +137,0 @@ - added enable/disable methods |
143
28816
151