Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openapi-to-md

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-to-md - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

27

dist/index.js

@@ -122,4 +122,2 @@ #!/usr/bin/env node

if (apiObject.type === "object") {
output += outputRefComment(schemas, 0);
output += outputComment(apiObject, 0);
output += outputObject(apiDocument, undefined, apiObject);

@@ -130,2 +128,5 @@ }

}
else {
output += JSON.stringify(apiObject, undefined, " ") + "\n";
}
}

@@ -141,3 +142,8 @@ output += "```\n\n";

};
const outputComment = (apiObject, level) => {
const outputComment = (refObject, apiObject, level) => {
if (refObject) {
const refName = getRefName(apiObject);
if (refName)
return SP(level) + `// ${refName}\n`;
}
return apiObject.description

@@ -171,4 +177,3 @@ ? apiObject.description

else if (apiObject.type === "object") {
output += outputRefComment(schemas, nowLevel);
output += outputComment(apiObject, nowLevel);
output += outputComment(schemas, apiObject, nowLevel);
output += name ? SP(nowLevel) + `${name}: {\n` : "{\n";

@@ -190,4 +195,3 @@ apiObject.properties &&

else if (apiObject.type) {
output += outputRefComment(schemas, nowLevel);
output += outputComment(apiObject, nowLevel);
output += outputComment(schemas, apiObject, nowLevel);
const type = Array.isArray(apiObject.type)

@@ -203,4 +207,3 @@ ? apiObject.type

else if (apiObject.anyOf) {
output += outputRefComment(schemas, nowLevel);
output += outputComment(apiObject, nowLevel);
output += outputComment(schemas, apiObject, nowLevel);
output += SP(nowLevel) + `${name}${required === true ? "" : "?"}: `;

@@ -214,4 +217,3 @@ apiObject.anyOf.forEach((obj, index) => {

else if (apiObject.allOf) {
output += outputRefComment(schemas, nowLevel);
output += outputComment(apiObject, nowLevel);
output += outputComment(schemas, apiObject, nowLevel);
output += SP(nowLevel) + `${name}${required === true ? "" : "?"}: `;

@@ -225,4 +227,3 @@ apiObject.allOf.forEach((obj, index) => {

else if (apiObject.oneOf) {
output += outputRefComment(schemas, nowLevel);
output += outputComment(apiObject, nowLevel);
output += outputComment(schemas, apiObject, nowLevel);
output += SP(nowLevel) + `${name}${required === true ? "" : "?"}: `;

@@ -229,0 +230,0 @@ apiObject.oneOf.forEach((obj, index) => {

{
"name": "openapi-to-md",
"version": "1.0.6",
"version": "1.0.7",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "bin": {

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