merge method

YamlMap merge (
  1. YamlMap defaults,
  2. YamlMap overrides
)

Merge the given options contents where the values in defaults may be overridden by overrides.

Some notes about merge semantics:

  • lists are merged (without duplicates).
  • lists of scalar values can be promoted to simple maps when merged with maps of strings to booleans (e.g., 'opt1', 'opt2' becomes {'opt1': true, 'opt2': true}.
  • maps are merged recursively.
  • if map values cannot be merged, the overriding value is taken.

Implementation

YamlMap merge(YamlMap defaults, YamlMap overrides) =>
    Merger().mergeMap(defaults, overrides);