fix(SW-2118): changed variants for breadcrumbs to handle different background-colors and widths * fix(SW-2118): changed variants for breadcrumbs to handle different background-colors and widths Approved-by: Christian Andolf Approved-by: Linus Flood
13 lines
301 B
TypeScript
13 lines
301 B
TypeScript
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 }
|