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

Export alias Falsy for existing Falsey #96

Closed
ssalka opened this issue Jul 19, 2019 · 1 comment · Fixed by #108
Closed

Export alias Falsy for existing Falsey #96

ssalka opened this issue Jul 19, 2019 · 1 comment · Fixed by #108

Comments

@ssalka
Copy link

ssalka commented Jul 19, 2019

Is your feature request related to a real problem or use-case?

It's a real problem to me; I prefer to spell this word as Falsy, not Falsey.

Describe a solution including usage in code example

Add the following to mapped-types.ts:

/**
 * Falsy
 * @desc Type representing falsy values in TypeScript: `null | undefined | false | 0 | ''`.
 * <br>Alias for `Falsey`
 * @example
 *   type Various = 'a' | 'b' | undefined | false;
 *
 *   // Expect: "a" | "b"
 *   Exclude<Various, Falsy>;
 */
export type Falsy = Falsey;

Who does this impact? Who is this for?

Spelling-sensitive users of this wonderful library such as myself 🙂

Describe alternatives you've considered (optional)

Have done this once or twice, but for obvious reasons it is annoying to do:

import { Falsey as Falsy } from 'utility-types';

Additional context (optional)

Falsy on MDN
Is it “falsy” or “falsey”?
“Falsy” vs “Falsey” – I’m Making the Call

@piotrwitek
Copy link
Owner

piotrwitek commented Jul 19, 2019

Hey @ssalka,
I agree with you, Falsy is far more common and also seems like a more correct form, although Falsey is acceptable.

I accept this proposal.
For now, we would add an alias Falsy deprecating the use of Falsey to be removed in the next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants