Skip to content

Commit

Permalink
fix: Option 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 06c1328
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('[');
ret.push_str(name);
ret.push(']');
} 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 06c1328

Please sign in to comment.