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

Throw error on invalid params #5

Open
jmsv opened this issue May 9, 2019 · 3 comments
Open

Throw error on invalid params #5

jmsv opened this issue May 9, 2019 · 3 comments

Comments

@jmsv
Copy link
Owner

jmsv commented May 9, 2019

Throw error when:

  • a target key value is not a valid key/string
  • .get() function is called with key that isn't indexed
  • etc.
@j-m
Copy link
Collaborator

j-m commented May 12, 2019

On redesign this just returns undefined copying the behaviour of find.

@jmsv
Copy link
Owner Author

jmsv commented May 12, 2019

Feel like an error should be thrown when trying to call get with a key that’s not indexed

@j-m
Copy link
Collaborator

j-m commented May 12, 2019

Ah I see your point. If options.keys is defined then yes I agree, otherwise no. If the data is dynamic then they might not always have that key but sometimes could, I would rather have undefined or an empty array returned in this case than have to handle an error.

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

2 participants