Skip to content

Commit b8514b8

Browse files
Copilotstipsan
andcommitted
refactor: use Object.assign with empty target to avoid mutation
Co-authored-by: stipsan <[email protected]>
1 parent ff7172d commit b8514b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/@sanity/pkg-utils/src/node/resolveBuildTasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function resolveBuildTasks(ctx: BuildContext): BuildTask[] {
1414
const tasks: BuildTask[] = []
1515

1616
const exports = Object.entries(ctx.exports || {}).map(
17-
([_path, exp]) => Object.assign(exp, {_path}) as PkgExport & {_path: string},
17+
([_path, exp]) => Object.assign({}, exp, {_path}) as PkgExport & {_path: string},
1818
)
1919

2020
const dtsTask: DtsTask = {

packages/@sanity/pkg-utils/src/node/resolveWatchTasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function resolveWatchTasks(ctx: BuildContext): WatchTask[] {
1111
const tasks: WatchTask[] = []
1212

1313
const exports = Object.entries(ctx.exports || {}).map(
14-
([_path, exp]) => Object.assign(exp, {_path}) as PkgExport & {_path: string},
14+
([_path, exp]) => Object.assign({}, exp, {_path}) as PkgExport & {_path: string},
1515
)
1616

1717
const dtsTask: DtsWatchTask = {

0 commit comments

Comments
 (0)