From da7feeaab87f4cee17ba48ed489c800eb7c7e894 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 21 Jun 2020 02:54:32 +0200 Subject: [PATCH] Improve README a bit --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75e5649..fa0b832 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # merge-by-template -__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. +A library for generating custom deep-merging functions, that merge data structures according to a set of (nested) rules that you specify. + +__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. ## Example @@ -86,6 +88,8 @@ This section will be expanded in the future. __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. +Rules can be nested __to any depth__ (until you hit the runtime's stack size limit, anyway). This allows merging complex nested data structures. + For now, a quick listing of rule syntax: - __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.