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 2.3.3 to 2.3.4

10

lib/parsers/json.js

@@ -118,5 +118,12 @@ /* eslint no-use-before-define: 'off' */

_getConst(fieldDefn) {
const enumList = fieldDefn[this.enumFieldName]
if (fieldDefn.flags && fieldDefn.flags.only && enumList.length === 1) {
return enumList[0]
}
}
_getEnum(fieldDefn) {
const enumList = fieldDefn[this.enumFieldName]
if (fieldDefn.flags && fieldDefn.flags.only && !_.isEmpty(enumList)) {
if (fieldDefn.flags && fieldDefn.flags.only && enumList.length > 1) {
return _.uniq(enumList)

@@ -145,2 +152,3 @@ }

this._setIfNotEmpty(fieldSchema, 'default', this._getDefaultValue(fieldDefn))
this._setIfNotEmpty(fieldSchema, 'const', this._getConst(fieldDefn))
this._setIfNotEmpty(fieldSchema, 'enum', this._getEnum(fieldDefn))

@@ -147,0 +155,0 @@ }

@@ -56,2 +56,6 @@ const _ = require('lodash')

if (fullSchema.const) {
schema.enum = [fullSchema.const]
}
return schema

@@ -58,0 +62,0 @@ }

2

package.json
{
"name": "joi-to-json",
"version": "2.3.3",
"version": "2.3.4",
"description": "joi to JSON / OpenAPI 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