Record of fields to translate.
The composed Meilisearch filter string. Empty when no fields survive.
import { buildFilterString } from "@playlive/tiltify-search/filters";
buildFilterString({ public: true, type: "campaign" });
// 'public = true AND type = "campaign"'
// Embedded quotes and backslashes are escaped so the filter parses cleanly
// instead of returning a 400 from the search index:
buildFilterString({ username: 'a"b\\c' });
// 'username = "a\\"b\\\\c"'
Convert a FilterableFields record into a Meilisearch filter literal (
field = "value" AND other = true). Dropsundefinedvalues, drops empty strings (which would otherwise produce a malformedfield =clause), quotes string values, and escapes embedded"/ `` inside string values per the Meilisearch filter-syntax spec.