mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-10 18:35:17 +00:00
chore(lint): no-map-spread replace with Object.assign
Replace { ...obj, override } inside map callbacks with Object.assign({}, obj, { override })
to satisfy oxc/no-map-spread. Preserves copy-on-write semantics.
This commit is contained in:
@@ -543,9 +543,7 @@ export class AgentManager {
|
||||
listAgents(): ManagedAgent[] {
|
||||
return Array.from(this.agents.values())
|
||||
.filter((agent) => !agent.internal)
|
||||
.map((agent) => ({
|
||||
...agent,
|
||||
}));
|
||||
.map((agent) => Object.assign({}, agent));
|
||||
}
|
||||
|
||||
async listPersistedAgents(
|
||||
|
||||
@@ -294,13 +294,14 @@ function buildSerializableConfig(config: AgentSessionConfig): SerializableAgentC
|
||||
function sanitizePendingPermissions(
|
||||
pending: Map<string, AgentPermissionRequest>,
|
||||
): AgentPermissionRequest[] {
|
||||
return Array.from(pending.values()).map((request) => ({
|
||||
...request,
|
||||
input: sanitizeMetadata(request.input),
|
||||
suggestions: sanitizeMetadataArray(request.suggestions),
|
||||
actions: request.actions?.map((action) => ({ ...action })),
|
||||
metadata: sanitizeMetadata(request.metadata),
|
||||
}));
|
||||
return Array.from(pending.values()).map((request) =>
|
||||
Object.assign({}, request, {
|
||||
input: sanitizeMetadata(request.input),
|
||||
suggestions: sanitizeMetadataArray(request.suggestions),
|
||||
actions: request.actions?.map((action) => Object.assign({}, action)),
|
||||
metadata: sanitizeMetadata(request.metadata),
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
function sanitizePersistenceHandle(
|
||||
|
||||
@@ -271,12 +271,7 @@ function mergeModels(
|
||||
);
|
||||
|
||||
return mergedModels.map((model) =>
|
||||
additionalDefaultIds.has(model.id)
|
||||
? model
|
||||
: {
|
||||
...model,
|
||||
isDefault: false,
|
||||
},
|
||||
additionalDefaultIds.has(model.id) ? model : Object.assign({}, model, { isDefault: false }),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -388,11 +383,10 @@ function createRegistryEntry(
|
||||
if (mode.icon && mode.colorTier) return mode;
|
||||
const definitionMode = resolved.definition.modes.find((d) => d.id === mode.id);
|
||||
if (!definitionMode) return mode;
|
||||
return {
|
||||
...mode,
|
||||
return Object.assign({}, mode, {
|
||||
icon: mode.icon ?? definitionMode.icon,
|
||||
colorTier: mode.colorTier ?? definitionMode.colorTier,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4379,10 +4379,11 @@ export class CodexAppServerAgentClient implements AgentClient {
|
||||
});
|
||||
}
|
||||
|
||||
const thinkingOptions = Array.from(thinkingById.values()).map((option) => ({
|
||||
...option,
|
||||
isDefault: option.id === resolvedDefaultReasoningEffort,
|
||||
}));
|
||||
const thinkingOptions = Array.from(thinkingById.values()).map((option) =>
|
||||
Object.assign({}, option, {
|
||||
isDefault: option.id === resolvedDefaultReasoningEffort,
|
||||
}),
|
||||
);
|
||||
const defaultThinkingOptionId =
|
||||
resolvedDefaultReasoningEffort ??
|
||||
thinkingOptions.find((option) => option.isDefault)?.id ??
|
||||
|
||||
@@ -106,7 +106,7 @@ export class ScriptRouteStore {
|
||||
}
|
||||
|
||||
listRoutes(): ScriptRouteEntry[] {
|
||||
return Array.from(this.routes.values()).map((entry) => ({ ...entry }));
|
||||
return Array.from(this.routes.values()).map((entry) => Object.assign({}, entry));
|
||||
}
|
||||
|
||||
listRoutesForWorkspace(workspaceId: string): ScriptRouteEntry[] {
|
||||
|
||||
@@ -1004,12 +1004,11 @@ export async function listPaseoWorktrees({
|
||||
|
||||
const rootPrefix = normalizePathForOwnership(worktreesRoot) + sep;
|
||||
return parseWorktreeList(stdout)
|
||||
.map((entry) => ({ ...entry, path: normalizePathForOwnership(entry.path) }))
|
||||
.map((entry) => Object.assign({}, entry, { path: normalizePathForOwnership(entry.path) }))
|
||||
.filter((entry) => entry.path.startsWith(rootPrefix))
|
||||
.map((entry) => ({
|
||||
...entry,
|
||||
createdAt: resolveWorktreeCreatedAtIso(entry.path),
|
||||
}));
|
||||
.map((entry) =>
|
||||
Object.assign({}, entry, { createdAt: resolveWorktreeCreatedAtIso(entry.path) }),
|
||||
);
|
||||
}
|
||||
|
||||
export async function resolveExistingWorktreeForSlug({
|
||||
|
||||
Reference in New Issue
Block a user