Skip to content
New issue

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

t.like mishandles symbol-keyed and non-enumerable properties #3208

Closed
gibson042 opened this issue Jun 5, 2023 · 0 comments · Fixed by #3209
Closed

t.like mishandles symbol-keyed and non-enumerable properties #3208

gibson042 opened this issue Jun 5, 2023 · 0 comments · Fixed by #3209

Comments

@gibson042
Copy link
Contributor

This is actually two distinct but related issues affecting t.like, which is effectively a concordance deep comparison of a comparable value against a selector value, where the comparable is a filtered view of the actual input with respect to the selector.

  1. Rejection of empty selector objects mistakenly allows objects based on the presence of non-enumerable properties that are ignored by concordance, resulting in inappropriate pass results from e.g. t.like({}, Object.defineProperties({}, {x: {enumerable: false}})).
  2. Use of Object.entries(selector) in selectComparable ignores symbol-keyed properties that are respected by concordance, resulting in inappropriate failure results from e.g. t.like({[Symbol.toStringTag]: 'Custom'}, {[Symbol.toStringTag]: 'Custom'}).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant