Skip to content

Commit

Permalink
fix(guess): crash when ObjectMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Dec 18, 2016
1 parent 6c8ebf3 commit 35cc905
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Parser/ParamParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,16 @@ export default class ParamParser {
if (right.type === 'ObjectExpression') {
const typeMap = {};
for (const prop of right.properties) {
typeMap[prop.key.name] = typeof prop.value.value;
switch (prop.type) {
case 'ObjectProperty':
typeMap[prop.key.name] = typeof prop.value.value;
break;
case 'ObjectMethod':
typeMap[prop.key.name] = 'function';
break;
default:
typeMap[prop.key.name] = '*';
}
}

const types = [];
Expand Down

0 comments on commit 35cc905

Please sign in to comment.