Home / Function/ entryMatchesFilter() — supabase Function Reference

entryMatchesFilter() — supabase Function Reference

Architecture documentation for the entryMatchesFilter() function in Troubleshooting.ui.client.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  50418d02_d583_5686_b750_bfbb4179ffa8["entryMatchesFilter()"]
  71ab7703_5840_6100_57f2_d212311b9522["TroubleshootingListControllerInternal()"]
  71ab7703_5840_6100_57f2_d212311b9522 -->|calls| 50418d02_d583_5686_b750_bfbb4179ffa8
  style 50418d02_d583_5686_b750_bfbb4179ffa8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Troubleshooting.ui.client.tsx lines 81–107

function entryMatchesFilter(
  entry: HTMLElement,
  selectedProducts: string[],
  selectedErrorCodes: string[],
  selectedTags: string[],
  searchState: string
) {
  const content = entry.textContent ?? ''
  const dataKeywords = entry.getAttribute(TROUBLESHOOTING_DATA_ATTRIBUTES.KEYWORDS_LIST_ATTRIBUTE)
  const dataProducts = entry.getAttribute(TROUBLESHOOTING_DATA_ATTRIBUTES.PRODUCTS_LIST_ATTRIBUTE)
  const dataErrors = entry.getAttribute('data-errors')?.split(',') ?? []

  const productsMatch =
    selectedProducts.length === 0 ||
    selectedProducts.some((product) => dataProducts?.includes(product))
  const tagsMatch =
    selectedTags.length === 0 || selectedTags.some((tag) => dataKeywords?.includes(tag))
  const errorsMatch =
    selectedErrorCodes.length === 0 ||
    selectedErrorCodes.some((error) =>
      dataErrors.some((errorCode) => errorCode.includes(error.toString()))
    )
  const searchMatch =
    searchState === '' || content.toLowerCase().includes(searchState.toLowerCase())

  return productsMatch && errorsMatch && tagsMatch && searchMatch
}

Subdomains

Frequently Asked Questions

What does entryMatchesFilter() do?
entryMatchesFilter() is a function in the supabase codebase.
What calls entryMatchesFilter()?
entryMatchesFilter() is called by 1 function(s): TroubleshootingListControllerInternal.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free