/**
 * Resolves which bucket of the `globals` filter cache (_globals.ts) a
 * QueryComponent instance should read/write. viewboxId is checked first,
 * unconditionally.
 */
export const getFilterObjPath = (
  rootParam: string,
  viewboxId?: number
): string => {
  if (viewboxId) return `viewboxes.${viewboxId}`
  if (rootParam === 'home' || rootParam === 'editor') return 'editor'
  if (rootParam === 'view') return 'viewer'

  return ''
}
