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

Falsy #30

Open
felixfbecker opened this issue Sep 5, 2018 · 3 comments
Open

Falsy #30

felixfbecker opened this issue Sep 5, 2018 · 3 comments

Comments

@felixfbecker
Copy link

export type Falsy = false | null | undefined | 0 | ''

export const isTruthy = <T>(val: T): val is Exclude<T, Falsy> => !!val
@pelotom
Copy link
Owner

pelotom commented Sep 5, 2018

The Falsy type is an interesting idea which I'd consider including, but the isTruthy function would represent a departure from the stated goals of this library, which is to be a set of purely static type operators with no runtime component.

@felixfbecker
Copy link
Author

Yeah that was just a usage example.

@pelotom
Copy link
Owner

pelotom commented Sep 6, 2018

Ok, would you like to submit a PR?

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

No branches or pull requests

2 participants