This acknowledge that merging could be simple or complex. Configuring merging should be easy and it should be robust. This library tackles some of the complexities of these statements. Please take a look at this Clojure library and make any suggestions in pull requests or issues.
You can use this library by adding it as a dependency:
At this point, merging is divided into 3 types of comparisons:
- All maps - Handled with a recursive call using
merge-with
- All non-map collections - Most of what has been considered so far. These are the functions that can currently been used. All of them handle all merges, but they are tailored to handle non-map collections
concat-merge
/concat-merge-with
- Puts all items into one vectordistinct-merge
/distinct-merge-with
- Puts all items into one deduplicated vectorindex-merge
/index-merge-with
- Handled with recursive calls using all values at each index and puts the results in a vector
- Other
- All functions that end with
-with
take a first parameter of a function that will handle these situations. All functions that lack this ending use the value from the last argument passed in - There are two other special merge methods that handle these scenarios
greedy-merge
- Does aconcat-merge-with
and puts other values into a single vectorgreedy-distinct-merge
- Does adistinct-merge-with
and puts other values into a single deduplicated vector
- All functions that end with
In order to make recommendations to this library, either please
- Fork this repository
- Create a branch (name it whatever you would like) in your repository created in step 1
- Make your changes to that branch
- Run tests
- Create a pull request from that branch of the forked repository to the master branch of this repository. Check the following values when creating it (steps 4 & 5):
base fork
should beJasonStiefel/clojure-deep-merge
base
should bemaster
head fork
should be your forked repository, created in step 1compare
should be the branch you created in step 2
Or create an issue with specifics of what is wrong or what you would like to see.
This incorporates Leiningen for its build/test/deploy process.
To test this project, run lein test
.