# deep-merge.cr **Repository Path**: src-upstream-repos/deep-merge.cr ## Basic Information - **Project Name**: deep-merge.cr - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-27 - **Last Updated**: 2024-01-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README * deep-merge [[https://github.com/peterhoeg/deep-merge.cr/workflows/Crystal%20CI/badge.svg]] Adds support for deep merges to =Hash= #+BEGIN_SRC crystal # normal merge { "a" => { "b" => 4 } }.merge({ "a" => { "c" => true } }) => { "a" => { "c" => true } } # deep merge { "a" => { "b" => 4 } }.deep_merge({ "a" => { "c" => true } }) => { "a" => { "b" => 4, "c" => true } } #+END_SRC * Installation Add it to =shards.yml= in your project: #+BEGIN_SRC yaml dependencies: deep-merge: gitlab: peterhoeg/deep-merge.cr #+END_SRC * Usage #+BEGIN_SRC crystal require "deep-merge" #+END_SRC =Hash= is now monkey-patched to support =.deep_merge= and =.deep_merge!= instance methods. ** TODO Add support for: - [ ] arrays (probably configurable) #+BEGIN_SRC crystal { "a" => [ "b" ] }.deep_merge({ "a" => [ "c" ] }) => { "a" => [ "b", "c" ] } #+END_SRC - [ ] arrays of Hashes * Development / Contributing 1. Fork it () 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Merge Request * Contributors - [[https://github.com/peterhoeg][peterhoeg]] Peter Hoeg - creator, maintainer