vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Classes
  • Breadcrumb
  • InteractiveBreadcrumb
  • Interfaces
  • ModifierBreadcrumb
  • Type Aliases
  • BreadcrumbSpecificity
  • InternalModifierComparatorOptions
  • ModifierBreadcrumbItem
  • ModifierComparatorOptions
  • ModifierInteractiveBreadcrumb
  • Functions
  • extractPseudoParameter()
  • getPseudoSelectorFullText()
  • parseBreadcrumb()
  • removeQuotes()
  • specificitySort()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/dss-breadcrumb
  6. /
  7. Reference

Reference

Classes

Breadcrumb

Defined in: index.ts:169

The Breadcrumb class is used to represent a valid breadcrumb path that helps you traverse a graph and find a specific node or edge.

Alongside the traditional analogy, "Breadcrumb" is also being used here as a term used to describe the subset of the query language that uses only pseudo selectors, id selectors & combinators.

The Breadcrumb class implements a doubly-linked list of items that can be used to navigate through the breadcrumb. The InteractiveBreadcrumb can also be used to keep track of state of the current breadcrumb item that should be used for checks.

It also validates that each element of the provided query string is valid according to the previous definition of a "Breadcrumb" query language subset.

Implements

  • ModifierBreadcrumb

Constructors

new Breadcrumb()
TypeScript
new Breadcrumb(query): Breadcrumb

Defined in: index.ts:178

Initializes the interactive breadcrumb with a query string.

Parameters
ParameterType
querystring
Returns

Breadcrumb

Properties

PropertyType
commentundefined | string
specificityBreadcrumbSpecificity

Accessors

first
Get Signature
TypeScript
get first(): ModifierBreadcrumbItem

Defined in: index.ts:338

Retrieves the first breadcrumb item.

Returns

ModifierBreadcrumbItem

Implementation of

ModifierBreadcrumb.first

last
Get Signature
TypeScript
get last(): ModifierBreadcrumbItem

Defined in: index.ts:348

Retrieves the last breadcrumb item.

Returns

ModifierBreadcrumbItem

Implementation of

ModifierBreadcrumb.last

single
Get Signature
TypeScript
get single(): boolean

Defined in: index.ts:359

Returns true if the breadcrumb is composed of a single item.

Returns

boolean

Implementation of

ModifierBreadcrumb.single

Methods

[iterator]()
TypeScript
iterator: ArrayIterator<ModifierBreadcrumbItem>

Defined in: index.ts:363

Returns

ArrayIterator<ModifierBreadcrumbItem>

Implementation of
TypeScript
ModifierBreadcrumb.[iterator]
clear()
TypeScript
clear(): void

Defined in: index.ts:370

Empties the current breadcrumb list.

Returns

void

Implementation of

ModifierBreadcrumb.clear

interactive()
TypeScript
interactive(): InteractiveBreadcrumb

Defined in: index.ts:382

Gets an InteractiveBreadcrumb instance that can be used to track state of the current breadcrumb item.

Returns

InteractiveBreadcrumb

Implementation of

ModifierBreadcrumb.interactive


InteractiveBreadcrumb

Defined in: index.ts:391

The InteractiveBreadcrumb is used to keep track of state of the current breadcrumb item that should be used for checks.

Implements

  • ModifierInteractiveBreadcrumb

Constructors

new InteractiveBreadcrumb()
TypeScript
new InteractiveBreadcrumb(breadcrumb): InteractiveBreadcrumb

Defined in: index.ts:393

Parameters
ParameterType
breadcrumbBreadcrumb
Returns

InteractiveBreadcrumb

Accessors

current
Get Signature
TypeScript
get current(): 
  | undefined
  | ModifierBreadcrumbItem

Defined in: index.ts:400

The current breadcrumb item.

Returns

| undefined | ModifierBreadcrumbItem

Implementation of
TypeScript
ModifierInteractiveBreadcrumb.current
done
Get Signature
TypeScript
get done(): boolean

Defined in: index.ts:407

Returns true if the current breadcrumb has no more items left.

Returns

boolean

Implementation of
TypeScript
ModifierInteractiveBreadcrumb.done

Methods

