Converts a ReadonlySet<V> type to its mutable counterpart Set<V>. Extracts the value type from the readonly set and creates a standard mutable Set.
ReadonlySet<V>
Set<V>
A type that extends ReadonlySet<any>.
ReadonlySet<any>
The corresponding mutable Set<V> type.
type ReadOnlyStringSet = ReadonlySet<string>;type MutableStringSet = ToMutableSet<ReadOnlyStringSet>; // Set<string>// Converting readonly collections to mutable onesconst convertToMutable = (readonlySet: ReadonlySet<string>): Set<string> => { return new Set(readonlySet);}; Copy
type ReadOnlyStringSet = ReadonlySet<string>;type MutableStringSet = ToMutableSet<ReadOnlyStringSet>; // Set<string>// Converting readonly collections to mutable onesconst convertToMutable = (readonlySet: ReadonlySet<string>): Set<string> => { return new Set(readonlySet);};
Converts a
ReadonlySet<V>type to its mutable counterpartSet<V>. Extracts the value type from the readonly set and creates a standard mutable Set.