machinepack-arrays
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -7,3 +7,3 @@ module.exports = { | ||
description: 'Randomly select one item from an array', | ||
description: 'Randomly select one item from an array.', | ||
@@ -18,3 +18,3 @@ | ||
example: ['*'], | ||
description: 'The array of items to pick from', | ||
description: 'The array of items to pick from.', | ||
required: true | ||
@@ -36,16 +36,3 @@ } | ||
variableName: 'randomItem', | ||
getExample: function(inputs, env) { | ||
var _ = env._; | ||
// If the array is not available yet, or none of its items are, then | ||
// the best we can do is guarantee that this result will be some sort | ||
// of JSON-compatible value. | ||
if (_.isUndefined(inputs.array) || inputs.array.length < 1) { | ||
return '*'; | ||
} | ||
// If the array is available and has one item, we can just borrow the | ||
// first item to build our example. | ||
return inputs.array[0]; | ||
}, | ||
itemOf: 'array' | ||
} | ||
@@ -52,0 +39,0 @@ |
{ | ||
"name": "machinepack-arrays", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Work with arrays.", | ||
@@ -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
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
75732
2855