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.2.1 to 2.2.2

12

lib/parsers/json.js

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

*/
if (joiSpec.patterns) {
if (joiSpec.patterns) {
_.each(joiSpec.patterns, patternObj => {
if (typeof patternObj.rule !== 'object') {
if (typeof patternObj.rule !== 'object' || typeof patternObj.regex === 'undefined') {
return

@@ -182,2 +182,10 @@ }

})
schema.patternProperties = schema.patternProperties || {}
let regexString = patternObj.regex
regexString = regexString.indexOf('/') === 0 ? regexString.substring(1) : regexString
regexString = regexString.lastIndexOf('/') > -1 ? regexString.substring(0, regexString.length - 1) : regexString
schema.patternProperties[regexString] = schema.properties[patternObj.regex]
})

@@ -184,0 +192,0 @@ }

2

package.json
{
"name": "joi-to-json",
"version": "2.2.1",
"version": "2.2.2",
"description": "joi to JSON / OpenAPI Schema Converter",

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

@@ -5,3 +5,3 @@ # joi-to-json

I have been using [joi](https://hapi.dev/family/joi/) a lot in different Node.js projects which guards the API.
I have been using [joi](https://joi.dev/) a lot in different Node.js projects to guard the API.
It's **The most powerful schema description language and data validator for JavaScript.** as it said.

@@ -107,4 +107,8 @@

## Known Limitation
* For `object.pattern` usage in Joi, `pattern` parameter can only be a regular expression now as I cannot convert Joi object to regex yet.
## License
MIT
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