Skip to content

Commit 94d9b52

Browse files
committed
chore: add comments
1 parent 2e1634f commit 94d9b52

File tree

1 file changed

+5
-1
lines changed
  • packages/svelte/src/compiler/migrate

1 file changed

+5
-1
lines changed

packages/svelte/src/compiler/migrate/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,9 +1283,13 @@ function extract_type_and_comment(declarator, str, path) {
12831283
.map((line) =>
12841284
line
12851285
.trim()
1286+
// replace `// ` for one liners
12861287
.replace(/^\/\/\s*/g, '')
1287-
.replace(/^\/\*\*\s*/g, '')
1288+
// replace `\**` for the initial JSDoc
1289+
.replace(/^\/\*\*?\s*/g, '')
1290+
// migrate `*/` for the end of JSDoc
12881291
.replace(/\s*\*\/$/g, '')
1292+
// remove any initial `* ` to clean the comment
12891293
.replace(/^\*\s*/g, '')
12901294
)
12911295
.filter(Boolean);

0 commit comments

Comments
 (0)