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.3 to 2.7.4

18

lib/ajvToJsDoc.js

@@ -44,3 +44,3 @@ module.exports = ajvToJsDoc;

if (type === 'object') {
let props = schema.properties;
const props = schema.properties;

@@ -51,9 +51,15 @@ if (!props) {

var req = schema.required || [];
const req = schema.required || [];
props = Object.keys(props).map(function (prop) {
return `"${prop}"${req.includes(prop) ? '' : '?'}: ${ajvToJsDoc(props[prop], params)}`;
});
return (
'{' +
Object.keys(props)
.map(function (prop) {
const name = JSON.stringify(prop).replace(/^"([a-z_$][\w$]*)"$/i, '$1');
return `{${props.join(', ')}}`;
return `${name}${req.includes(prop) ? '' : '?'}: ${ajvToJsDoc(props[prop], params)}`;
})
.join(', ')
+ '}'
);
}

@@ -60,0 +66,0 @@

@@ -181,3 +181,3 @@ const {readFileSync, createWriteStream} = require('fs');

`\tthis.${prop} = ${namespace};\n`.replace(/^(\t*)("[^"]+":) "(endpoint-\d+)"/gm, function (x, t, method, tag) {
return methodJs(method, tag, t.length);
return methodJs(method.replace(/^"([a-z_$][\w$]*)":$/i, '$1:'), tag, t.length);
})

@@ -189,3 +189,3 @@ );

`\t${prop}: ${namespace},\n`.replace(/^(\t*)("[^"]+":) "(endpoint-\d+)"/gm, function (x, t, method, tag) {
return methodDts(method, tag, t.length);
return methodDts(method.replace(/^"([a-z_$][\w$]*)":$/i, '$1:'), tag, t.length);
})

@@ -254,3 +254,3 @@ );

return value;
});
}).replace(/"([$\w]+)":/g, '$1:');
}

@@ -257,0 +257,0 @@

{
"name": "api-doc-validator",
"version": "2.7.3",
"version": "2.7.4",
"description": "api doc and validator",

@@ -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