jmsv / oaty

Object Array Transposer(y) - JS objects with multiple key/value structures
https://www.npmjs.com/package/oaty
MIT License
10 stars 0 forks source link

Throw error on invalid params #5

Open jmsv opened 5 years ago

jmsv commented 5 years ago

Throw error when:

j-m commented 5 years ago

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

jmsv commented 5 years ago

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

j-m commented 5 years ago

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.