Skip to content

Commit c6142cf

Browse files
committed
rmc dots at the end of desc
1 parent 4a07942 commit c6142cf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

apps/svelte.dev/src/lib/packages-meta.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,18 @@ function supports_svelte_versions(version_range: string): {
585585
return result;
586586
}
587587

588+
function dont_end_by(str: string, not_all_allowed: string[]): string {
589+
for (const nope of not_all_allowed) {
590+
if (str.endsWith(nope)) {
591+
return str.slice(0, -nope.length);
592+
}
593+
}
594+
return str;
595+
}
596+
588597
function calculate_description(pkg: PackageKey & PackageNpm): string {
589598
const found = FEATURED.flatMap((f) => f.packages).find((p) => p.name === pkg.name);
590-
if (found && found.description) return found.description;
599+
if (found && found.description) return dont_end_by(found.description, ['.']);
591600

592601
let desc = pkg.npm_description ?? 'NO DESCRIPTION!';
593602
const replaces = [
@@ -597,7 +606,7 @@ function calculate_description(pkg: PackageKey & PackageNpm): string {
597606
for (const { key, value } of replaces) {
598607
desc = desc.replace(key, value);
599608
}
600-
return desc;
609+
return dont_end_by(desc, ['.']);
601610
}
602611

603612
export const PACKAGES_META = {

0 commit comments

Comments
 (0)