Skip to content

Commit c961a08

Browse files
authored
strip origin in more places (#1067)
1 parent 13a22b2 commit c961a08

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,7 +3072,7 @@ sandbox?: Array<
30723072

30733073
<div class="ts-block-property-bullets">
30743074

3075-
- <span class="tag deprecated">deprecated</span>
3075+
- <span class="tag deprecated">deprecated</span>
30763076

30773077
</div>
30783078

@@ -3089,7 +3089,7 @@ sandbox?: Array<
30893089

30903090
<div class="ts-block-property-bullets">
30913091

3092-
- <span class="tag deprecated">deprecated</span>
3092+
- <span class="tag deprecated">deprecated</span>
30933093

30943094
</div>
30953095

@@ -3106,7 +3106,7 @@ sandbox?: Array<
31063106

31073107
<div class="ts-block-property-bullets">
31083108

3109-
- <span class="tag deprecated">deprecated</span>
3109+
- <span class="tag deprecated">deprecated</span>
31103110

31113111
</div>
31123112

@@ -3133,7 +3133,7 @@ referrer?: Array<
31333133

31343134
<div class="ts-block-property-bullets">
31353135

3136-
- <span class="tag deprecated">deprecated</span>
3136+
- <span class="tag deprecated">deprecated</span>
31373137

31383138
</div>
31393139

apps/svelte.dev/scripts/sync-docs/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ export async function get_types(code: string, statements: ts.NodeArray<ts.Statem
8686
// `@link` JSDoc tags (and maybe others?) turn this property into an array, which we need to join manually
8787
if (Array.isArray(jsDoc.comment)) {
8888
comment = (jsDoc.comment as any[])
89-
.map(({ name, text }) => (name ? `\`${name.escapedText}\`` : text))
89+
.map(({ name, text }) => strip_origin(name ? `\`${name.escapedText}\`` : text))
9090
.join('');
9191
} else {
92-
comment = jsDoc.comment;
92+
comment = strip_origin(jsDoc.comment);
9393
}
9494

9595
if (jsDoc.tags) {
@@ -280,7 +280,7 @@ function munge_type_element(member: ts.TypeElement, depth = 1): TypeElement | un
280280
}
281281

282282
function cleanup_comment(comment: string = '') {
283-
return comment
283+
return strip_origin(comment)
284284
.replace(/\/\/\/ type: (.+)/g, '/** @type {$1} */')
285285
.replace(/\/\/\/ errors: (.+)/g, '// @errors: $1') // see read_d_ts_file
286286
.replace(/^( )+/gm, (match: string, spaces: string) => {

0 commit comments

Comments
 (0)