question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Util.extend deep doesn't do what you expect

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eonarheimcommented, Jun 5, 2021

@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.

0reactions
eonarheimcommented, Nov 12, 2021

Extend is deprecated

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found