-
Notifications
You must be signed in to change notification settings - Fork 41
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
Adds: Brand filtering #9
Conversation
- Provides ability to filter brands by way of a configuration object, e.g. { NHL: { description: ['Anaheim Ducks', 'Dallas Stars'] } will filter the ducks and dallas stars out of NHL outfit results (using the description key as the matching field).
I can definitely add documentation around how one might use this since it requires a bit of digging into and learning a bit about the actual data. edit: modified the example(s) above - hopefully those can suffice for documentation around how one would filter things in/out, as well as the important bits of |
@willdavidow should this be its own wiki page or added into the traditional docs that I provided? If its the latter, would you be able to update the formatting so it matches the style of documentation that I originally provided? |
I'd imagine it makes sense for it to be included in traditional documentation since it's part of the library API.. I'll update the docs a little later on today so they match the formatting of the Libmoji Docs Wiki you've already defined. |
@matthewnau, how's this:
|
@willdavidow yes this is good. I'll upload when I can. Thanks! 👍 |
Adds ability to filter brands by configuration object. Configuration object is flexible, model is as follows:
the
filterBrands(brands, filters, returnFilteredFields = false)
function accepts three parameters:brands
object (e.g.libmoji.getBrands('male')
)true
) or exclude (false
, this is default) items that are in the filterconfiguration.
Example usage:
Exclude items from config object in brand-specific filtered result set:
Include ONLY items from config object in brand-specific filtered result set by passing the third parameter as
true
(it defaults tofalse
). Brands that have no filtering configuration will pass through and return their complete set.