flattenFilters
Flattens an array of IFilter objects into a map of key/value pairs where the key is the name of the predicate and the value is a unique array of all values for that predicate name spanning all collections and predicates. Uniqueness is only guaranteed for primitives (i.e. strings, boolean, number, etc). E.g.
const x = flattenFilters([{ predicates: [{ access: 'public', }, { access: 'org', }], }, { predicates: [{ access: ['private', 'org] }] }]);
x // => { access: ['public', 'org', 'private']}
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
filters Required | IFilter[] |
An array of IFilter objects |
Returns
an object containing key/value pairs of parameter values
Record<stringany[]>
Function defined in common/src/search/_internal/hubDiscussionsHelpers/processChannelFilters.ts:26