Skip to content

Strict versions of Extract and Exclude #222

Open
@Vages

Description

@Vages

I have been looking for a strict version of Extract<T, U>. For simplicity, let's call it ExtractStrict<T, U>. ExtractStrict would have one additional feature compared to Extract: ExtractStrict would throw an error if some element in U is not part of T.

I know of an implementation by @ChristianIvicevic which has been proposed for inclusion in Typescript itself: microsoft/TypeScript#31474 I've asked him if he'd be willing to submit it here instead.

Edit: I've found a use case in my code for a strict version of Exclude too (ExcludeStrict), so I've added it to the title.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions