File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff 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+
588597function 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
603612export const PACKAGES_META = {
You can’t perform that action at this time.
0 commit comments