New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

joi-to-json

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi-to-json - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

1

fixtures/joi-obj-12.1.0.js

@@ -13,2 +13,3 @@ const joi = require('joi-12')

avatar: joi.string().required().uri(),
password: joi.forbidden(),
email: joi.string().email(),

@@ -15,0 +16,0 @@ ip: joi.string().ip({ version: ['ipv4', 'ipv6'] }),

@@ -13,2 +13,3 @@ const joi = require('joi-13')

avatar: joi.string().required().uri(),
password: joi.forbidden(),
email: joi.string().email(),

@@ -15,0 +16,0 @@ ip: joi.string().ip({ version: ['ipv4', 'ipv6'] }),

@@ -13,2 +13,3 @@ const joi = require('joi-14')

avatar: joi.string().required().uri(),
password: joi.forbidden(),
email: joi.string().email(),

@@ -15,0 +16,0 @@ ip: joi.string().ip({ version: ['ipv4', 'ipv6'] }),

@@ -13,2 +13,3 @@ const joi = require('joi-15')

avatar: joi.string().required().uri(),
password: joi.forbidden(),
email: joi.string().email(),

@@ -15,0 +16,0 @@ ip: joi.string().ip({ version: ['ipv4', 'ipv6'] }),

@@ -13,2 +13,3 @@ const joi = require('joi-16')

avatar: joi.string().required().uri(),
password: joi.forbidden(),
email: joi.string().email(),

@@ -15,0 +16,0 @@ ip: joi.string().ip({ version: ['ipv4', 'ipv6'] }),

@@ -13,2 +13,3 @@ const joi = require('joi-17')

avatar: joi.string().required().uri(),
password: joi.forbidden(),
email: joi.string().email(),

@@ -15,0 +16,0 @@ ip: joi.string().ip({ version: ['ipv4', 'ipv6'] }),

@@ -18,2 +18,5 @@ {

},
"password": {
"not": {}
},
"email": {

@@ -20,0 +23,0 @@ "type": "string",

18

lib/parser_base.js
/* eslint no-use-before-define: 'off' */
const assert = require('assert')
const _ = require('lodash')

@@ -52,2 +51,7 @@

if (this._getPresence(joiDescribe) === 'forbidden') {
schema.not = {}
return schema
}
this._setBasicProperties(schema, joiDescribe)

@@ -87,11 +91,15 @@ this._setNumberFieldProperties(schema, joiDescribe)

_isRequired(fieldDefn) {
_getPresence(fieldDefn) {
const presence = _.get(fieldDefn, 'flags.presence')
if (presence !== undefined) {
assert(['required', 'optional'].includes(presence), presence)
return presence === 'required'
return presence
}
return _.get(fieldDefn, `${this.optionsFieldName}.presence`) === 'required'
return _.get(fieldDefn, `${this.optionsFieldName}.presence`)
}
_isRequired(fieldDefn) {
const presence = this._getPresence(fieldDefn)
return presence === 'required'
}
_getDefaultValue(fieldDefn) {

@@ -98,0 +106,0 @@ return _.get(fieldDefn, 'flags.default')

{
"name": "joi-to-json",
"version": "1.3.0",
"version": "1.3.1",
"description": "joi to JSON Schema Converter",

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

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