map/deep_freeze_utils library
Deep freeze: recursively unmodifiable views of maps, lists, and sets. Roadmap #90.
Dart has no language-level immutability, but Map/List/Set offer
.unmodifiable views that throw on mutation. Applying that recursively
guards a whole configuration / decoded-JSON tree against accidental edits
shared across call sites — a defensive copy that fails loud instead of
silently letting one consumer corrupt another's data.
Functions
-
deepFreeze(
Object? value) → Object? -
Returns a deeply-unmodifiable copy of
value.