portfolio/src/utils/notNil.ts

5 lines
136 B
TypeScript
Raw Normal View History

export function notNil<TValue>(
value: TValue | null | undefined,
): value is TValue {
return value !== null && value !== undefined;
}