next()
TypeScript
next(): this

Defined in: index.ts:414

The next breadcrumb item.

Returns

this

Implementation of
TypeScript
ModifierInteractiveBreadcrumb.next

Interfaces

ModifierBreadcrumb

Defined in: types.ts:40

A breadcrumb is a linked list of items, where each item has a value and a type.

Extends

  • Iterable<ModifierBreadcrumbItem>

Properties

PropertyType
commentundefined | string
firstModifierBreadcrumbItem
interactive() => ModifierInteractiveBreadcrumb
lastModifierBreadcrumbItem
singleboolean
specificityBreadcrumbSpecificity

Methods

clear()
TypeScript
clear(): void

Defined in: types.ts:41

Returns

void

Type Aliases

BreadcrumbSpecificity

TypeScript
type BreadcrumbSpecificity = object;

Defined in: types.ts:4

The specificity of a breadcrumb, used for sorting.

Type declaration

NameType
commonCounternumber
idCounternumber

InternalModifierComparatorOptions

TypeScript
type InternalModifierComparatorOptions = object;

Defined in: types.ts:12

Options for the higher-level comparing breadcrumbs function.

Type declaration

NameType
range?string

ModifierBreadcrumbItem

TypeScript
type ModifierBreadcrumbItem = object;

Defined in: types.ts:26

A valid item of a given breadcrumb.

Type declaration

NameType
comparator(opts) => boolean
importerboolean
name?string
next| ModifierBreadcrumbItem | undefined
prev| ModifierBreadcrumbItem | undefined
typestring
valuestring

ModifierComparatorOptions

TypeScript
type ModifierComparatorOptions = object;

Defined in: types.ts:19

Options for comparing breadcrumbs.

Type declaration

NameType
semver?string

ModifierInteractiveBreadcrumb

TypeScript
type ModifierInteractiveBreadcrumb = object;

Defined in: types.ts:53

An interactive breadcrumb that holds state on what is the current item.

Type declaration

NameType
current| ModifierBreadcrumbItem | undefined
doneboolean
next() => ModifierInteractiveBreadcrumb

Functions

extractPseudoParameter()

TypeScript
function extractPseudoParameter(item): ParsedPseudoParameters

Defined in: index.ts:86

Helper function to extract parameter value from pseudo selector nodes.

Parameters

ParameterType
itemany

Returns

ParsedPseudoParameters


getPseudoSelectorFullText()

TypeScript
function getPseudoSelectorFullText(item): string

Defined in: index.ts:122

Helper function to get the full text representation of a pseudo selector including parameters

Parameters

ParameterType
itemPostcssNode

Returns

string


parseBreadcrumb()

TypeScript
function parseBreadcrumb(query): ModifierBreadcrumb

Defined in: index.ts:424

Returns an Breadcrumb list of items for a given query string.

Parameters

ParameterType
querystring

Returns

ModifierBreadcrumb


removeQuotes()

TypeScript
function removeQuotes(value): string

Defined in: index.ts:80

Helper function to remove quotes from a string value.

Parameters

ParameterType
valuestring

Returns

string


specificitySort()

TypeScript
function specificitySort(breadcrumbs): ModifierBreadcrumb[]

Defined in: index.ts:433

Sorts an array of Breadcrumb objects by specificity. Objects with higher idCounter values come first, if idCounter values are equal, then objects with higher commonCounter values come first. Otherwise, the original order is preserved.

Parameters

ParameterType
breadcrumbsModifierBreadcrumb[]

Returns

ModifierBreadcrumb[]


Previous@vltpkg/dss-breadcrumbNext@vltpkg/dss-parser

On this page

  • Classes
  • Breadcrumb
  • InteractiveBreadcrumb
  • Interfaces
  • ModifierBreadcrumb
  • Type Aliases
  • BreadcrumbSpecificity
  • InternalModifierComparatorOptions
  • ModifierBreadcrumbItem
  • ModifierComparatorOptions
  • ModifierInteractiveBreadcrumb
  • Functions
  • extractPseudoParameter()
  • getPseudoSelectorFullText()
  • parseBreadcrumb()
  • removeQuotes()
  • specificitySort()

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now