website icon indicating copy to clipboard operation
website copied to clipboard

Replace 'any' type with proper types in helpers.tsx

Open mohanadft opened this issue 2 months ago • 1 comments

Description

The helpers.tsx utility file uses any type annotations which defeats the purpose of TypeScript's type safety. These should be replaced with proper type definitions.

Files to Update

  • src/utils/helpers.tsx

Lines to Fix

Line 1:

export const transformObject = (data: any): any => {

Line 13:

data[key] = value[subKey].map((item: any) => ({

Task

  1. Analyze what the transformObject function does
  2. Create proper type definitions for:
    • The input data parameter
    • The return type
    • The item in the map function
  3. Replace all any types with specific types

Tips

  • Look at where this function is called to understand the data structure
  • Consider using generics if the function works with multiple types
  • Use interfaces or type aliases for complex structures

Acceptance Criteria

  • [ ] No any types remain in helpers.tsx
  • [ ] Proper TypeScript types/interfaces are defined
  • [ ] All TypeScript checks pass
  • [ ] Function behavior remains unchanged

Resources

Good introduction to TypeScript type safety!

mohanadft avatar Nov 13 '25 14:11 mohanadft

Addressed in #328

SimonNRisk avatar Nov 18 '25 01:11 SimonNRisk