cloner 1.0.1
cloner: ^1.0.1 copied to clipboard
Utilities for deep cloning collections and custom types with flexible extension points and optional circular reference detection.
1.0.1 #
Added #
- New
CountedClonerandHashedClonerimplementations:CountedClonerenforces recursion depth and total clone count limits to prevent stack overflows and runaway cloning.HashedClonerprovides circular reference detection for collections, throwingCircularReferenceCloneExceptionon cycles.
LimitExceededExceptionfor reporting exceeded size/nesting limits during cloning.- Benchmarks and performance recommendations for different cloner implementations (see doc/benchmarks)
Changed #
Clonernow usesCountedCloneras the default global cloner instead ofBaseClonerICloning.replicatesignature simplified: removeddoCircRefCheckparameter (circular reference detection is now handled byHashedCloner)- Collection extension methods (
clone,cloneDynamic) no longer acceptdoCircRefCheckparameter - Improved documentation and README with new "Benchmarks" and "Worth Noting" sections
Fixed #
- Improved test coverage for circular reference and limit enforcement scenarios
1.0.0 #
Initial version #
ICloneableandICopyablecontracts for custom deep/shallow copy supportClonerfacade with pluggable backendBaseClonerdefault implementation andICloninginterface for custom cloners- Element/value-wise deep cloning for
List,Set, andMap - Optional circular-reference detection
- Element/value-wise deep cloning for
- Collection extensions:
List.clone()/Set.clone()/Map.clone() MapClonetyped map wrapper for safe nested typed map cloning andcopy()/clone()helpers- Typed-clone safety checks and
UnsupportedTypedCloneExceptionfor unsupported typed scenarios - Preserves common concrete collection implementations (
LinkedHashMap,HashMap) where possible