[util-dynamodb]: use recursive conditional type to support better type inferrence. #1564
Labels
closed-for-staleness
feature-request
New feature or enhancement. May require GitHub community feedback.
Is your feature request related to a problem? Please describe.
Currently, the result type to the
unmarshall()
is staticly defined. With the new features(recursive conditional type, variadic type type) to be avalable in TypeScript v4.1, we can achieve more fine-grained type according to the users input.Describe the solution you'd like
Essentially, with the new features in TS 4.1, we can convert the input types in TS types, and even provide informative error messages at compile time. Here's the type example in playground: link.
The type is not fully tested yet but it should give the idea.
The text was updated successfully, but these errors were encountered: