mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 21:51:28 +00:00
refactor: dedupe lowercase string helpers
This commit is contained in:
@@ -428,10 +428,10 @@ function buildArtifactContext(
|
||||
}
|
||||
|
||||
const artifactContext = {
|
||||
agentId: normalizeContextString(context.agentId),
|
||||
sessionId: normalizeContextString(context.sessionId),
|
||||
messageChannel: normalizeContextString(context.messageChannel),
|
||||
agentAccountId: normalizeContextString(context.agentAccountId),
|
||||
agentId: normalizeOptionalString(context.agentId),
|
||||
sessionId: normalizeOptionalString(context.sessionId),
|
||||
messageChannel: normalizeOptionalString(context.messageChannel),
|
||||
agentAccountId: normalizeOptionalString(context.agentAccountId),
|
||||
};
|
||||
|
||||
return Object.values(artifactContext).some((value) => value !== undefined)
|
||||
@@ -439,11 +439,6 @@ function buildArtifactContext(
|
||||
: undefined;
|
||||
}
|
||||
|
||||
function normalizeContextString(value: string | undefined): string | undefined {
|
||||
const normalized = normalizeOptionalString(value);
|
||||
return normalized ? normalized : undefined;
|
||||
}
|
||||
|
||||
function normalizeDiffInput(params: DiffsToolParams): DiffInput {
|
||||
const patch = params.patch?.trim();
|
||||
const before = params.before;
|
||||
|
||||
Reference in New Issue
Block a user