Skip to content

feat(builtin): add merge() for combining maps#947

Open
eyupcanakman wants to merge 1 commit intoexpr-lang:masterfrom
eyupcanakman:feat/merge-maps-builtin-895
Open

feat(builtin): add merge() for combining maps#947
eyupcanakman wants to merge 1 commit intoexpr-lang:masterfrom
eyupcanakman:feat/merge-maps-builtin-895

Conversation

@eyupcanakman
Copy link

Adds a variadic merge() builtin that shallow-merges two or more maps into a new map. Later arguments override earlier ones (last-write-wins). Inputs are not modified.

merge({"a": 1, "b": 2}, {"b": 3, "c": 4})
// {"a": 1, "b": 3, "c": 4}

Fixes #895

Add a variadic merge() builtin that shallow-merges two or more maps.
Later maps override earlier ones (last-write-wins). Returns a new map
without modifying inputs.

Closes expr-lang#895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new builtin for merging maps

1 participant