Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Commit 48858e9

Browse files
committed
refactor(react): read the action's declared objectName without an any cast
Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
1 parent ff56431 commit 48858e9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎packages/react/src/hooks/useActionTextLocalizer.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ export function useActionTextLocalizer(): ActionTextLocalizer {
130130
// caller passes (objectui#11439). An action declared on `sales_order`
131131
// drawn where the caller knows no object still reads `sales_order`'s
132132
// `_actions` node, never `globalActions`.
133-
const declaredObject = typeof (action as any).objectName === 'string' && (action as any).objectName
134-
? ((action as any).objectName as string)
135-
: undefined;
136-
const keyObject = declaredObject || objectName;
133+
const declared: unknown = action.objectName;
134+
const keyObject = (typeof declared === 'string' && declared) || objectName;
137135

138136
const out: Record<string, any> = {
139137
...action,

0 commit comments

Comments
 (0)