anchor.diff:      end.
   
   
  -%% @private
   -spec merge([json_term()]) -> json_term().
   merge(JsonTerms) ->
       lists:foldl(fun
  -        (Json, ParentJson) when is_map(Json) andalso is_map(ParentJson) ->
  -            ChildKeys = maps:keys(Json),
  -            ParentKeys = maps:keys(ParentJson),
  -            ChildOnlyKey = ChildKeys -- ParentKeys,
  -            CommonKeys = ChildKeys -- ChildOnlyKey,
  -
  -            ResultingJson = maps:merge(
  -                ParentJson,
  -                maps:with(ChildOnlyKey, Json)
  -            ),
  -
  -            lists:foldl(fun(Key, Acc) ->
  -                ChildValue = maps:get(Key, Json),
  -                ParentValue = maps:get(Key, ParentJson),
  -                Acc#{Key => merge([ParentValue, ChildValue])}
  -            end, ResultingJson, CommonKeys);
  +        (ChildJson, ParentJson) when is_map(ChildJson) andalso is_map(ParentJson) ->
  +
  +            maps:fold(fun(ChildKey, ChildValue, Acc) ->
  +                case maps:find(ChildKey, ParentJson) of
  +                    {ok, ParentValue} ->
  +                        Acc#{ChildKey => merge([ParentValue, ChildValue])};
  +                    error ->
  +                        Acc#{ChildKey => ChildValue}
  +                end
  +            end, ParentJson, ChildJson);
   
           (Json, _ParentJson) ->
               Json
  
positive.code: %%%===================================================================
  
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% Set nth element of list
  %% @end
  %%--------------------------------------------------------------------
  -spec setnth(non_neg_integer(), list(), term()) -> list().
  setnth(1, [_ | Rest], New) -> [New | Rest];
  setnth(I, [E | Rest], New) -> [E | setnth(I - 1, Rest, New)].
  
  
  %% @private
  
negative.code:                             ++ [null || _ <- lists:seq(Length + 1, Index - 1)]
                              ++ [insert(undefined, JsonToInsert, Rest)];
                          false ->
                              replace_element(
                                  Index,
                                  insert(lists:nth(Index, Json), JsonToInsert, Rest),
                                  Json
                              )
                      end
              end;
  