fix: remove redundant config clone casts · openclaw/openclaw@fb3aa15
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -207,7 +207,7 @@ export async function mutateConfigWithPendingPluginInstalls<T = void>(
|
207 | 207 | return await transformConfigWithPendingPluginInstalls<T>({ |
208 | 208 | ...params, |
209 | 209 | transform: async (currentConfig, context): Promise<ConfigTransformResult<T>> => { |
210 | | -const draft = structuredClone(currentConfig) as OpenClawConfig; |
| 210 | +const draft = structuredClone(currentConfig); |
211 | 211 | const result = (await params.mutate(draft, context)) as T | undefined; |
212 | 212 | return { nextConfig: draft, result }; |
213 | 213 | }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -491,7 +491,7 @@ export async function mutateConfigFile<T = void>(params: {
|
491 | 491 | writeOptions: params.writeOptions, |
492 | 492 | io: params.io, |
493 | 493 | transform: async (currentConfig, context) => { |
494 | | -const draft = structuredClone(currentConfig) as OpenClawConfig; |
| 494 | +const draft = structuredClone(currentConfig); |
495 | 495 | const result = (await params.mutate(draft, context)) as T | undefined; |
496 | 496 | return { nextConfig: draft, result }; |
497 | 497 | }, |
@@ -515,7 +515,7 @@ export async function mutateConfigFileWithRetry<T = void>(params: {
|
515 | 515 | writeOptions: params.writeOptions, |
516 | 516 | io: params.io, |
517 | 517 | transform: async (currentConfig, context) => { |
518 | | -const draft = structuredClone(currentConfig) as OpenClawConfig; |
| 518 | +const draft = structuredClone(currentConfig); |
519 | 519 | const result = (await params.mutate(draft, context)) as T | undefined; |
520 | 520 | return { nextConfig: draft, result }; |
521 | 521 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。