Bug: Util.extend deep doesn't do what you expect
See original GitHub issueI was writing a spec for Util.extend
and noticed passing deep
param wasn’t actually doing a deep merge, it was just doing a nested shallow merge…
I think we could also evaluate whether we need this utility anymore now with ES2015 classes and spread support. I think this was mainly to enable vanilla JS ex.Actor.extend(...)
syntax which can be replaced with proper ES2015 classes.
Steps to Reproduce
See src/spec/UtilSpec.ts
Expected Result
If it should deep merge, then do that but otherwise remove the deep
parameter.
Actual Result
Environment
- browsers and versions: Chrome 80
- operating system: Windows
- Excalibur versions: 0.23.0
Current Workaround
Use a merge utility from lodash
or equivalent.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
L.Util.setOptions does not merge objects in config · Issue #8396
When extending a LeafletControl (maybe other classes as well), nested options are not merged, as I expect it. If I have an object...
Read more >Deep stubbing java.util.Function.apply does not work
Having to work with a real situation chain method call, let's say - mock.apply("foo").get(1).getManager().getSubordinates().get(0).getSalary() , ...
Read more >Util | Node.js v19.3.0 Documentation
The util.debuglog() method is used to create a function that conditionally writes debug messages to stderr based on the existence of the NODE_DEBUG...
Read more >Expect - Jest
The argument to expect should be the value that your code produces, and any argument to the matcher should be the correct value....
Read more >Jest Expect - w3resource
expect.not.objectContaining(object) will match any received object that does not recursively match the expected properties. That is, the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kamranayub I’m thinking we should perhaps deprecate this feature? It’s not really used widely in the codebase, and modern JS and other libraries support this better.
Extend is deprecated