Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude #43

Closed
zheeeng opened this issue Aug 4, 2020 · 2 comments · Fixed by #44
Closed

Exclude #43

zheeeng opened this issue Aug 4, 2020 · 2 comments · Fixed by #44
Labels
new-challenge Propose a new challenge, a PR will be auto generated

Comments

@zheeeng
Copy link
Contributor

zheeeng commented Aug 4, 2020

Info

difficulty: easy
title: Exclude
#tags: built-in

Question

Implement the built-in Exclude<T, U>

Exclude from T those types that are assignable to U

Template

type MyExclude<T, U> = any

Test Cases

import { Equal, Expect, ExpectFalse, NotEqual } from '@type-challenges/utils'

type cases = [
    Expect<Equal<MyExclude<"a" | "b" | "c", "a">, Exclude<"a" | "b" | "c", "a">>>,
    Expect<Equal<MyExclude<"a" | "b" | "c", "a" | "b">, Exclude<"a" | "b" | "c", "a" | "b">>>,
    Expect<Equal<MyExclude<string | number | (() => void), Function>, Exclude<string | number | (() => void), Function>>>,
]
@zheeeng zheeeng added the new-challenge Propose a new challenge, a PR will be auto generated label Aug 4, 2020
github-actions bot pushed a commit that referenced this issue Aug 4, 2020
@github-actions github-actions bot mentioned this issue Aug 4, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2020

#44 - Pull Request created.

2020-08-04T11:53:00.091Z

@antfu antfu closed this as completed in #44 Aug 4, 2020
antfu pushed a commit that referenced this issue Aug 4, 2020
Co-authored-by: Zheeeng <1303154+zheeeng@users.noreply.github.com>
@antfu
Copy link
Member

antfu commented Aug 4, 2020

Nice, thanks!

dbstjrrb12 added a commit to dbstjrrb12/type-challenges that referenced this issue Mar 14, 2023
pietrushka added a commit to pietrushka/type-challenges that referenced this issue Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-challenge Propose a new challenge, a PR will be auto generated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants