proposal-collection-normalization icon indicating copy to clipboard operation
proposal-collection-normalization copied to clipboard

How can we retain the normalization logic when cloning a Map or Set?

Open celmaun opened this issue 9 months ago • 2 comments

As a proponent of immutable data structures, I consider cloning to be an essential function on data structures. For simple Map's we can just do new Map(map), but doing the same on a Map with normalization would make it lose the normalization logic. Has there been any consideration about how there might be a way to retain normalization when creating a copy? Perhaps a new method Map.prototype.clone()? Or a static method Map.from(map, options: { retainNormalization: boolean })?

celmaun avatar Jan 23 '25 14:01 celmaun