Skip to content

Commit 9f35751

Browse files
committed
refactor(agent-targets): simplify resolveTarget conditional return
- Removed multiline conditional and combined it into a single line - Maintained logic to check TARGET_ALIASES property existence before return - Improved code readability and compactness without changing behavior
1 parent fae244c commit 9f35751

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/lib/agent-targets.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ export const TARGET_ALIASES: Record<string, AgentTarget> = {
169169
export function resolveTarget(raw: string): AgentTarget | null {
170170
if (Object.prototype.hasOwnProperty.call(TARGETS, raw)) return raw as AgentTarget;
171171
// hasOwnProperty avoids inherited keys (constructor, __proto__).
172-
return Object.prototype.hasOwnProperty.call(TARGET_ALIASES, raw)
173-
? TARGET_ALIASES[raw]!
174-
: null;
172+
return Object.prototype.hasOwnProperty.call(TARGET_ALIASES, raw) ? TARGET_ALIASES[raw]! : null;
175173
}
176174

177175
/** Every accepted `--target` token (ids + aliases), for help/error text. */

0 commit comments

Comments
 (0)