getShortenedCategories

Function

returns the last section of each category path. Example: "/categories/parent/child" > "child"

returns the last section of each category path. Example: "/categories/parent/child" > "child"

  • getShortenedCategories(categories: string[]) : string[]

Parameters

Parameter Type Default Notes
categories Required string[]

an item's categories

Returns

string[]

Function defined in common/src/content/_internal/internalContentUtils.ts:729