import isNull from 'lodash/isNull'; import isUndefined from 'lodash/isUndefined'; /** Whether the value is _not_ `null` or `undefined` */ export const isDefined = ( val: T | null | undefined, ): val is Exclude => { return !isUndefined(val) && !isNull(val); };