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 4.0.1 to 4.1.0

0

lib/convertors/v12.js

@@ -0,0 +0,0 @@ const _ = require('lodash')

@@ -0,0 +0,0 @@ const BaseConverter = require('./v15')

10

lib/parsers/json-draft-04.js

@@ -7,2 +7,3 @@ const _ = require('lodash')

super(_.merge({
$schema: 'http://json-schema.org/draft-04/schema#',
logicalOpParser: {

@@ -26,2 +27,11 @@ xor: null,

if (typeof fieldSchema.exclusiveMinimum !== 'undefined') {
fieldSchema.minimum = fieldSchema.exclusiveMinimum
fieldSchema.exclusiveMinimum = true
}
if (typeof fieldSchema.exclusiveMaximum !== 'undefined') {
fieldSchema.maximum = fieldSchema.exclusiveMaximum
fieldSchema.exclusiveMaximum = true
}
if (typeof fieldSchema.minimum !== 'undefined' && fieldSchema.minimum === fieldSchema.exclusiveMinimum) {

@@ -28,0 +38,0 @@ fieldSchema.exclusiveMinimum = true

@@ -5,2 +5,8 @@ const _ = require('lodash')

class JoiJsonDraftSchemaParser extends JoiJsonSchemaParser {
constructor(opts = {}) {
super(_.merge({
$schema: 'https://json-schema.org/draft/2019-09/schema'
}, opts))
}
parse(joiSpec, definitions = {}, level = 0) {

@@ -7,0 +13,0 @@ const schema = super.parse(joiSpec, definitions, level)

@@ -85,2 +85,4 @@ /* eslint no-use-before-define: 'off' */

constructor(opts = {}) {
this.$schema = opts.$schema || 'http://json-schema.org/draft-07/schema#'
this.includeSchemaDialect = opts.includeSchemaDialect || false
this.childrenFieldName = this._getChildrenFieldName()

@@ -137,2 +139,6 @@ this.optionsFieldName = this._getOptionsFieldName()

if (this.includeSchemaDialect && level === 0 && this.$schema) {
schema.$schema = this.$schema
}
return schema

@@ -400,2 +406,9 @@ }

break
case 'sign':
if (rule.args.sign === 'positive') {
fieldSchema.exclusiveMinimum = 0
} else if (rule.args.sign === 'negative') {
fieldSchema.exclusiveMaximum = 0
}
break
default:

@@ -402,0 +415,0 @@ break

@@ -13,2 +13,4 @@ const _ = require('lodash')

}, opts))
this.$schema = undefined
}

@@ -15,0 +17,0 @@

2

package.json
{
"name": "joi-to-json",
"version": "4.0.1",
"version": "4.1.0",
"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