Browse Source

Improve README a bit

Sven Slootweg 1 month ago
parent
commit
da7feeaab8
1 changed files with 5 additions and 1 deletions
  1. 5 1
      README.md

+ 5 - 1
README.md

@ -1,6 +1,8 @@
1 1
# merge-by-template
2 2
3
__This module is still a work-in-progress!__ It's already usable in production code, but the documentation is still rough, and its API might still change in the future.
3
A library for generating custom deep-merging functions, that merge data structures according to a set of (nested) rules that you specify.
4
5
__This module is still a work-in-progress!__ It's already usable in production code, but the documentation is still rough, it may contain the occasional bug, and its API might still change in the future.
4 6
5 7
## Example
6 8
@ -86,6 +88,8 @@ This section will be expanded in the future.
86 88
87 89
__The basic principle:__ Regardless of how many values you pass into the custom merging function, it will always merge them per 2. So if you pass in `[ a, b, c ]` then it will first merge `b` onto `a`, and then merge `c` onto the result of the `b -> a` merger. The B side always takes precedence in the default merging strategies.
88 90
91
Rules can be nested __to any depth__ (until you hit the runtime's stack size limit, anyway). This allows merging complex nested data structures.
92
89 93
For now, a quick listing of rule syntax:
90 94
91 95
- __No rule specified (or explicit `null` or `undefined` specified):__ One value overrides the other in full, even if that value is an object or array.