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

apidoc

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apidoc - npm Package Compare versions

Comparing version 0.6.4 to 0.6.5

7

CHANGELOG.md
# apiDoc Changelog
#### 0.6.5
Bugfix: Change RegExp for parameter values to handle all chars. (https://github.com/apidoc/apidoc/issues/97)
#### 0.6.4
Bugfix: Rserved parameter names. (https://github.com/apidoc/apidoc/issues/96)
Bugfix: Reserved parameter names. (https://github.com/apidoc/apidoc/issues/96)

@@ -7,0 +12,0 @@

106

lib/parsers/api_param.js

@@ -11,63 +11,53 @@ var group = "";

// Old-RegExp:
// var parseRegExp = /^(?:(?:\((.+?)\))\s*)?(?:(?:\{(.+?)\})\s*)?(\[?(\S[a-zA-Z0-9._\-]*)(?:=['|"]?([\s.a-zA-Z0-9_\-]*)['|"]?)?\]?)\s*(.*)?(^@|$)/g;
function _objectValuesToString(obj)
{
var str = "";
for(var el in obj) {
if(typeof obj[el] === "string") str += obj[el];
else str += _objectValuesToString(obj[el]);
} // for
return str;
} // _objectValuesToString
// Search: group, type, field, defaultValue, optional, description
// Example: {Boolean} [user.name="Default Value"] Users lastname.
// RegExp:
// ^
// (?:
// (?:\(
// (.+?) ; group
// \))
// \s*)?
// (?:
// (?:\{
// (.+?) ; type
// \})
// \s*)?
// (\[? ; optional
// (\S[a-zA-Z0-9._\-]*) ; field
// (?:=['|"]?
// ([\s.a-zA-Z0-9_\-]*) ; defaultValue
// ['|"]?)
// ?\]?)
// \s*
// (.*)? ; description
// (^@|$) ; Multiline
var parseRegExp = /^(?:(?:\((.+?)\))\s*)?(?:(?:\{(.+?)\})\s*)?(\[?(\S[a-zA-Z0-9._\-]*)(?:=['|"]?([\s.a-zA-Z0-9_\-]*)['|"]?)?\]?)\s*(.*)?(^@|$)/g;
var regExp = {
b: "^",
vGroup: {
b: "(?:",
c: {
b: "(?:\\(",
group: "(.+?)", // 1
e: "\\))",
},
e: "\\s*)?"
},
vType: {
b: "(?:",
c: {
b: "(?:\\{",
type: "(.+?)", // 2
e: "\\})",
},
e: "\\s*)?"
},
vBrackets: {
b: "(\\[?", // 3
fieldname: "(\\S[a-zA-Z0-9._\\-]*)", // 4
vDefaultValue: {
b: "(?:=['|\"]?",
defaultValue: "(.+?(?=['|\"|\\]]))", // 5
e: "['|\"]?)?"
},
e: "\\]?)"
},
oWhitespace: "\\s*",
vDescription: "(.*)?", // 6
e: "(^@|$)"
};
var parseRegExp = new RegExp(_objectValuesToString(regExp));
var matches = parseRegExp.exec(content);
// function objectValuesToString(obj)
// {
// var str = "";
// for(var el in obj)
// {
// if(typeof obj[el] === "string") str += obj[el];
// else str += objectValuesToString(obj[el]);
// } // for
// return str;
// } // objectValuesToString
// var rx = {
// b: "^",
// ohType: {
// b: "(?:",
// ohBraces: {
// b: "(?:\\{",
// type: "(.+?)", // 1
// e: "\\})",
// },
// e: "\\s*)?"
// },
// oBrackets: {
// b: "(\\[?", // 2
// fieldname: "(\\S[a-zA-Z0-9._\\-]*)", // 3
// hDefaultValue: {
// b: "(?:=['|\"]?",
// defaultValue: "([\\s.a-zA-Z0-9_\\-]*)", // 4
// e: "['|\"]?)"
// },
// e: "?\\]?)"
// },
// oWhitespace: "\\s*",
// oDescription: "(.*)?", // 5
// e: "(^@|$)"
// };
// objectValuesToString(rx);

@@ -74,0 +64,0 @@ if( ! matches) return null;

{
"name": "apidoc",
"version": "0.6.4",
"version": "0.6.5",
"description": "RESTful web API Documentation Generator",

@@ -5,0 +5,0 @@ "author": "Peter Rottmann <rottmann@inveris.de>",

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