mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:50:42 +00:00
refactor(lint): enable map spread rule
This commit is contained in:
@@ -211,13 +211,7 @@ function expandTextContent(text: string): {
|
||||
const content = mergeAdjacentTextItems(
|
||||
parts.map((item) => {
|
||||
if (item.type === "attachment" && item.attachment.kind === "audio" && audioAsVoice) {
|
||||
return {
|
||||
...item,
|
||||
attachment: {
|
||||
...item.attachment,
|
||||
isVoiceNote: true,
|
||||
},
|
||||
};
|
||||
return Object.assign({}, item, { attachment: { ...item.attachment, isVoiceNote: true } });
|
||||
}
|
||||
return item;
|
||||
}),
|
||||
|
||||
@@ -276,12 +276,7 @@ function patchSessionThinkingLevel(
|
||||
state.sessionsResult = {
|
||||
...current,
|
||||
sessions: current.sessions.map((row) =>
|
||||
row.key === sessionKey
|
||||
? {
|
||||
...row,
|
||||
thinkingLevel,
|
||||
}
|
||||
: row,
|
||||
row.key === sessionKey ? Object.assign({}, row, { thinkingLevel }) : row,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -724,12 +724,13 @@ export function renderConfig(props: ConfigProps) {
|
||||
const schemaProps = analysis.schema?.properties ?? {};
|
||||
|
||||
const VIRTUAL_SECTIONS = new Set(["__appearance__"]);
|
||||
const visibleCategories = SECTION_CATEGORIES.map((cat) => ({
|
||||
...cat,
|
||||
sections: cat.sections.filter(
|
||||
(s) => (includeVirtualSections && VIRTUAL_SECTIONS.has(s.key)) || s.key in schemaProps,
|
||||
),
|
||||
})).filter((cat) => cat.sections.length > 0);
|
||||
const visibleCategories = SECTION_CATEGORIES.map((cat) =>
|
||||
Object.assign({}, cat, {
|
||||
sections: cat.sections.filter(
|
||||
(s) => (includeVirtualSections && VIRTUAL_SECTIONS.has(s.key)) || s.key in schemaProps,
|
||||
),
|
||||
}),
|
||||
).filter((cat) => cat.sections.length > 0);
|
||||
|
||||
// Catch any schema keys not in our categories
|
||||
const extraSections = Object.keys(schemaProps)
|
||||
|
||||
@@ -80,10 +80,7 @@ function formatDiaryChipLabel(date: string): string {
|
||||
|
||||
function buildDiaryNavigation(entries: DiaryEntry[]): DiaryEntryNav[] {
|
||||
const reversed = [...entries].toReversed();
|
||||
return reversed.map((entry, page) => ({
|
||||
...entry,
|
||||
page,
|
||||
}));
|
||||
return reversed.map((entry, page) => Object.assign({}, entry, { page }));
|
||||
}
|
||||
|
||||
type DreamingPhaseInfo = {
|
||||
|
||||
Reference in New Issue
Block a user