Add optional `filterText` parameter to `filterStorage.subscriptionCount`
Background
With https://gitlab.com/eyeo/adblockplus/adblockpluscore/commit/d45b0201b8ed5d089ad3326f3f9fdf33309358a2 we removed Filter.subscriptionCount
, but that is still being used in adblockpluschrome/lib/whitelisting.js. This resulted in a regression, see eyeo/adblockplus/adblockpluschrome#24 (closed).
What to change
- Rename
filterStorage.subscriptionCount
tofilterStorage.getSubscriptionCount
and change it from a getter to a function. - Similar to
filterStorage.subscriptions
, add an optionalfilterText
parameter tofilterStorage.getSubscriptionCount
. When given, the subscription count returned should only be for subscriptions containing the given filter. - Update the tests and the JSDoc comment.
Integration notes
Ensure anywhere that uses Filter.subscriptionCount
or filterStorage.subscriptionCount
is updated to use filterStorage.getSubscriptionCount
. Ensure the filterText
parameter is passed where necessary.
Edited by Dave Vandyke