Function notNullOrEmpty

  • Returns a Stream that yields elements that are not null, undefined, or empty.

    Type Parameters

    • T extends {
          length: number;
      }

      Type of items in the source.

    Returns OperationFunction<T | null | undefined, NonNullable<T>>

    Operation that yields elements that are not null, undefined, or empty.

    const result = notNullOrEmpty<string>()(["", "a", null, "b", undefined, "c"]);
    console.log([...result]); // ["a", "b", "c"]