Skip to main content

Locator

Locator are just like idents (including their identHash), except that they also contain a reference and an additional comparator hash. They are in this regard very similar to descriptors except that each descriptor may reference multiple valid candidate packages whereas each locators can only reference a single package.

This interesting property means that each locator can be safely turned into a descriptor (using convertLocatorToDescriptor), but not the other way around (except in very specific cases).

Hierarchy

Index

Properties

identHash

identHash: IdentHash

Unique hash of a package scope and name. Used as key in various places, so that two idents can be quickly compared.

locatorHash

locatorHash: LocatorHash

Unique hash of a package locator. Used as key in various places so that two locators can be quickly compared.

name

name: string

Name of the package (eg. node).

reference

reference: string

A package reference uniquely identifies a package (eg. 1.2.3).

scope

scope: null | string

Scope of the package, without the @ prefix (eg. types).