Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.1.1 to 0.1.2

2

lib/mixed.js

@@ -31,3 +31,3 @@ 'use strict';

__isMiniSchema__: true,
__isYupSchema__: true,

@@ -34,0 +34,0 @@ constructor: SchemaType,

@@ -10,4 +10,9 @@ 'use strict';

constructor: function(){
if ( !(this instanceof _Object)) return new _Object()
constructor: function(spec){
if ( !(this instanceof _Object))
return new _Object(spec)
if ( spec )
return this.clone().shape(spec);
this.fields = {};

@@ -17,5 +22,2 @@ SchemaObject.call(this)

this._type = 'object'
// if ( !_.has(this, '_default') )
// this._default = function(){ return {} }
},

@@ -22,0 +24,0 @@

{
"name": "yup",
"version": "0.1.1",
"description": "Object schema validation",
"version": "0.1.2",
"description": "client model and persistence mechanism",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

Yup
=======================
Javascript object schema validation. The api and style is definately inspired by/stolen from [Joi](https://github.com/hapijs/joi) which is an amazing library but generally too big and feature rich for my browser validation needs. Yup is a lean lib in the same spirit without the fancy features. You can use it on the server as well, but in that case you might as well just use Joi.
a js object schema validation. The api and style is definately inspired by/stolen from [Joi](https://github.com/hapijs/joi) which is an amazing library but generally too big and feature rich for my browser validation needs. Yup is a lean lib in the same spirit without the fancy features. You can use it on the server as well, but in that case you might as well just use Joi.

@@ -6,0 +6,0 @@ ## Usage

@@ -102,2 +102,10 @@ 'use strict';

it.only('should call shape with constructed with an arg', function(){
var inst = object({
prop: mixed(),
})
inst.should.have.deep.property('fields.prop')
})
it('should handle empty keys', function(){

@@ -104,0 +112,0 @@ var inst = object().shape({

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