Skip to content

Commit

Permalink
fix: Optional JSDoc @param
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Aug 28, 2023
1 parent e7cfba5 commit c00b0af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/cli-support/src/js/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,13 @@ impl<'a, 'b> Builder<'a, 'b> {
ret.push_str("@param {");
adapter2ts(ty, &mut ret);
ret.push_str("} ");
ret.push_str(name);
if let AdapterType::Option(..) = ty {
ret.push_str("[");
ret.push_str(name);
ret.push_str("]");
} else {
ret.push_str(name);
}
ret.push('\n');
}
if let (Some(name), Some(ty)) = (variadic_arg, arg_tys.last()) {
Expand Down

0 comments on commit c00b0af

Please sign in to comment.