clarity
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -63,2 +63,7 @@ var data = {}, | ||
} | ||
// likewise if we have a type other than an object | ||
// then simple return the input | ||
else if (typeof input != 'object') { | ||
return input; | ||
} | ||
@@ -68,3 +73,3 @@ // iterate through the keys within the object | ||
Object.keys(input).forEach(function(key) { | ||
if (input.hasOwnProperty(key)) { | ||
if (hasOwn.call(input, key)) { | ||
clone[key] = clarity.deepDecode(input[key]); | ||
@@ -71,0 +76,0 @@ } |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"engines": { | ||
@@ -13,0 +13,0 @@ "node": ">= 0.6.x < 0.9.0" |
@@ -19,3 +19,4 @@ var assert = require('assert'), | ||
street: '12 **this-is-a-test-key** Street', | ||
suburb: 'Brisbane' | ||
suburb: 'Brisbane', | ||
postcode: 4054 | ||
} | ||
@@ -28,3 +29,4 @@ }; | ||
street: '12 test Street', | ||
suburb: 'Brisbane' | ||
suburb: 'Brisbane', | ||
postcode: 4054 | ||
} | ||
@@ -31,0 +33,0 @@ }); |
@@ -13,2 +13,18 @@ var assert = require('assert'), | ||
}); | ||
it('should be able to replace an environment var within an object', function() { | ||
var data = clarity.decode({ username: '**USER** '}); | ||
assert.notEqual(data.username, '**USER**'); | ||
}); | ||
it('should be able to replace an environment var deep within an object', function() { | ||
var data = clarity.decode({ | ||
config: { | ||
username: '**USER**' | ||
} | ||
}); | ||
assert.notEqual(data.config.username, '**USER**'); | ||
}); | ||
}); |
10061
208