refactor(core): extract shared dedup helpers

This commit is contained in:
Peter Steinberger
2026-03-07 10:40:49 +00:00
parent 14c61bb33f
commit 3c71e2bd48
114 changed files with 3400 additions and 2040 deletions

View File

@@ -137,3 +137,18 @@ export function parseOpenClawManifestInstallBase(
}
return spec;
}
export function applyOpenClawManifestInstallCommonFields<
T extends { id?: string; label?: string; bins?: string[] },
>(spec: T, parsed: Pick<ParsedOpenClawManifestInstallBase, "id" | "label" | "bins">): T {
if (parsed.id) {
spec.id = parsed.id;
}
if (parsed.label) {
spec.label = parsed.label;
}
if (parsed.bins) {
spec.bins = parsed.bins;
}
return spec;
}