3 ms·
TypeScript can infer all the types but it still requires the coder to specify types in certain places because of the exact issue that is being shown here. The
by hermanradtke 4y ago
TypeScript can infer all the types but it still requires the coder to specify types in certain places because of the exact issue that is being shown here.
The types create an API contract that keeps errors localized. ESInfer raises an error at the call site, which is harder to understand what is going on. Also, lack of types will cause the API contract to suddenly change in unexpected ways.
I commend you for creating ESInfer, but there is a reason this approach is usually not taken.