import type { Breadcrumb } from "./breadcrumbs"

function splitBreadcrumbs(
  breadcrumbs: Breadcrumb[]
): [Breadcrumb, Breadcrumb[], Breadcrumb] {
  const copy = breadcrumbs.slice(0)
  const first = copy.shift()!
  const last = copy.pop()!
  return [first, copy, last]
}

export { splitBreadcrumbs }
