Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Conversation

@alanshaw
Copy link
Contributor

If x has a property explicitly set to undefined then expect(y).to.eql(x) requires y to also have a property set to undefined. This PR relaxes that requirement to also allow y to simply not have the property.

This is to save having to explicitly re-define this property to undefined when y has been JSON.stringify'd. This happens in the ipfs-postmsg-proxy and this change removes the need for the proxy to know the shape of this object (or at least which properties might have been undefined).

If `x` has a property explicitly set to `undefined` then `expect(x).to.eql(y)` requires `y` to also have a property set to undefined. This PR relaxes that requirement to also allow `y` to simply not have the property.

This is to save having to explicitly re-define this property to undefined when y has been `JSON.stringify`'d. This happens in the ipfs-postmsg-proxy and this change removes the need for the proxy to know the shape of this object (or at least which properties might have been undefined).

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
@ghost ghost assigned alanshaw Sep 17, 2018
@ghost ghost added the in progress label Sep 17, 2018
Copy link
Contributor Author

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alanshaw alanshaw merged commit a7bdb9a into master Sep 19, 2018
@alanshaw alanshaw deleted the refactor/relax-undefined-check branch September 19, 2018 14:02
@ghost ghost removed the in progress label Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants