🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

apidoc-plugin-schema

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apidoc-plugin-schema - npm Package Compare versions

Comparing version

to
0.1.3

2

package.json
{
"name":"apidoc-plugin-schema",
"version":"0.1.2",
"version":"0.1.3",
"description": "Schema Plugin for apidoc.",

@@ -5,0 +5,0 @@ "copyright": "Copyright (c) 2016 will Farrell. All rights reserved.",

@@ -92,21 +92,24 @@

if (param.type === 'array') { param = param.items; }
// convert null to string, add quotes to strings
if ( Array.isArray(param.enum) ) {
param.enum = param.enum.map((item) => {
if (typeof item === 'string') {
item = '"'+item+'"'; // ensures values with spaces render properly
} else if (item === null) {
item = 'null';
} else if (item === true) {
item = 'true';
} else if (item === false) {
item = 'false';
}
return item;
});
}
// convert null,true,false to string, add quotes to strings
if ( !Array.isArray(param.enum) ) { return ''; }
return (Array.isArray(param.enum)) ? '='+param.enum.join(',') : '';
let values = [];
param.enum = param.enum.map((item) => {
if (typeof item === 'string') {
values.push('"'+item+'"'); // ensures values with spaces render properly
} else if (item === null) {
// required to be at beginning
values.unshift('null');
} else if (item === true) {
// required to be at beginning
values.unshift('true');
} else if (item === false) {
// required to be at beginning
values.unshift('false');
}
return item;
});
return '='+values.join(',');
}

@@ -113,0 +116,0 @@