Socket
Socket
Sign inDemoInstall

api-doc-validator

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-doc-validator - npm Package Compare versions

Comparing version 2.7.4 to 2.7.5

21

lib/ajvToJsDoc.js

@@ -18,5 +18,9 @@ module.exports = ajvToJsDoc;

if (type === 'string' || type === 'number') {
if (!schema.enum) return type;
return !schema.enum ? type : schema.enum.map(v => JSON.stringify(v)).join('|');
return (
schema.hasOwnProperty('const') ?
JSON.stringify(schema.const) :
schema.enum ?
schema.enum.map(v => JSON.stringify(v)).join('|') :
type
);
}

@@ -66,4 +70,13 @@

var {anyOf, allOf} = schema;
const {anyOf, allOf} = schema;
const types = ['string', 'number', 'integer'];
if (anyOf && anyOf.every(item => types.includes(item.type) && item.enum || item.type === 'null')) {
return anyOf.reduce((list, item) => {
list.push(ajvToJsDoc(item, params));
return list;
}, []).join('|');
}
if (jsDocNull && anyOf && anyOf.length === 2 && anyOf.some(item => item.type === 'null')) {

@@ -70,0 +83,0 @@ return '?' + ajvToJsDoc(anyOf.find(item => item.type !== 'null'));

4

package.json
{
"name": "api-doc-validator",
"version": "2.7.4",
"version": "2.7.5",
"description": "api doc and validator",

@@ -32,3 +32,3 @@ "main": "index.js",

"@babel/types": "^7.18.10",
"adv-parser": "^2.2.0",
"adv-parser": "^2.3.1",
"commander": "^5.1.0",

@@ -35,0 +35,0 @@ "glob": "^7.2.3",

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