Skip to content

Commit

Permalink
fix(deps) : RangeError: Invalid array length / @input/@output parsing
Browse files Browse the repository at this point in the history
fix #209
  • Loading branch information
vogloblinsky committed Jul 13, 2017
1 parent 7f17ecb commit 048fd20
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 36 deletions.
45 changes: 33 additions & 12 deletions dist/index-cli.js

Large diffs are not rendered by default.

45 changes: 33 additions & 12 deletions dist/index.js

Large diffs are not rendered by default.

46 changes: 34 additions & 12 deletions src/app/compiler/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,12 +857,22 @@ export class Dependencies {

private visitInput(property, inDecorator, sourceFile?) {
var inArgs = inDecorator.expression.arguments,
_return = {
name: inArgs.length ? inArgs[0].text : property.name.text,
defaultValue: property.initializer ? this.stringifyDefaultValue(property.initializer) : undefined,
description: marked(LinkParser.resolveLinks(ts.displayPartsToString(property.symbol.getDocumentationComment()))),
line: this.getPosition(property, sourceFile).line + 1
};
_return = {};
_return.name = (inArgs.length > 0) ? inArgs[0].text : property.name.text;
_return.defaultValue = property.initializer ? this.stringifyDefaultValue(property.initializer) : undefined;
if (property.symbol) {
_return.description = marked(LinkParser.resolveLinks(ts.displayPartsToString(property.symbol.getDocumentationComment())))
}
if (!_return.description) {
if (property.jsDoc) {
if (property.jsDoc.length > 0) {
if (typeof property.jsDoc[0].comment !== 'undefined') {
_return.description = marked(property.jsDoc[0].comment);
}
}
}
}
_return.line = this.getPosition(property, sourceFile).line + 1;
if (property.type) {
_return.type = this.visitType(property);
} else {
Expand Down Expand Up @@ -931,12 +941,24 @@ export class Dependencies {
}

private visitOutput(property, outDecorator, sourceFile?) {
var outArgs = outDecorator.expression.arguments,
_return = {
name: outArgs.length ? outArgs[0].text : property.name.text,
description: marked(LinkParser.resolveLinks(ts.displayPartsToString(property.symbol.getDocumentationComment()))),
line: this.getPosition(property, sourceFile).line + 1
};
var inArgs = outDecorator.expression.arguments,
_return = {};
_return.name = (inArgs.length > 0) ? inArgs[0].text : property.name.text;
_return.defaultValue = property.initializer ? this.stringifyDefaultValue(property.initializer) : undefined;
if (property.symbol) {
_return.description = marked(LinkParser.resolveLinks(ts.displayPartsToString(property.symbol.getDocumentationComment())))
}
if (!_return.description) {
if (property.jsDoc) {
if (property.jsDoc.length > 0) {
if (typeof property.jsDoc[0].comment !== 'undefined') {
_return.description = marked(property.jsDoc[0].comment);
}
}
}
}
_return.line = this.getPosition(property, sourceFile).line + 1;

if (property.type) {
_return.type = this.visitType(property);
} else {
Expand Down

0 comments on commit 048fd20

Please sign in to comment.