Skip to main content
merge(maps...) combines all given maps or objects into one. When multiple arguments contain the same key, the value from the last argument wins.

Signature

Example

Start with a base set of environment variables and override specific values for the production environment:
In production, LOG_LEVEL is warn and MAX_WORKERS is 16. In staging, both use the base defaults.

Notes

  • Later arguments override keys from earlier arguments when there are conflicts.
  • merge accepts maps and objects. When merging maps, all maps must have the same value type.
  • merge does not perform deep merging. Nested values are replaced entirely, not merged recursively.