We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have the following situation:
const store = { widgets: { 1: { ... }, 2: { ... } } }
Each widget has the following structure:
const widget = { id: number, title: string, displayParameters: Object ... }
Sometimes displayParameters object may be empty.
displayParameters
So, the problem is that if displayParameters is an empty object, it disappears after updeep.
updeep
const newWidget = { id: 123, title: 'new one', displayParameters: {} }; store = updeep({ widgets: { [newWidget.id]: newWidget } }, store) /* store: { widgets: { ... 123: { id: 123, title: 'new one' } } } */
I have checked this issue and wrote the test - the same result. Not sure if it's correct behaviour.
it('it should not omit empty object', () => { const store = { widgets: { 1: { title: '123', displayParams: { index: 1 } } } }; const result = u({ widgets: { 123: { title: 'new widget', displayParams: {} } } }, store); expect(result).toEqual({ widgets: { 1: { title: '123', displayParams: { index: 1 } }, 123: { title: 'new widget', displayParams: {} // test is failed here } } }); });
The text was updated successfully, but these errors were encountered:
c083f4a
Thanks for the report and the test. This is fixed in 0.7.1. The behavior was actually intentional, but it's overly pedantic and surprising, I think.
Sorry, something went wrong.
Wow, it was quick. Thanks!
No branches or pull requests
I have the following situation:
Each widget has the following structure:
Sometimes
displayParameters
object may be empty.So, the problem is that if
displayParameters
is an empty object, it disappears afterupdeep
.I have checked this issue and wrote the test - the same result. Not sure if it's correct behaviour.
The text was updated successfully, but these errors were encountered: