@vltpkg/dss-breadcrumb
The Dependency Selector Syntax breadcrumb utilities used by the vlt client.
A returned “Breadcrumb” object is a data structure that contains a linked list of items that where parsed from a given Dependency Selector Syntax query string that can be used to navigate through a given graph.
Usage
import { parseBreadcrumb } from '@vltpkg/dss-breadcrumb'
// Parse a selector string into a breadcrumbconst breadcrumb = parseBreadcrumb(':root > #a')
// Use the breadcrumb to navigate through the queryconsole.log(breadcrumb.current.value) // :rootbreadcrumb.next()console.log(breadcrumb.current.value) // a