Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

473 B
Raw Blame
import { pick } from 'lodash-es'

/**
 * Gets the tab selection state from the URL search params.
 *
 * Sanitizes by including only those search params that are explicitly marked
 * as query groups.
 */
const getSanitizedTabParams = () => {
  const searchParams = new URLSearchParams(window.location.search)
  const queryGroups = searchParams.getAll('queryGroups')

  return pick(Object.fromEntries(searchParams.entries()), queryGroups)
}

export { getSanitizedTabParams }