Socket
Socket
Sign inDemoInstall

apidoc-plugin-ts

Package Overview
Dependencies
69
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.3 to 0.1.4

15

dist/index.js

@@ -49,3 +49,5 @@ "use strict";

var descriptionPrefix = inttype ? inttype + " > " : '';
var description = descriptionPrefix + (prop.getDocumentationComment() || prop.getName());
var propDocNode = prop.getDocNodes()[0];
var propComment = propDocNode ? propDocNode.getComment() : prop.getName();
var description = descriptionPrefix + propComment;
var propType = prop.getType().getText();

@@ -58,3 +60,3 @@ var propLabel = propType;

}
newElements.push(getParam("{" + capitalize(propLabel) + "} " + typeDef + " " + description));
newElements.push(getParam("{" + capitalize(propLabel) + "} " + typeDef + " " + description, values.element));
if (propTypeIsObject) {

@@ -100,8 +102,9 @@ var typeInterface = getInterface(filename, propType.replace('[]', ''));

}
function getParam(param) {
function getParam(param, type) {
if (type === void 0) { type = 'apiSuccess'; }
return {
content: param + "\n",
name: 'apisuccess',
source: "@apiSuccess " + param + "\n",
sourceName: 'apiSuccess',
name: type.toLowerCase(),
source: "@" + type + " " + param + "\n",
sourceName: type,
};

@@ -108,0 +111,0 @@ }

12

package.json
{
"name": "apidoc-plugin-ts",
"version": "0.1.3",
"version": "0.1.4",
"description": "A plugin for apidoc leveraging TypeScript interfaces.",

@@ -39,5 +39,5 @@ "main": "dist/index.js",

"devDependencies": {
"@types/chai": "^4.0.4",
"@types/chai": "^4.0.10",
"@types/mocha": "^2.2.44",
"@types/node": "^8.0.47",
"@types/node": "^8.5.1",
"apidoc": "^0.17.6",

@@ -47,8 +47,8 @@ "chai": "^4.1.2",

"mocha": "^4.0.1",
"ts-node": "^3.3.0",
"ts-node": "^4.0.1",
"tslint": "^5.8.0"
},
"dependencies": {
"ts-simple-ast": "0.81.0",
"typescript": "2.6.1"
"ts-simple-ast": "3.2.0",
"typescript": "2.6.2"
},

@@ -55,0 +55,0 @@ "greenkeeper": {

@@ -19,3 +19,3 @@ # apidoc-plugin-ts

```javascript
@apiInterface (optional path) {INTERFACE_NAME}
@apiInterface (optional path) {INTERFACE_NAME} REPLACE-API-PARAM
```

@@ -57,9 +57,8 @@

@apiSuccess {String} personalDetails.name
@apiSuccess {Number} personalDetails.age
@apiSuccess {Number} personalDetails.age
```
*Note if the Person interface is defined in the same file then drop the path:*
## Notes
```javascript
@apiInterface {Person}
```
* If the Person interface is defined in the same file then drop the path e.g ```@apiInterface {Person}```.
* REPLACE-API-PARAM is optional and defaults to apiSuccess.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc