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

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.11.0 to 2.12.0

49

cli.js

@@ -24,3 +24,3 @@ #!/usr/bin/env node

.option('-C, --default-code <code>', 'default @response CODE')
.option('-S, --default-schemas <path>', 'path to js file with default schemas')
.option('-S, --default-schemas <path...>', 'path to js file with default schemas', collect, null)
.option('-J, --jsdoc-methods <boolean>', 'generate methods @type, default true')

@@ -101,15 +101,25 @@ .option('-T, --jsdoc-typedefs <boolean>', 'generate @typedef, default true')

if (config.defaultSchemas) {
const defaultSchemasPaths = config.defaultSchemas && (
Array.isArray(config.defaultSchemas) ?
config.defaultSchemas :
[config.defaultSchemas]
) || ['adv-parser/schemas'];
for (const path of defaultSchemasPaths) {
try {
require.resolve(config.defaultSchemas);
require.resolve(path);
}
catch (err) {
throw new Error(`Default schemas file not found: ${JSON.stringify(config.defaultSchemas)}`);
throw new Error(`Default schemas file not found: ${JSON.stringify(path)}`);
}
}
const defaultSchemas = require(config.defaultSchemas || 'adv-parser/schemas');
const defaultSchemas = {};
var files = getFiles(config.include);
for (const path of defaultSchemasPaths) {
Object.assign(defaultSchemas, require(path));
}
let files = getFiles(config.include);
if (config.exclude) {

@@ -216,5 +226,20 @@ let exclude = getFiles(config.exclude);

function resolvePath(target, src, props) {
for (let prop of props) {
let path = src[prop] || target[prop];
target[prop] = path && resolve(configDir, path);
const conv = (path) => {
if (path.charAt(0) !== '.') {
try {
require.resolve(path);
return path;
}
catch (e) {}
}
return resolve(configDir, path);
};
for (const prop of props) {
const path = src[prop] || target[prop];
target[prop] = path && (
Array.isArray(path) ? path.map(conv) : conv(path)
);
}

@@ -234,2 +259,8 @@ }

}
}
function collect(value, previous) {
previous = previous || [];
return previous.concat([value]);
}

2

package.json
{
"name": "api-doc-validator",
"version": "2.11.0",
"version": "2.12.0",
"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