0.2.0-alpha • Published 5 years ago
@perfective/value v0.2.0-alpha
Value
The @perfective/value package provides functions to work with undefined and null values
and utility types
(similar to the TS NonNullable<T>
to describe some of such values.
- Utility types:
type Defined<T> = T extends undefined ? never : Ttype NotNull<T> = T extends null ? never : Ttype Present<T> = T extends null | undefined ? never : Ttype Absent<T> = T extends null | undefined ? T : never
- Type Guards:
isDefined<T>(value: T | undefined): value is TisUndefined<T>(value: T | undefined): value is undefinedisNotNull<T>(value: T | null): value is TisNull<T>(value: T | null): value is nullisPresent<T>(value: T | null | undefined): value is TisAbsent<T>(value: T | null | undefined): value is null | undefined
- Handling
void:voidable<T>(value: T | void): T | null | undefined
Full documentation is available in the repository.
0.3.0
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.2.0-beta
5 years ago
0.2.0-alpha.1
5 years ago
0.2.0-alpha
5 years ago
0.1.0
6 years ago