Skip to content

Commit

Permalink
Added missing space in doc comments (#4200)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Oct 15, 2024
1 parent edf3081 commit 9593300
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4297,7 +4297,12 @@ fn check_duplicated_getter_and_setter_names(

fn format_doc_comments(comments: &str, js_doc_comments: Option<String>) -> String {
let body: String = comments.lines().fold(String::new(), |mut output, c| {
let _ = writeln!(output, " *{}", c);
output.push_str(" *");
if !c.is_empty() && !c.starts_with(' ') {
output.push(' ');
}
output.push_str(c);
output.push('\n');
output
});
let doc = if let Some(docs) = js_doc_comments {
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/tests/reference/web-sys.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
export function get_url(): URL;
export function get_media_source(): MediaSourceEnum;
/**
*The `MediaSourceEnum` enum.
* The `MediaSourceEnum` enum.
*
**This API requires the following crate features to be activated: `MediaSourceEnum`*
* *This API requires the following crate features to be activated: `MediaSourceEnum`*
*/
type MediaSourceEnum = "camera" | "screen" | "application" | "window" | "browser" | "microphone" | "audioCapture" | "other";

0 comments on commit 9593300

Please sign in to comment.