compact
ts
function Set.compact<T>(
target: ReadonlySet<T>,
): ReadonlySet<NonNil<T>>Returns a set with all null and undefined values removed.
Example
ts
import { Set } from "@monstermann/set";
Set.compact(Set.create([1, null, 2, undefined])); // Set([1, 2])
Set.compact(Set.create([1, 2, 3])); // Set([1, 2, 3])ts
import { Set } from "@monstermann/set";
pipe(Set.create([1, null, 2, undefined]), Set.compact()); // Set([1, 2])
pipe(Set.create([1, 2, 3]), Set.compact()); // Set([1, 2, 3])