Skip to content

Commit 741dfd5

Browse files
authored
fix(alias): only strip common word prefix from slugs that start with it (#1131)
1 parent 30a0190 commit 741dfd5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/lib/alias.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ function processUniqueSlugs(
218218
const slugToRemainder = new Map<string, string>();
219219

220220
for (const slug of uniqueProjectSlugs) {
221-
const remainder = slug.slice(strippedPrefix.length);
221+
const remainder = slug.startsWith(strippedPrefix)
222+
? slug.slice(strippedPrefix.length)
223+
: slug;
222224
slugToRemainder.set(slug, remainder || slug);
223225
}
224226

0 commit comments

Comments
 (0)