Comparing version 0.8.0 to 0.8.1
@@ -266,3 +266,3 @@ 'use strict'; | ||
return new Promise(function (resolve, reject) { | ||
!opts.useCallback ? resolve(opts.test.call(_this2, value, context)) : opts.test.call(_this2, value, context, function (err, valid) { | ||
!opts.useCallback ? resolve(opts.test.call(_this2, value, path, context)) : opts.test.call(_this2, value, path, context, function (err, valid) { | ||
return err ? reject(err) : resolve(valid); | ||
@@ -269,0 +269,0 @@ }); |
{ | ||
"name": "yup", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "Dead simple Object schema validation", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -254,4 +254,4 @@ 'use strict'; | ||
!opts.useCallback | ||
? resolve(opts.test.call(this, value, context)) | ||
: opts.test.call(this, value, context, (err, valid) => err ? reject(err) : resolve(valid)) | ||
? resolve(opts.test.call(this, value, path, context)) | ||
: opts.test.call(this, value, path, context, (err, valid) => err ? reject(err) : resolve(valid)) | ||
}) | ||
@@ -258,0 +258,0 @@ .then(valid => { |
@@ -129,3 +129,3 @@ 'use strict'; | ||
it.only('tests should receive context', function(done){ | ||
it.only('tests should receive path and context', function(done){ | ||
var inst = object({ | ||
@@ -137,3 +137,4 @@ other: mixed(), | ||
name: 'max', | ||
test: function(v, context){ | ||
test: function(v, path, context){ | ||
path.should.equal('test') | ||
context.should.eql({ other: 5, test : 'hi' }) | ||
@@ -140,0 +141,0 @@ done() |
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
152247
3303