Skip to content

Commit db92dd7

Browse files
committed
fix: replace 'any' type with proper TypeScript types to resolve ESLint warning
- Replace 'any' type with 'LangValue | undefined' in getValueFromKey function - Add proper type casting for array access - Resolves @typescript-eslint/no-explicit-any warning - Maintains type safety while preserving functionality
1 parent b0503e8 commit db92dd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

resources/js/hooks/useLang.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export function useLang() {
3535

3636
function getValueFromKey(key: string): string | undefined {
3737
const segments = key.split('.')
38-
let current: any = lang
38+
let current: LangValue | undefined = lang
3939

4040
for (const segment of segments) {
4141
if (typeof current !== 'object' || current === null) return undefined
42-
current = current[segment]
42+
current = current[segment] as LangValue | undefined
4343
}
4444

4545
return typeof current === 'string' ? current : undefined

0 commit comments

Comments
 (0)