export function isPresent < T > ( t ) { return t !== undefined && t !== null ; } export function isDefined < T > ( t ) { return t !== undefined ; } export function isFilled < T > ( t ) { return t !== null ; } example export function hasPresentKey < K extends string | number | symbol > ( k ) { return function < T , V > ( a ) : a is T & { [ k in K ] : V ; } { return a [ k ] !== undefined && a [ k ] !== null ; } ; } example export function hasValueAtKey < K extends string | number | symbol , V > ( k , v ) { return function < T > ( a ) : a is T & { [ k in K ] : V ; } { return a [ k ] === v ; } ; }