Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Implicit Coercion #78

Open
rabi-siddique opened this issue Jun 6, 2024 · 0 comments
Open

Handle Implicit Coercion #78

rabi-siddique opened this issue Jun 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@rabi-siddique
Copy link
Contributor

In several instances within our codebase where we fetch data from the indexer, we have observed mismatches between the defined types in TypeScript and the actual types returned. For example, a variable defined as a number in our TypeScript code might actually be returned as a string. So far implicit type coercion has allowed our code to function correctly. It's best to avoid relying on this behavior to avoid potential errors and ambiguity.

Proposed Solution

  • Update Type Definitions: Review and update the TypeScript type definitions to accurately reflect the data returned by the indexer. This will involve checking the API responses and ensuring that our TypeScript types match the actual data from the response.

  • Explicit Type Coercion: Where type mismatches occur, implement explicit type coercion to convert the data to the desired type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants