mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
17 lines
470 B
TypeScript
17 lines
470 B
TypeScript
import { pick } from 'lodash'
|
|
|
|
/**
|
|
* 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 }
|