cloner 1.0.1 copy "cloner: ^1.0.1" to clipboard
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 CountedCloner and HashedCloner implementations:
    • CountedCloner enforces recursion depth and total clone count limits to prevent stack overflows and runaway cloning.
    • HashedCloner provides circular reference detection for collections, throwing CircularReferenceCloneException on cycles.
  • LimitExceededException for reporting exceeded size/nesting limits during cloning.
  • Benchmarks and performance recommendations for different cloner implementations (see doc/benchmarks)

Changed #

  • Cloner now uses CountedCloner as the default global cloner instead of BaseCloner
  • ICloning.replicate signature simplified: removed doCircRefCheck parameter (circular reference detection is now handled by HashedCloner)
  • Collection extension methods (clone, cloneDynamic) no longer accept doCircRefCheck parameter
  • 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 #

  • ICloneable and ICopyable contracts for custom deep/shallow copy support
  • Cloner facade with pluggable backend
  • BaseCloner default implementation and ICloning interface for custom cloners
    • Element/value-wise deep cloning for List, Set, and Map
    • Optional circular-reference detection
  • Collection extensions: List.clone() / Set.clone() / Map.clone()
  • MapClone typed map wrapper for safe nested typed map cloning and copy()/clone() helpers
  • Typed-clone safety checks and UnsupportedTypedCloneException for unsupported typed scenarios
  • Preserves common concrete collection implementations (LinkedHashMap, HashMap) where possible
0
likes
160
points
44
downloads

Publisher

unverified uploader

Weekly Downloads

Utilities for deep cloning collections and custom types with flexible extension points and optional circular reference detection.

Repository (GitLab)

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on cloner