Skip to main content
Module

x/evt/lib/util/genericOperators/nonNullable.ts

💧EventEmitter's typesafe replacement
Go to Latest
File

const isNonNullable = <T>(arg: T): arg is NonNullable<T> => arg !== undefined && arg !== null;
const nonNullableImpl = <T>(data: T) => !isNonNullable(data) ? null : [data] as const;
export const nonNullable = <T>(): import("../../types/index.ts").Operator.fλ.Stateless<T, NonNullable<T>> => nonNullableImpl;