machinepack-machines
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -9,3 +9,3 @@ module.exports = { | ||
typeclass: 'dictionary', | ||
description: 'The package.json string for the NPM package.', | ||
description: 'The package.json object for the NPM package.', | ||
required: true | ||
@@ -12,0 +12,0 @@ } |
@@ -8,3 +8,4 @@ module.exports = { | ||
example: '/Users/mikermcneil/machinepack-foo/machines/bar.js', | ||
description: 'The path to the machine file (if path is not absolute, will be resolved from the current working directory)' | ||
description: 'The path to the machine file (if path is not absolute, will be resolved from the current working directory)', | ||
required: true | ||
} | ||
@@ -11,0 +12,0 @@ }, |
@@ -80,3 +80,19 @@ module.exports = { | ||
return _.reduce(inputs.inputValues, function (memo, configuredInput) { | ||
memo[configuredInput.name] = configuredInput.value; | ||
var inputDef = machineInstance.inputs[configuredInput.name]; | ||
// Coerce the configured input value from the provided string to the | ||
// appropriate type using JSON.parse() based on the input's expectations | ||
// (i.e. if example or typeclass is an array or dictionary) | ||
memo[configuredInput.name] = (function(){ | ||
if (inputDef.typeclass === 'dictionary' || inputDef.typeclass === 'array' || _.isObject(inputDef.example)) { | ||
try { | ||
return JSON.parse(configuredInput.value); | ||
} | ||
catch (e){} | ||
} | ||
return configuredInput.value; | ||
})(); | ||
// console.log('for %s, got: %s, a %s',configuredInput.name, memo[configuredInput.name], typeof memo[configuredInput.name]); | ||
return memo; | ||
@@ -83,0 +99,0 @@ }, {}); |
{ | ||
"name": "machinepack-machines", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Work with machines and machinepacks.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
63232
1700
4