Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more specific test for filter function
for #990 @esjewett, I think this is a slightly safer way to check for a custom filter function such as those in dc.filters
- Loading branch information
4d62f65
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, seems so. Previous approach would have broken if the dimension was made up of arrays?
4d62f65
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's more about clarity - AFAICS either way should detect the current filters fine.
The only potential bug I imagined for the previous approach is if a filter was not an array. All the ones in dc.filters are annotated arrays. However, in theory a custom filter could be any kind of object that supports
isFiltered
andfilterType
, and the fact that the current ones are arrays seems like an accident.I added some documentation around this.