(maps before after)
Find a difference between two maps. Returns a sequence of changes, which if applied in order transform map 'before' into map 'after' Maps could be nested.
Examples of basic changes: MapEntryDeleted{:key [:a], :value 1} MapEntryAdded{:key [:a :b :c], :value 10}
Can squash basic changes to detect more advanced changes: MapValueEdited{:key [:a], :value-from 1, :value-to 2} MapValueRenamed{:key-from [:a], :key-to [:b], :value 1}
Find a difference between two maps. Returns a sequence of changes, which if applied in order transform map 'before' into map 'after' Maps could be nested. Examples of basic changes: MapEntryDeleted{:key [:a], :value 1} MapEntryAdded{:key [:a :b :c], :value 10} Can squash basic changes to detect more advanced changes: MapValueEdited{:key [:a], :value-from 1, :value-to 2} MapValueRenamed{:key-from [:a], :key-to [:b], :value 1}
(maps-edited-changes basic-changes)
Detects 'edited' changes using basic 'added' and 'deleted' changes Uses squash rule to merge two changes into one MapEntryDeleted{:key [:a], :value 1} MapEntryAdded{:key [:a], :value 2} vvv MapValueChanged{:key [:a] :value-from 1 :value-to 2}
Returns vector of 2 values
Detects 'edited' changes using basic 'added' and 'deleted' changes Uses squash rule to merge two changes into one MapEntryDeleted{:key [:a], :value 1} MapEntryAdded{:key [:a], :value 2} vvv MapValueChanged{:key [:a] :value-from 1 :value-to 2} Returns vector of 2 values - edited changes to be added to result - added and deleted changes used for merge to be deleted from result
(maps-renamed-changes basic-changes)
Detects 'renamed' changes using basic :added and :deleted changes Uses squash rule to merge two changes into one MapEntryDeleted{:key [:a], :value 1} MapEntryAdded{:key [:b], :value 1} vvv MapKeyRenamed{:key-from [:a], :key-to [:b], :value 1}
Returns vector of 2 values
Detects 'renamed' changes using basic :added and :deleted changes Uses squash rule to merge two changes into one MapEntryDeleted{:key [:a], :value 1} MapEntryAdded{:key [:b], :value 1} vvv MapKeyRenamed{:key-from [:a], :key-to [:b], :value 1} Returns vector of 2 values - renamed changes to be added to result - added and deleted changes used for merge to be deleted from result
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close