Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c5d9038

Browse files
refactor(@angular/ssr): update getPathSegments to use stripTrailingSlash instead of filter(Boolean)
This change modifies the `getPathSegments` function to use `stripTrailingSlash`, providing a more consistent and reliable way to handle trailing slashes in paths. This update also resolves issues causing CI failures. (cherry picked from commit b0c2d19)
1 parent 9bacf39 commit c5d9038

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎packages/angular/ssr/src/routes/route-tree.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import { addLeadingSlash } from '../utils/url';
9+
import { addLeadingSlash,stripTrailingSlash } from '../utils/url';
1010
import { RenderMode } from './route-config';
1111

1212
/**
@@ -230,7 +230,7 @@ export class RouteTree<AdditionalMetadata extends Record<string, unknown> = {}>
230230
* @returns An array of path segments.
231231
*/
232232
private getPathSegments(route: string): string[] {
233-
return route.split('/').filter(Boolean);
233+
return stripTrailingSlash(route).split('/');
234234
}
235235

236236
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /