fix: remove redundant config clone casts

This commit is contained in:
Peter Steinberger
2026-05-13 07:56:46 +01:00
parent 2e983e47df
commit fb3aa155be
2 changed files with 3 additions and 3 deletions

View File

@@ -207,7 +207,7 @@ export async function mutateConfigWithPendingPluginInstalls<T = void>(
return await transformConfigWithPendingPluginInstalls<T>({
...params,
transform: async (currentConfig, context): Promise<ConfigTransformResult<T>> => {
const draft = structuredClone(currentConfig) as OpenClawConfig;
const draft = structuredClone(currentConfig);
const result = (await params.mutate(draft, context)) as T | undefined;
return { nextConfig: draft, result };
},

View File

@@ -491,7 +491,7 @@ export async function mutateConfigFile<T = void>(params: {
writeOptions: params.writeOptions,
io: params.io,
transform: async (currentConfig, context) => {
const draft = structuredClone(currentConfig) as OpenClawConfig;
const draft = structuredClone(currentConfig);
const result = (await params.mutate(draft, context)) as T | undefined;
return { nextConfig: draft, result };
},
@@ -515,7 +515,7 @@ export async function mutateConfigFileWithRetry<T = void>(params: {
writeOptions: params.writeOptions,
io: params.io,
transform: async (currentConfig, context) => {
const draft = structuredClone(currentConfig) as OpenClawConfig;
const draft = structuredClone(currentConfig);
const result = (await params.mutate(draft, context)) as T | undefined;
return { nextConfig: draft, result };
},