Comparing version 1.0.7 to 1.1.0
@@ -121,2 +121,3 @@ /** | ||
if (this.catchallExit && this.catchallExit != 'error') { | ||
// (here for backwards-compatibility) | ||
configuredExits.error = configuredExits[this.catchallExit]; | ||
@@ -131,4 +132,4 @@ } | ||
// If we don't have a default exit OR an explicit "success", forward success | ||
// to the catchall | ||
// If we don't have a default exit OR an explicit "success", | ||
// forward success to the catchall | ||
else if (!this.defaultExit && !this.exits.success) { | ||
@@ -138,3 +139,19 @@ configuredExits.success = configuredExits.error; | ||
_.extend(this._configuredExits, switchback(configuredExits)); | ||
// Get the switchbackified exits | ||
// (this supports traditional callback usage) | ||
var forwards = {}; | ||
if (this.defaultExit && this.defaultExit !== 'success') { | ||
// Special case for a defaultExit which is !== "success" | ||
forwards[this.defaultExit] = 'success'; | ||
} | ||
if (this.catchallExit && this.catchallExit !== 'error') { | ||
// Special case for a catchallExit which is !== "error" | ||
// (here for backwards-compatibility) | ||
forwards[this.catchallExit] = 'error'; | ||
} | ||
var switchbackifiedExits = switchback(configuredExits, forwards); | ||
// Mix in the switchback-ified exits into the exits stored within | ||
// this configured machine instance. | ||
_.extend(this._configuredExits, switchbackifiedExits); | ||
return this; | ||
@@ -141,0 +158,0 @@ }; |
{ | ||
"name": "machine", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"description": "Configure and execute machines", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56448
22
1600