confidence
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -0,0 +0,0 @@ // Load modules |
@@ -78,13 +78,7 @@ // Load modules | ||
// NULL or undefined | ||
// Valid value | ||
if (node === null || | ||
node === undefined) { | ||
return error('Node cannot be null or undefined'); | ||
} | ||
// Valid value | ||
if (typeof node !== 'object') { | ||
node === undefined || | ||
typeof node !== 'object') { | ||
return null; | ||
@@ -91,0 +85,0 @@ } |
{ | ||
"name": "confidence", | ||
"description": "Configuration API", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/spumko/confidence", |
@@ -101,4 +101,3 @@ <a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a> | ||
The configuration document starts with a simple object. key names can only contain alphanumeric characters and '_' with the '$' prefix reserved | ||
for special directives. Values can contain any non-object value (e.g. strings, numbers, booleans) as well as arrays. Values cannot be | ||
`null` or `undefined`. | ||
for special directives. Values can contain any non-object value (e.g. strings, numbers, booleans) as well as arrays. | ||
@@ -105,0 +104,0 @@ ```json |
@@ -0,0 +0,0 @@ // Load modules |
@@ -109,4 +109,4 @@ // Load modules | ||
var err = store.load(null); | ||
}).to.throw('Node cannot be null or undefined'); | ||
var err = store.load({ $b: 3 }); | ||
}).to.throw('Unknown $ directive $b'); | ||
@@ -119,10 +119,2 @@ done(); | ||
it('fails on null node', function (done) { | ||
var err = Confidence.Store.validate(null); | ||
expect(err.message).to.equal('Node cannot be null or undefined'); | ||
expect(err.path).to.equal('/'); | ||
done(); | ||
}); | ||
it('fails on Error node', function (done) { | ||
@@ -162,4 +154,4 @@ | ||
var err = Confidence.Store.validate({ key: { $default: null } }); | ||
expect(err.message).to.equal('Node cannot be null or undefined'); | ||
var err = Confidence.Store.validate({ key: { $default: { $b: 5 } } }); | ||
expect(err.message).to.equal('Unknown $ directive $b'); | ||
expect(err.path).to.equal('/key/$default'); | ||
@@ -179,4 +171,4 @@ done(); | ||
var err = Confidence.Store.validate({ key: { sub: null } }); | ||
expect(err.message).to.equal('Node cannot be null or undefined'); | ||
var err = Confidence.Store.validate({ key: { sub: { $b: 5 } } }); | ||
expect(err.message).to.equal('Unknown $ directive $b'); | ||
expect(err.path).to.equal('/key/sub'); | ||
@@ -268,4 +260,4 @@ done(); | ||
var err = Confidence.Store.validate({ key: { $filter: 'a', $range: [{ limit: 1, value: null }], $default: 1 } }); | ||
expect(err.message).to.equal('Node cannot be null or undefined'); | ||
var err = Confidence.Store.validate({ key: { $filter: 'a', $range: [{ limit: 1, value: { $b: 5 } }], $default: 1 } }); | ||
expect(err.message).to.equal('Unknown $ directive $b'); | ||
expect(err.path).to.equal('/key/$range[1]'); | ||
@@ -272,0 +264,0 @@ done(); |
68931
574
247