Generate breadcrumbs from a URL
Turn absolute or relative URL path segments into decoded cumulative breadcrumb records.Description
Requirements
The solution exports the required breadcrumbsFromUrl API from the editable module.
Root url works deterministically for the documented normal, boundary, and repeated-use scenarios.
Absolute relative works deterministically for the documented normal, boundary, and repeated-use scenarios.
Decoded segments works deterministically for the documented normal, boundary, and repeated-use scenarios.
Query hash ignored works deterministically for the documented normal, boundary, and repeated-use scenarios.
Trailing slash works deterministically for the documented normal, boundary, and repeated-use scenarios.
Encoded segments works deterministically for the documented normal, boundary, and repeated-use scenarios.
Invalid url works deterministically for the documented normal, boundary, and repeated-use scenarios.
Decoded nested path
/projects/design%20system/components?tab=all
Projects / Design system / Components with cumulative hrefs
Display labels are decoded while href path segments remain correctly encoded.
Constraints
Accept absolute URLs and root-relative pathsIgnore search parameters and fragmentsReturn an empty array for the root path
Hints
Hint 1
Use URL with the injected base so absolute and relative inputs share one parser.
Hint 2
Filter empty path segments before decoding labels.
Hint 3
Build each href from the encoded segment prefix rather than re-encoding a full decoded path.