corehelp wantedtype addition
Repository metrics
- Stars
- (12,328 stars)
- PR merge metrics
- (Avg merge 3d 5h) (11 merged PRs in 30d)
Description
The implementation seems pretty straightforward:
type Falsy = Zero | "" | false | null | undefined;
type Truthy<T = Numeric | object | string | symbol | true> = Exclude<T, Falsy>;
Falsy should include NaN, but TypeScript does not provide that at the type level.
Technically, Falsy should also include HTMLAllCollection due to the [[IsHTMLDDA]] internal slot. However, that type is only available for DOM code (not NodeJS) and is deprecated anyways, so I think it's okay to exclude it from this union.