Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
fix: add missing jsdoc (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang authored Aug 5, 2017
1 parent 03a367e commit c6ea915
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tasks/utils/generate-file-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@ function get_top_level_members(filename: string): dts.ITopLevelMember[] {
return members;

function bind_member_jsdoc_and_add_export_equal() {
const target_member = members.find(member => {
const target_member_index = members.findIndex(member => {
switch (member.kind) {
case dts.ElementKind.FunctionDeclaration:
case dts.ElementKind.VariableDeclaration:
return true;
default:
return false;
}
}) as undefined | dts.IFunctionDeclaration | dts.IVariableDeclaration;
if (target_member === undefined) {
});
if (target_member_index === -1) {
throw new Error(`Cannot find element to bind jsdoc in ${filename}`);
}
bind_jsdoc(filename, target_member);
const target_member = members[target_member_index] as
| dts.IVariableDeclaration
| dts.IFunctionDeclaration;
members[target_member_index] = bind_jsdoc(filename, target_member);
members.push(dts.create_export_equal({ value: target_member.name! }));
}

Expand Down

0 comments on commit c6ea915

Please sign in to comment.