Skip to content

Commit

Permalink
Add value guard
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 7, 2016
1 parent 9e0c170 commit 593f572
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function addRule (globalRules, schema, blueprint, name) {
}

function throwTypeError (name, type, message) {
if (isBoolean(message)) message = 'Expected a {' + type + "} for '" + name + "'."
if (!message || isBoolean(message)) message = 'Expected a {' + type + "} for '" + name + "'."
throw new TypeError(message)
}

Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('schema defintion', function () {
})
})

xdescribe('support casting (by default)', function () {
describe('support casting (by default)', function () {
it('disable explicit', function () {
var schema = {
age: {
Expand Down Expand Up @@ -137,7 +137,7 @@ describe('schema defintion', function () {
})
})

xdescribe('support validation', function () {
describe('support validation', function () {
it('based in a function', function () {
var schema = {
age: {
Expand Down

0 comments on commit 593f572

Please sign in to comment.