cms icon indicating copy to clipboard operation
cms copied to clipboard

Feat: making code strongly-typed

Open theanuragg opened this issue 11 months ago • 0 comments

Description

This PR replaces of any with unknown for better type safety, strongly typed code, and stricter type-checking.

Why Change any to unknown?

  • any bypasses TypeScript's type-checking, allowing unintended errors.
  • unknown enforces explicit type assertions, leading to safer code.
  • Helps maintain stricter TypeScript standards and improves maintainability.

Changes Made

  • Updated all catch (error: any) to catch (error: unknown).
  • Added necessary type assertions where needed.
  • Ensured proper error handling and logging.

type

Testing

  • [x] Code compiles without errors.
  • [x] Existing tests pass successfully.
  • [x] No unexpected runtime errors were introduced.

here is the blog on why this is needed here

theanuragg avatar Feb 13 '25 08:02 theanuragg