Skip to main content
The Deno 2 Release Candidate is here
Learn more
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..Stateless<T, NonNullable<T>> => nonNullableImpl;