Skip to content

[util-dynamodb]: use recursive conditional type to support better type inferrence. #1564

@AllanZhengYP

Description

@AllanZhengYP

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions