cms
cms copied to clipboard
Feat: making code strongly-typed
Description
This PR replaces of any with unknown for better type safety, strongly typed code, and stricter type-checking.
Why Change any to unknown?
-
anybypasses TypeScript's type-checking, allowing unintended errors. -
unknownenforces explicit type assertions, leading to safer code. - Helps maintain stricter TypeScript standards and improves maintainability.
Changes Made
- Updated all
catch (error: any)tocatch (error: unknown). - Added necessary type assertions where needed.
- Ensured proper error handling and logging.
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