Introduce CKEDITOR.tools.object.merge function #1053
Labels
changelog:api
A changelog entry should be put in the API section of the changelog.
good first issue
Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request.
target:major
Any docs related issue that should be merged into a major branch.
type:feature
A feature request.
Milestone
Are you reporting a feature request or a bug?
New feature
Provide detailed reproduction steps (if any)
We need a function to recursively merge objects.
This function should take 2 params
obj1
,obj2
and return the object that is a result of merging the two. Keep in mind that neitherobj1
norobj2
should be modified by this function (add a TC for that).If the same primitive value is available in
obj1
andobj2
, the value fromobj2
should be used.This function should land in
CKEDITOR.tools.object
namespace, as amerge
function.If possible function may do a feature detection and use
Object.assign
.Examples
Should result with the following object:
The text was updated successfully, but these errors were encountered: