Skip to content

Commit 6115add

Browse files
committed
bug fix: don't mutate existing data
1 parent 837e3ea commit 6115add

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

apps/svelte.dev/src/routes/packages/+page.server.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ const addons: { title: string; href?: string; description?: string; packages: Pa
2727
description:
2828
'<a href="/docs/cli">sv, the Svelte CLI</a>, lets you instantly add functionality to a new or existing project.',
2929
packages: arrToPackages(PACKAGES_META.SV_ADD.packages).map((pkg) => {
30-
pkg.name = pkg.svCmdAlias ?? pkg.name;
31-
pkg.homepage = `/docs/cli/${pkg.svCmdAlias}`;
32-
delete pkg.repo_url;
33-
return pkg;
30+
const result = structuredClone(pkg);
31+
result.name = pkg.svCmdAlias ?? pkg.name;
32+
result.homepage = `/docs/cli/${pkg.svCmdAlias}`;
33+
delete result.repo_url;
34+
return result;
3435
})
3536
}
3637
];

0 commit comments

Comments
 (0)