Comparing version 0.4.2 to 0.4.3
@@ -284,3 +284,2 @@ "use strict"; | ||
} | ||
while (typeof (item = arrayItems.shift()) !== "undefined"){ | ||
@@ -310,3 +309,7 @@ var propertyPattern = /^-{1,2}/, | ||
if (definition.type === Array || definition.type.name === "Array" || Array.isArray(definition.value) ){ | ||
target.set(propertyName, defaultValues); | ||
if (Array.isArray(target[propertyName])){ | ||
target[propertyName] = target[propertyName].concat(defaultValues); | ||
} else { | ||
target.set(propertyName, defaultValues); | ||
} | ||
} else { | ||
@@ -313,0 +316,0 @@ target.set(propertyName, defaultValues[0]); |
{ | ||
"name": "nature", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Classify the things in your world and how they interact.", | ||
@@ -5,0 +5,0 @@ "main": "lib/nature.js", |
@@ -293,2 +293,21 @@ var assert = require("assert"), | ||
it("set(array) should ammend defaultOption items", function(){ | ||
_thing.define({ name: "do", type: "string" }); | ||
_thing.define({ name: "when", type: Array, defaultOption: true }); | ||
_thing.define({ name: "change", type: "boolean" }); | ||
_thing.set([ | ||
'--do', | ||
'tmp/balders.sh', | ||
'--when', | ||
'lib/Handbrake.js', | ||
'lib/HandbrakeOptions.js', | ||
'lib/handbrake-js.js', | ||
'lib/progress.js', | ||
'--change' | ||
]); | ||
/* --when is set initially with 'lib/Handbrake.js', the defaultOptions | ||
where overwriting the initial value */ | ||
assert.strictEqual(_thing.when.length, 4); | ||
}); | ||
it("should throw on empty property, i.e. 'rename -' or '--'"); | ||
@@ -295,0 +314,0 @@ }); |
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
72059
1647