Comparing version 4.0.5 to 4.1.1
@@ -61,3 +61,3 @@ /** | ||
if(input.typeclass) { | ||
if(['array', 'dictionary', '*', 'machine'].indexOf(input.typeclass) < 0) { | ||
if(['array', 'dictionary', '*', 'number', 'string', 'primitive', 'boolean', 'machine', 'stream', 'buffer'].indexOf(input.typeclass) < 0) { | ||
_errors.push(inputKey); | ||
@@ -96,3 +96,3 @@ } | ||
// Be nice and allow "catchAllExit" | ||
// Be nice and allow "catchAllExit" (with the "All" capitalized) | ||
if (machineDefinition.catchAllExit) { | ||
@@ -103,2 +103,10 @@ machineDefinition.catchallExit = machineDefinition.catchAllExit; | ||
// Ensure error exit exists | ||
if (!machineDefinition.catchallExit){ | ||
machineDefinition.catchallExit = 'error'; | ||
} | ||
if (!machineDefinition.exits[machineDefinition.catchallExit]){ | ||
machineDefinition.exits[machineDefinition.catchallExit] = { description: 'An unexpected error occurred.' }; | ||
} | ||
// If the default exit is defined as a non-existent exit, throw an error | ||
@@ -105,0 +113,0 @@ if (machineDefinition.defaultExit && !machineDefinition.exits[machineDefinition.defaultExit]) { |
@@ -34,5 +34,6 @@ /** | ||
var coercedInputValues; | ||
if (!self._unsafeMode) { | ||
var validationResults = validateConfiguredInputValues(self); | ||
var coercedInputValues = validationResults.values; | ||
coercedInputValues = validationResults.values; | ||
var errors = validationResults.errors; | ||
@@ -75,2 +76,10 @@ | ||
// Apply `defaultsTo` for input defs that use it. | ||
_.each(self.inputs, function (inputDef, inputName){ | ||
if (_.isUndefined(inputDef.defaultsTo)) return; | ||
if (_.isUndefined(self._configuredInputs[inputName])){ | ||
self._configuredInputs[inputName] = inputDef.defaultsTo; | ||
} | ||
}); | ||
// Prune undefined configured exits | ||
@@ -77,0 +86,0 @@ self._configuredExits = (function pruneKeysWithUndefinedValues(obj) { |
{ | ||
"name": "machine", | ||
"version": "4.0.5", | ||
"version": "4.1.1", | ||
"description": "Configure and execute machines", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
71913
1626