/** * Filters out `None` values from a map whose values are of type `Maybe`. * * @tsplus getter ImmutableMap compact */ export function compact(self: ImmutableMap>): ImmutableMap { const map = new Map() for (const [key, value] of self.internalMap) { if (value.isSome()) { map.set(key, value.value) } } return new ImmutableMap(map) }