import { Shrinkable } from '../Shrinkable' import { shrinkableArray } from './array' /** * Creates a shrinkable for `Set` instances. * The shrinking process is based on shrinking the underlying array representation of the set. * It ensures that the size of the set does not shrink below the specified minimum size. * * @param array - An array of `Shrinkable` elements that will form the initial set. * @param minSize - The minimum number of elements the shrunk set must contain. * @returns A `Shrinkable` instance for the `Set`. */ export function shrinkableSet(array: Array>, minSize: number): Shrinkable> { const shrinkableArr = shrinkableArray(array, minSize) return shrinkableArr.map(theArr => new Set(theArr)) }