schema-inspector
Advanced tools
Comparing version 1.5.5 to 1.5.6
@@ -864,3 +864,3 @@ /* | ||
} | ||
if (n != null && n !== post) { | ||
if ((n != null || typeof schema.def !== 'undefined') && n !== post) { | ||
this.report(); | ||
@@ -867,0 +867,0 @@ return n; |
{ | ||
"name": "schema-inspector", | ||
"description": "Schema-Inspector is a powerful tool to sanitize and validate JS objects.", | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -149,2 +149,11 @@ var should = require('should'); | ||
test('candidate #5 | string -> integer or def: null', function () { | ||
var result = si.sanitize({ type: 'integer', def: null }, 'abc'); | ||
result.should.be.an.Object; | ||
result.should.have.property('reporting').with.be.an.instanceof(Array) | ||
.and.be.lengthOf(1); | ||
result.reporting[0].property.should.be.equal('@'); | ||
should.equal(result.data, null); | ||
}); | ||
}); // suite "schema #2" | ||
@@ -151,0 +160,0 @@ |
Sorry, the diff of this file is not supported yet
305491
5461