Skip to content

Maintenance: improve return type for safeParse in envelopes #3340

@am29d

Description

@am29d

Summary

Most of the envelopes have return type ParsedResult<unknown, z.infer<T>> which allow to infer the type from the schema used with the envelope. The envelopes EventBridge, LambdaFunctionUrl, VpcLattice and VpcLatticeV2 have only ParsedResult which we need to make more specific.

Why is this needed?

So it is easier to work with the types derived from the schema instead of casting it manually.

Which area does this relate to?

Parser

Solution

Add ParsedResult<unknown, z.infer<T>> as a return type for safeParse on the the envelopes mentioned above.

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedThe scope is clear, ready for implementationparserThis item relates to the Parser Utility

    Type

    No type

    Projects

    Status

    Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions