function filterHeadProps(input) {
  return {
    location: {
      pathname: input.location.pathname,
    },
    params: input.params,
    data: input.data || {},
    serverData: input.serverData,
    pageContext: input.pageContext,
  }
}
Filter the props coming from a page down to just the ones that are relevant for head.
This e.g. filters out properties that are undefined during SSR.