function defaultFilterPages(
  page,
  excludedRoute,
  { minimatch, withoutTrailingSlash, resolvePagePath }
) {
  if (typeof excludedRoute !== `string`) {
    throw new Error(
      `You've passed something other than string to the exclude array. This is supported, but you'll have to write a custom filter function.
Ignoring the input for now: ${JSON.stringify(excludedRoute, null, 2)}
https://www.gatsbyjs.com/plugins/gatsby-plugin-sitemap/#api-reference
      `
    )
  }

  // Minimatch is always scary without an example
  // TODO add example
  return minimatch(
    withoutTrailingSlash(resolvePagePath(page)),
    withoutTrailingSlash(excludedRoute)
  )
}
@name defaultFilterPages

This allows filtering any data in any way.

This Function is executed via allPages.filter((page) => !excludes.some((excludedRoute) => thisFunc(page, ecludedRoute, tools)))
allPages is the results of the resolvePages

@param {object} page
@param {string} excludedRoute - Array from plugin config `options.exclude`
@param {object} tools - contains required tools for filtering

@returns {boolean}