Socket
Socket
Sign inDemoInstall

yup

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yup - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

2

lib/mixed.js

@@ -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()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc