Socket
Socket
Sign inDemoInstall

conformation

Package Overview
Dependencies
4
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.0 to 0.10.0

8

dist/types/AnyType.js

@@ -97,7 +97,7 @@ 'use strict';

function requiredRule(value) {
if (_lodash2.default.isNil(value) || value === '') {
function requiredRule(value, params, ctx) {
if (ctx.skipRequired || !(_lodash2.default.isNil(value) || value === '')) {
return { valid: true };
} else {
return (0, _util.error)('required');
} else {
return { valid: true };
}

@@ -104,0 +104,0 @@ }

{
"name": "conformation",
"version": "0.9.0",
"version": "0.10.0",
"description": "Yet another object validator",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -139,2 +139,7 @@

it('should allow required() to be skipped', function () {
let schema = Schema.any().required();
expect(schema.validate('', {skipRequired: true}).valid).to.be.true;
});
it('should have a only() rule', function () {

@@ -141,0 +146,0 @@ let schema = Schema.any().only(1, 2);

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc