dsfields / elv

Elvis operator functionality for JavaScript.
MIT License
7 stars 0 forks source link

elv.populated expected behavior? #4

Open electic opened 4 years ago

electic commented 4 years ago

If you have an array with undefined or null values, should elv.populated still return true?

dsfields commented 4 years ago

Elv is just checking to see if an array has entries. It's not validating if any of the entries are not null or undefined. I view the validation of entries in an array as a separate problem.

Let's use this issue to track the needed updates to documentation.

Do you see value in having a method that validates n+1 array entries are not null or undefined?

electic commented 4 years ago

Good point. Do you plan to release this for Typescript as well?

dsfields commented 4 years ago

Adding a .d.ts file to Definitely Typed is doable.