Returns a type guard function, which receives an object and checks if the given property is not null.
Narrows the type of the given property within the object type from T | null to just T.
Example:
incoming type is { a: number, b: string | null }
outgoing type of returned type guard from propertyNotNull('b') is { a: number, b: string }
Returns a type guard function, which receives an object and checks if the given property is not null. Narrows the type of the given property within the object type from T | null to just T.
Example:
incoming type is { a: number, b: string | null }
outgoing type of returned type guard from propertyNotNull('b') is { a: number, b: string }