Skip to content

FilterByField

cartographer


cartographer / 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).

T extends string | number | boolean | string[] | Date | null = string

Type of field value being compared

CatalogItem[]

Array of items to filter

string

Field key to check

T

Exact value to match

CatalogItem[]

  • Items where field === value
const approved = filterByField(items, 'catalog-status', 'approved');