another-json-schema
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -0,1 +1,5 @@ | ||
## 3.2.0/2017-11-14 | ||
- fix schema `required: false` bug | ||
## 3.1.0/2017-10-13 | ||
@@ -2,0 +6,0 @@ |
@@ -55,3 +55,3 @@ const toString = Object.prototype.toString | ||
exports.required = function (actual, expected, key, parent) { | ||
return expected ? (!!actual === true) : true | ||
return !!actual === true | ||
} |
@@ -188,3 +188,3 @@ const helpersFuncs = require('./helpers') | ||
// second, check required | ||
if ('required' in ctx._children) { | ||
if (ctx._children.required) { | ||
if (opts.required == null || opts.required) { | ||
@@ -191,0 +191,0 @@ valid = helpersFuncs.required.call(ctx, value, ctx._children.required, key, parent) |
{ | ||
"name": "another-json-schema", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Another JSON Schema, simple & flexible & intuitive.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -282,2 +282,3 @@ const AJS = require('..') | ||
assert.deepEqual(schema.validate(''), { valid: true, error: null, result: '' }) | ||
assert.deepEqual(schema.validate(), { valid: true, error: null, result: undefined }) | ||
}) | ||
@@ -284,0 +285,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
42549
1092
11