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

Using dot.pick with proxy object #51

Open
BartaG512 opened this issue Apr 1, 2020 · 0 comments
Open

Using dot.pick with proxy object #51

BartaG512 opened this issue Apr 1, 2020 · 0 comments

Comments

@BartaG512
Copy link

BartaG512 commented Apr 1, 2020

Currently pick does not work with proxies but maybe it could be extended like this:

index.js - 
DotObject.prototype.pick 
  - if (obj && typeof obj === 'object' && key in obj) {
  + if (obj && typeof obj === 'object' && Object.getOwnPropertyNames(obj).includes(key)) {

It works in the case if the proxy defines ownKeys() or getOwnPropertyDescriptor(target, key) methods.
Or maybe it could be extended with an option flag for this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant