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

NonUndefined's example is incorrect. #139

Open
tyankatsu0105 opened this issue Apr 26, 2020 · 0 comments · May be fixed by #140
Open

NonUndefined's example is incorrect. #139

tyankatsu0105 opened this issue Apr 26, 2020 · 0 comments · May be fixed by #140

Comments

@tyankatsu0105
Copy link

Description

/**
 * NonUndefined
 * @desc Exclude undefined from set `A`
 * @example
 *   // Expect: "string | null"
 *   SymmetricDifference<string | null | undefined>;
 */
export type NonUndefined<A> = A extends undefined ? never : A;

@example is not correct.

Steps to Reproduce

Expected behavior

/**
 * NonUndefined
 * @desc Exclude undefined from set `A`
 * @example
 *   // Expect: "string | null"
 *   NonUndefined<string | null | undefined>;
 */
export type NonUndefined<A> = A extends undefined ? never : A;

Suggested solution(s)

Project Dependencies

  • Utility-Types Version: X.X.X
  • TypeScript Version: X.X.X
  • tsconfig.json:

Environment (optional)

  • Browser and Version: XXX
  • OS: XXX
  • Node Version: XXX
  • Package Manager and Version: XXX
@tyankatsu0105 tyankatsu0105 linked a pull request Apr 26, 2020 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant