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

obey

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obey - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

4

CHANGELOG.md

@@ -0,1 +1,5 @@

### v3.0.5 (2019-04-19):
* Conditional require rules (`requiredIf`, `requiredIfNot`) are now removed if a `creator` or `default` rule is defined.
### v3.0.0 (2019-01-05):

@@ -2,0 +6,0 @@

2

package.json
{
"name": "obey",
"version": "3.0.4",
"version": "3.0.5",
"description": "Data modelling and validation library",

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

@@ -139,3 +139,3 @@ /*

getProps: (def, val) => {
//
// Require(d) alias
if (def.require) {

@@ -146,2 +146,24 @@ def.required = def.require

}
// If default or creator defined, no need for conditional requires.
if (def.default || def.creator) {
const conditionalRequires = ['requireIf', 'requireIfNot', 'requiredIf', 'requiredIfNot']
const rules = []
conditionalRequires.forEach((key) => {
if (def[key]) {
rules.push(key)
delete def[key]
}
})
if (rules.length) {
const message = [
'-----\nObey Warning: removing conditional require',
`rule(s) (${rules.join(', ')}) due to 'default' or`,
'\'creator\' being defined\n-----'
].join(' ')
console.log(message)
}
}
// Partial and undefined

@@ -148,0 +170,0 @@ if (def.opts.partial && val === undefined) return rules.props.noValPartial

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