FilterByField
cartographer / filterByField
Function: filterByField()
Section titled “Function: filterByField()”filterByField<
T>(items,fieldKey,value):CatalogItem[]
Defined in: queries/queryFunctions.ts:194
Filter items where a field value equals a target value (strict equality).
Type Parameters
Section titled “Type Parameters”T extends string | number | boolean | string[] | Date | null = string
Type of field value being compared
Parameters
Section titled “Parameters”Array of items to filter
fieldKey
Section titled “fieldKey”string
Field key to check
T
Exact value to match
Returns
Section titled “Returns”- Items where field === value
Example
Section titled “Example”const approved = filterByField(items, 'catalog-status', 'approved');