vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Type Aliases
  • BrotliAlternate
  • Bugs
  • ConditionalValue
  • ConditionalValueObject
  • DependencySaveType
  • DependencyTypeLong
  • DependencyTypeShort
  • Dist
  • EdgeLike
  • Exports
  • ExportsSubpaths
  • Funding
  • FundingEntry
  • GraphLike
  • Imports
  • Integrity
  • JSONField
  • KeyID
  • Keywords
  • Manifest
  • ManifestRegistry
  • NodeLike
  • NormalizedBin
  • NormalizedBugs
  • NormalizedBugsEntry
  • NormalizedContributorEntry
  • NormalizedContributors
  • NormalizedCpu
  • NormalizedEngines
  • NormalizedFields
  • NormalizedFunding
  • NormalizedFundingEntry
  • NormalizedKeywords
  • NormalizedLibc
  • NormalizedManifest
  • NormalizedManifestRegistry
  • NormalizedOs
  • Override<T, R>
  • Packument
  • PeerDependenciesMetaValue
  • Person
  • RefType
  • Repository
  • RevDoc
  • RevDocEntry
  • SomeNormalizedManifest<T>
  • TarballFormat
  • Variables
  • BROTLI_TARBALL_EXT
  • dependencyTypes
  • integrityRE
  • keyIDRE
  • longDependencyTypes
  • shortDependencyTypes
  • Functions
  • asError()
  • asIntegrity()
  • asKeyID()
  • asManifest()
  • asManifestRegistry()
  • asNormalizedManifest()
  • asNormalizedManifestRegistry()
  • asPackument()
  • assertIntegrity()
  • assertKeyID()
  • assertManifest()
  • assertManifestRegistry()
  • assertPackument()
  • assertRecordStringString()
  • assertRecordStringT()
  • brotliTarballName()
  • brotliTarballUrl()
  • expandNormalizedManifestSymbols()
  • fixManifestVersion()
  • integrityHex()
  • isBoolean()
  • isError()
  • isErrorWithCause()
  • isIntegrity()
  • isKeyID()
  • isManifest()
  • isManifestRegistry()
  • isNormalizedBugs()
  • isNormalizedBugsEntry()
  • isNormalizedContributorEntry()
  • isNormalizedContributors()
  • isNormalizedCpu()
  • isNormalizedEngines()
  • isNormalizedFunding()
  • isNormalizedFundingEntry()
  • isNormalizedKeywords()
  • isNormalizedLibc()
  • isNormalizedManifest()
  • isNormalizedManifestRegistry()
  • isNormalizedOs()
  • isObject()
  • isPackument()
  • isPeerDependenciesMetaValue()
  • isRecordStringManifest()
  • isRecordStringString()
  • isRecordStringT()
  • maybeBoolean()
  • maybeDist()
  • maybePeerDependenciesMetaSet()
  • maybeRecordStringString()
  • maybeString()
  • normalizeBinPaths()
  • normalizeBugs()
  • normalizeContributors()
  • normalizeCpu()
  • normalizeEngines()
  • normalizeFunding()
  • normalizeKeywords()
  • normalizeLibc()
  • normalizeManifest()
  • normalizeOs()
  • parsePerson()
  • parseScope()
  • tarballFormat()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/types
  6. /
  7. Reference

Reference

Type Aliases

BrotliAlternate

TypeScript
type BrotliAlternate = object;

Defined in: index.ts:1130

The absolute URL of a version's Brotli (.tar.br) tarball, from the tar.br entry in its dist.alternates -- but only when that entry resolves to the .tgz's own sibling, i.e. brotliTarballName of tarball. Anything else reads as no alternate at all.

alternates[].tarball is a reference relative to dist.tarball, and the protocol lets a registry point it anywhere. This client uses only the conventional name, because two things downstream re-derive it and both would otherwise be wrong: the format is read back off the URL suffix (brotli bytes carry no signature to sniff), and a lockfile node spends a single flag bit instead of a second URL, rebuilding the address from the .tgz by this same convention. Narrowing here, at the one point where the alternate is chosen, is what makes both of those derivations sound -- and costs an unusual reference the optimization rather than the install.

Type declaration

NameTypeDescription
integrity?IntegrityThe alternate's own hash, if the registry sent one.
tarballstringThe absolute URL of the .tar.br.

Bugs

TypeScript
type Bugs = 
  | string
  | {
  email: string;
  url: string;
};

Defined in: index.ts:433


ConditionalValue

TypeScript
type ConditionalValue = 
  | ConditionalValue[]
  | ConditionalValueObject
  | string
  | null;

Defined in: index.ts:86


ConditionalValueObject

TypeScript
type ConditionalValueObject = object;

Defined in: index.ts:82

Index Signature

TypeScript
[k: string]: ConditionalValue

DependencySaveType

TypeScript
type DependencySaveType = DependencyTypeShort | "implicit";

Defined in: index.ts:1639

Unique keys that indicate how a new or updated dependency should be saved back to a manifest.

'implicit' is used to indicate that a dependency should be saved as whatever type it already exists as. If the dependency does not exist, then 'implicit' is equivalent to 'prod', as that is the default save type.


DependencyTypeLong

TypeScript
type DependencyTypeLong = 
  | "dependencies"
  | "devDependencies"
  | "optionalDependencies"
  | "peerDependencies";

Defined in: index.ts:1618

Name of the package.json keys used to define different types of dependencies.


DependencyTypeShort

TypeScript
type DependencyTypeShort = "dev" | "optional" | "peer" | "peerOptional" | "prod";

Defined in: index.ts:1627

Unique keys that define different types of dependencies relationship.


Dist

TypeScript
type Dist = object;

Defined in: index.ts:40

The Manifest['dist'] field present in registry manifests

Type declaration

NameTypeDescription
alternates?object[]Alternate tarball formats the registry offers for this version. A tar.br entry is a Brotli-recompressed tar whose tarball is a reference relative to this dist's tarball (e.g. the bare filename foo-1.2.3.tar.br), resolved with new URL(entry.tarball, tarball). An alternate is a different artifact, not a re-encoding of the same bytes. It hashes differently from the .tgz, so dist.integrity does not describe it. The integrity field here is the alternate's own hash. It is optional, because a hash does not compress and a registry may prefer to keep packuments small. If a registry does send it, the client pins it like any other integrity, and can look the package up in the global store without downloading anything first. If it does not, the client verifies the download against the tarball response's RFC 9530 Repr-Digest header and learns the hash from there.
fileCount?number-
integrity?Integrity-
shasum?string-
signatures?object[]-
tarball?string-
unpackedSize?number-

EdgeLike

TypeScript
type EdgeLike = object;

Defined in: index.ts:1678

Type declaration

NameType
fromNodeLike
namestring
optional?boolean
peer?boolean
specSpecLikeBase
to?NodeLike
typeDependencyTypeShort

Exports

TypeScript
type Exports = 
  | Exclude<ConditionalValue, null>
  | ExportsSubpaths;

Defined in: index.ts:93


ExportsSubpaths

TypeScript
type ExportsSubpaths = { [path in "." | `./${string}`]?: ConditionalValue };

Defined in: index.ts:89


Funding

TypeScript
type Funding = 
  | FundingEntry
  | FundingEntry[];

Defined in: index.ts:100


FundingEntry

TypeScript
type FundingEntry = 
  | string
  | {
[key: string]: JSONField;   type: string;
  url: string;
};

Defined in: index.ts:98


GraphLike

TypeScript
type GraphLike = object;

Defined in: index.ts:1688

Type declaration

NameType
addEdge(type, spec, from, to?) => EdgeLike
addNode(id?, manifest?, spec?, name?, version?) => NodeLike
edgesSet<EdgeLike>
importersSet<NodeLike>
mainImporterNodeLike
nodesMap<DepID, NodeLike>
nodesByNameMap<string, Set<NodeLike>>
projectRootstring
removeNode()void

Imports

TypeScript
type Imports = Record<`#${string}`, ConditionalValue>;

Defined in: index.ts:96


Integrity

TypeScript
type Integrity = `sha512-${string}`;

Defined in: index.ts:34

sha512 SRI string


JSONField

TypeScript
type JSONField = 
  | JSONField[]
  | boolean
  | number
  | string
  | {}
  | null
  | undefined;

Defined in: index.ts:24

anything that can be encoded in JSON


KeyID

TypeScript
type KeyID = `SHA256:${string}`;

Defined in: index.ts:37

SHA256 key identifier


Keywords

TypeScript
type Keywords = string[] | string;

Defined in: index.ts:440


Manifest

TypeScript
type Manifest = object;

Defined in: index.ts:854

Type declaration

NameTypeDescription
acceptDependencies?Record<string, string>dependency ranges that are acceptable, but not forced
author?Personthe author of a package
bin?Record<string, string> | stringexecutable built and linked by this package
bugs?Bugswhere to go to file issues
bundleDependencies?string[]names of dependencies included in the package tarball
contributors?Person[]contributors to the package
cpu?string[] | stringsupported CPU architectures this package can run on
dependencies?Record<string, string>production dependencies, name:specifier
deprecated?stringa message indicating that this is not to be used
description?stringa short description of the package
devDependencies?Record<string, string>development dependencies, name:specifier
dist?DistOnly present in Manifests served by a registry. Contains information about the artifact served for this package release.
engines?Record<string, string>supported run-time platforms this package can run on
exports?Exportsnamed subpath exports
funding?FundingURLs that can be visited to fund this project
gitHead?stringthe HEAD of the git repo this was published from only present in published packages
gypfile?booleannpm puts this on published manifests
hasInstallScript?booleanSet in place of scripts by abbreviated registry manifests (npm's application/vnd.npm.install-v1+json and vlt's application/vnd.vlt.packument-v1+json and application/vnd.vlt.packument-v2+json) when the package has an install, preinstall, or postinstall script.
homepage?stringThe homepage of the repository
imports?Importsnamed #identifier imports
keywords?Keywordssearch keywords
libc?string[] | stringsupported libc implementations this package can run on (e.g. glibc, musl)
license?stringthe license of the package
main?stringthe main module, if exports['.'] is not set
name?stringThe name of the package. optional because {} is a valid package.json
optionalDependencies?Record<string, string>optional dependencies, name:specifier
os?string[] | stringsupported operating systems this package can run on
peerDependencies?Record<string, string>peer dependencies, name:specifier
peerDependenciesMeta?Record<string, PeerDependenciesMetaValue>peer dependencies marked as optional
private?booleanwhether the package is private
repository?Repositorywhere the development happens
scripts?Record<string, string>run-script actions for this package
type?"commonjs" | "module"whether this is ESM or CommonJS by default
version?stringThe version of the package. optional because {} is a valid package.json
workspaces?| string[] | { nohoist: string[]; packages: string[] | string; } | stringnpm/yarn-style workspace globs. Honored by vlt as a fallback when vlt.json has no workspaces field of its own. Only the npm (string[]) and yarn-classic ({packages}) forms are accepted; vlt's named workspace groups are a vlt.json feature. yarn's nohoist is parsed and ignored.

ManifestRegistry

TypeScript
type ManifestRegistry = Manifest & Required<Pick<Manifest, "name" | "version" | "dist">> & object;

Defined in: index.ts:979

A specific type of Manifest that represents manifests that were retrieved from a registry, these will always have name, version and dist information along with an optional maintainers field.

Type declaration

NameType
maintainers?unknown

NodeLike

TypeScript
type NodeLike = object;

Defined in: index.ts:1715

Type declaration

NameTypeDescription
bins?Record<string, string>-
brotli?booleanThis node's artifact is the registry's Brotli (.tar.br) tarball rather than the gzip .tgz, so resolved and integrity both describe that artifact. Persisted in the lockfile as a flag bit, which is what lets setResolved() rebuild the .tar.br URL for a node whose resolved is not written out.
buildAllowed?boolean-
buildBlocked?boolean-
buildState?"none" | "needed" | "built" | "failed"-
confusedboolean-
devboolean-
edgesInSet<EdgeLike>-
edgesOutMap<string, EdgeLike>-
graphGraphLike-
idDepID-
importerboolean-
integrity?string | null-
location?string-
mainImporterboolean-
manifest?NormalizedManifest | null-
modifier?string-
name?string | null-
optionalboolean-
optionsSpecOptions-
peerSetHash?string-
platform?object-
platform.cpu?string[] | string-
platform.engines?Record<string, string>-
platform.libc?string[] | string-
platform.os?string[] | string-
projectRootstring-
rawManifest?NormalizedManifest | null-
registry?string-
resolved?string | null-
resolvedFromLockfile?boolean-
toJSON() => Pick<NodeLike, | "id" | "name" | "version" | "location" | "importer" | "manifest" | "projectRoot" | "integrity" | "resolved" | "dev" | "optional" | "confused" | "platform" | "buildState" | "buildAllowed" | "buildBlocked"> & object-
version?string | null-
workspacesMap<string, EdgeLike> | undefined-
maybeSetConfusedManifest()void-
setConfusedManifest()void-
setResolved()void-
toString()string-

NormalizedBin

TypeScript
type NormalizedBin = Record<string, string>;

Defined in: index.ts:484

Normalized bin - always a record of string to string


NormalizedBugs

TypeScript
type NormalizedBugs = NormalizedBugsEntry[];

Defined in: index.ts:479

Normalized bugs - always an array of NormalizedBugsEntry


NormalizedBugsEntry

TypeScript
type NormalizedBugsEntry = object;

Defined in: index.ts:445

Normalized bugs entry - always an object with type and url/email

Type declaration

NameType
email?string
type?"email" | "link"
url?string

NormalizedContributorEntry

TypeScript
type NormalizedContributorEntry = object;

Defined in: index.ts:312

Represents a normalized contributor object. This is the type that is used in the NormalizedManifest and NormalizedManifestRegistry objects.

Type declaration

NameType
[kIsPublisher]?boolean
[kWriteAccess]?boolean
email?string
isPublisher?boolean
name?string
url?string
writeAccess?boolean

NormalizedContributors

TypeScript
type NormalizedContributors = NormalizedContributorEntry[];

Defined in: index.ts:305

Normalized contributors - always an array of NormalizedContributorEntry.


NormalizedCpu

TypeScript
type NormalizedCpu = string[];

Defined in: index.ts:469

Normalized CPU list - always an array of strings


NormalizedEngines

TypeScript
type NormalizedEngines = Record<string, string>;

Defined in: index.ts:459

Normalized engines - always a record of string to string


NormalizedFields

TypeScript
type NormalizedFields = object;

Defined in: index.ts:948

Type declaration

NameType
author| NormalizedContributorEntry | undefined
binNormalizedBin | undefined
bugsNormalizedBugs | undefined
contributors| NormalizedContributors | undefined
cpuNormalizedCpu | undefined
enginesNormalizedEngines | undefined
fundingNormalizedFunding | undefined
keywordsNormalizedKeywords | undefined
libcNormalizedLibc | undefined
osNormalizedOs | undefined

NormalizedFunding

TypeScript
type NormalizedFunding = NormalizedFundingEntry[];

Defined in: index.ts:114

Normalized funding information, an array of NormalizedFundingEntry.


NormalizedFundingEntry

TypeScript
type NormalizedFundingEntry = object;

Defined in: index.ts:105

An object with url and optional additional properties

Type declaration

Index Signature

TypeScript
[key: string]: JSONField
NameType
type?string
urlstring

NormalizedKeywords

TypeScript
type NormalizedKeywords = string[];

Defined in: index.ts:454

Normalized keywords - always an array of strings


NormalizedLibc

TypeScript
type NormalizedLibc = string[];

Defined in: index.ts:474

Normalized libc list - always an array of strings


NormalizedManifest

TypeScript
type NormalizedManifest = Override<Manifest, NormalizedFields>;

Defined in: index.ts:964

A Manifest object that contains normalized fields.


NormalizedManifestRegistry

TypeScript
type NormalizedManifestRegistry = Override<ManifestRegistry, NormalizedFields>;

Defined in: index.ts:969

A ManifestRegistry object that contains normalized fields.


NormalizedOs

TypeScript
type NormalizedOs = string[];

Defined in: index.ts:464

Normalized OS list - always an array of strings


Override<T, R>

TypeScript
type Override<T, R> = { [K in keyof T]: K extends keyof R ? R[K] : T[K] };

Defined in: index.ts:16

Utility type that overrides specific properties of type T with new types from R. Constrains override values to exclude undefined, ensuring that normalization cannot introduce undefined to fields that shouldn't have it.

Type Parameters

Type Parameter
T
R extends { [K in keyof R]: R[K] extends undefined ? never : R[K] }

Packument

TypeScript
type Packument = object;

Defined in: index.ts:998

A document that represents available package versions in a given registry along with extra information, such as dist-tags and maintainers info. The versions field is key-value structure in which keys are the available versions of a given package and values are ManifestRegistry objects.

Type declaration

NameType
contributors?Person[]
dist-tagsRecord<string, string>
maintainers?Person[]
modified?string
namestring
readme?string
time?Record<string, string>
versionsRecord<string, Manifest>

PeerDependenciesMetaValue

TypeScript
type PeerDependenciesMetaValue = object;

Defined in: index.ts:76

An object used to mark some peerDeps as optional

Type declaration

NameType
optional?boolean

Person

TypeScript
type Person = 
  | string
  | {
  email: string;
  name: string;
  url: string;
};

Defined in: index.ts:418


RefType

TypeScript
type RefType = "branch" | "head" | "other" | "pull" | "tag";

Defined in: index.ts:1009


Repository

TypeScript
type Repository = 
  | string
  | {
  type: string;
  url: string;
};

Defined in: index.ts:426


RevDoc

TypeScript
type RevDoc = Omit<Packument, "versions"> & object;

Defined in: index.ts:1029

An object kind of resembling a packument, but about a git repo.

Type declaration

NameTypeDescription
refsRecord<string, RevDocEntry>all named things that can be cloned down remotely
shasRecord<string, string[]>all named shas referenced above
versionsRecord<string, RevDocEntry>all semver-looking tags go in this record

RevDocEntry

TypeScript
type RevDocEntry = Omit<Manifest, "type"> & Required<Pick<Manifest, "version">> & object;

Defined in: index.ts:1014

A representation of a given remote ref in a RevDoc object.

Type declaration

NameTypeDescription
rawRefstringcanonical full ref, like refs/tags/blahblah
refstringref as passed git locally
shastringsha this references
typeRefTypewhat type of ref this is: 'branch', 'tag', etc.

SomeNormalizedManifest<T>

TypeScript
type SomeNormalizedManifest<T> = T extends ManifestRegistry ? NormalizedManifestRegistry : NormalizedManifest;

Defined in: index.ts:987

Maps the manifest type to the equivalent normalized manifest type.

Type Parameters

Type Parameter
T

TarballFormat

TypeScript
type TarballFormat = "gzip" | "brotli";

Defined in: index.ts:1083

How a tarball's bytes are compressed. gzip is sniffed from the two magic bytes (the .tgz and raw-tar cases), so it never has to be passed. Brotli has no magic-byte signature, so a .tar.br MUST be declared by the caller -- it can never be detected from the bytes.

Variables

BROTLI_TARBALL_EXT

TypeScript
const BROTLI_TARBALL_EXT: ".tar.br" = '.tar.br';

Defined in: index.ts:1086

Filename extension of a Brotli-recompressed tarball.


dependencyTypes

TypeScript
const dependencyTypes: Map<DependencyTypeLong, DependencyTypeShort>;

Defined in: index.ts:1667

Maps between long form names usually used in package.json files to a corresponding short form name, used in lockfiles.


integrityRE

TypeScript
const integrityRE: RegExp;

Defined in: index.ts:1044


keyIDRE

TypeScript
const keyIDRE: RegExp;

Defined in: index.ts:1166


longDependencyTypes

TypeScript
const longDependencyTypes: Set<DependencyTypeLong>;

Defined in: index.ts:1645

A set of the possible long dependency type names, as used in package.json files.


shortDependencyTypes

TypeScript
const shortDependencyTypes: Set<DependencyTypeShort>;

Defined in: index.ts:1655

A set of the short type keys used to represent dependency relationships.

Functions

asError()

TypeScript
function asError(er, fallbackMessage): Error

Defined in: index.ts:1191

Convert an unknown value to an error.

Parameters

ParameterTypeDefault value
erunknownundefined
fallbackMessagestring'Unknown error'

Returns

Error


asIntegrity()

TypeScript
function asIntegrity(i): `sha512-${string}`

Defined in: index.ts:1048

Parameters

ParameterType
iunknown

Returns

`sha512-${string}`


asKeyID()

TypeScript
function asKeyID(k): `SHA256:${string}`

Defined in: index.ts:1170

Parameters

ParameterType
kunknown

Returns

`SHA256:${string}`


asManifest()

TypeScript
function asManifest(m, from?): Manifest

Defined in: index.ts:1322

Given an unknown value, convert it to a Manifest.

Parameters

ParameterType
munknown
from?(...a) => any

Returns

Manifest


asManifestRegistry()

TypeScript
function asManifestRegistry(m, from?): ManifestRegistry

Defined in: index.ts:1497

Given an unknown value, convert it to a ManifestRegistry.

Parameters

ParameterType
munknown
from?(...a) => any

Returns

ManifestRegistry


asNormalizedManifest()

TypeScript
function asNormalizedManifest(m, from?): Override

Defined in: index.ts:1480

Given an unknown value, convert it to a NormalizedManifest.

Parameters

ParameterType
munknown
from?(...a) => any

Returns

Override


asNormalizedManifestRegistry()

TypeScript
function asNormalizedManifestRegistry(m, from?): Override

Defined in: index.ts:1523

Given an unknown value, convert it to a NormalizedManifestRegistry.

Parameters

ParameterType
munknown
from?(...a) => any

Returns

Override


asPackument()

TypeScript
function asPackument(p, from?): Packument

Defined in: index.ts:1595

Parameters

ParameterType
punknown
from?(...a) => any

Returns

Packument


assertIntegrity()

TypeScript
function assertIntegrity(i): asserts i is `sha512-${string}`

Defined in: index.ts:1062

Parameters

ParameterType
iunknown

Returns

asserts i is `sha512-${string}`


assertKeyID()

TypeScript
function assertKeyID(k): asserts k is `SHA256:${string}`

Defined in: index.ts:1184

Parameters

ParameterType
kunknown

Returns

asserts k is `SHA256:${string}`


assertManifest()

TypeScript
function assertManifest(m): asserts m is Manifest

Defined in: index.ts:1573

Parameters

ParameterType
munknown

Returns

asserts m is Manifest


assertManifestRegistry()

TypeScript
function assertManifestRegistry(m): asserts m is ManifestRegistry

Defined in: index.ts:1578

Parameters

ParameterType
munknown

Returns

asserts m is ManifestRegistry


assertPackument()

TypeScript
function assertPackument(m): asserts m is Packument

Defined in: index.ts:1609

Parameters

ParameterType
munknown

Returns

asserts m is Packument


assertRecordStringString()

TypeScript
function assertRecordStringString(o): void

Defined in: index.ts:1229

Parameters

ParameterType
ounknown

Returns

void


assertRecordStringT()

TypeScript
function assertRecordStringT<T>(
   o, 
   check, 
   wanted): asserts o is Record<string, T>

Defined in: index.ts:1247

Type Parameters

Type Parameter
T

Parameters

ParameterType
ounknown
check(o) => o is T
wantedstring

Returns

asserts o is Record<string, T>


brotliTarballName()

TypeScript
function brotliTarballName(tgz): string

Defined in: index.ts:1110

https://…/foo-1.2.3.tgz -> https://…/foo-1.2.3.tar.br: the name a registry gives a version's Brotli alternate, same stem as the .tgz and a different extension.

Parameters

ParameterType
tgzstring

Returns

string


brotliTarballUrl()

TypeScript
function brotliTarballUrl(tarball, alternates): undefined | BrotliAlternate

Defined in: index.ts:1137

Parameters

ParameterType
tarballundefined | string
alternatesundefined | object[]

Returns

undefined | BrotliAlternate


expandNormalizedManifestSymbols()

TypeScript
function expandNormalizedManifestSymbols(m): Override

Defined in: index.ts:1555

Walks a normalized manifest and expands any symbols found in the author and contributors fields.

Parameters

ParameterType
mOverride

Returns

Override


fixManifestVersion()

TypeScript
function fixManifestVersion<T>(manifest): T

Defined in: index.ts:228

Given a version Normalize the version field in a manifest.

Type Parameters

Type Parameter
T extends | Manifest | ManifestRegistry

Parameters

ParameterType
manifestT

Returns

T


integrityHex()

TypeScript
function integrityHex(i): undefined | string

Defined in: index.ts:1072

Hex form of a sha512 integrity digest, or undefined if not a valid sha512 integrity. Names tarball cache and global store entries.

Parameters

ParameterType
iunknown

Returns

undefined | string


isBoolean()

TypeScript
function isBoolean(value): value is boolean

Defined in: index.ts:1041

A type guard to check if a value is a boolean.

Parameters

ParameterType
valueunknown

Returns

value is boolean


isError()

TypeScript
function isError(er): er is Error

Defined in: index.ts:1200

Check if a value is an error.

Parameters

ParameterType
erunknown

Returns

er is Error


isErrorWithCause()

TypeScript
function isErrorWithCause(er): er is Error & { cause: unknown }

Defined in: index.ts:1206

Check if an error has a cause property.

Parameters

ParameterType
erunknown

Returns

er is Error & { cause: unknown }


isIntegrity()

TypeScript
function isIntegrity(i): i is `sha512-${string}`

Defined in: index.ts:1045

Parameters

ParameterType
iunknown

Returns

i is `sha512-${string}`


isKeyID()

TypeScript
function isKeyID(k): k is `SHA256:${string}`

Defined in: index.ts:1167

Parameters

ParameterType
kunknown

Returns

k is `SHA256:${string}`


isManifest()

TypeScript
function isManifest(m): m is Manifest

Defined in: index.ts:1296

Is a given unknown value a valid Manifest object? Returns true if so.

Parameters

ParameterType
munknown

Returns

m is Manifest


isManifestRegistry()

TypeScript
function isManifestRegistry(m): m is ManifestRegistry

Defined in: index.ts:1314

A specific Manifest that is retrieved uniquely from reading registry packument and manifest endpoints, it has dist, name and version fields defined.

Parameters

ParameterType
munknown

Returns

m is ManifestRegistry


isNormalizedBugs()

TypeScript
function isNormalizedBugs(o): o is NormalizedBugs

Defined in: index.ts:569

Type guard to check if a value is a NormalizedBugs.

Parameters

ParameterType
ounknown

Returns

o is NormalizedBugs


isNormalizedBugsEntry()

TypeScript
function isNormalizedBugsEntry(o): o is NormalizedBugsEntry

Defined in: index.ts:553

Type guard to check if a value is a NormalizedBugsEntry.

Parameters

ParameterType
ounknown

Returns

o is NormalizedBugsEntry


isNormalizedContributorEntry()

TypeScript
function isNormalizedContributorEntry(o): o is NormalizedContributorEntry

Defined in: index.ts:329

Type guard to check if a value is a normalized contributor entry.

Parameters

ParameterType
ounknown

Returns

o is NormalizedContributorEntry


isNormalizedContributors()

TypeScript
function isNormalizedContributors(o): o is NormalizedContributors

Defined in: index.ts:353

Type guard to check if a value is a NormalizedContributors.

Parameters

ParameterType
ounknown

Returns

o is NormalizedContributors


isNormalizedCpu()

TypeScript
function isNormalizedCpu(o): o is NormalizedCpu

Defined in: index.ts:769

Type guard to check if a value is a NormalizedCpu.

Parameters

ParameterType
ounknown

Returns

o is NormalizedCpu


isNormalizedEngines()

TypeScript
function isNormalizedEngines(o): o is NormalizedEngines

Defined in: index.ts:743

Type guard to check if a value is a NormalizedEngines.

Parameters

ParameterType
ounknown

Returns

o is NormalizedEngines


isNormalizedFunding()

TypeScript
function isNormalizedFunding(o): o is NormalizedFunding

Defined in: index.ts:215

Type guard to check if a value is a NormalizedFunding.

Parameters

ParameterType
ounknown

Returns

o is NormalizedFunding


isNormalizedFundingEntry()

TypeScript
function isNormalizedFundingEntry(o): o is NormalizedFundingEntry

Defined in: index.ts:196

Type guard to check if a value is a NormalizedFundingEntry.

Parameters

ParameterType
ounknown

Returns

o is NormalizedFundingEntry


isNormalizedKeywords()

TypeScript
function isNormalizedKeywords(o): o is NormalizedKeywords

Defined in: index.ts:614

Type guard to check if a value is a NormalizedKeywords.

Parameters

ParameterType
ounknown

Returns

o is NormalizedKeywords


isNormalizedLibc()

TypeScript
function isNormalizedLibc(o): o is NormalizedLibc

Defined in: index.ts:786

Type guard to check if a value is a NormalizedLibc.

Parameters

ParameterType
ounknown

Returns

o is NormalizedLibc


isNormalizedManifest()

TypeScript
function isNormalizedManifest(o): o is Override<Manifest, NormalizedFields>

Defined in: index.ts:1456

Type guard to check if a value is a NormalizedManifest.

Parameters

ParameterType
ounknown

Returns

o is Override<Manifest, NormalizedFields>


isNormalizedManifestRegistry()

TypeScript
function isNormalizedManifestRegistry(o): o is Override<ManifestRegistry, NormalizedFields>

Defined in: index.ts:1514

Type guard to check if a value is a NormalizedManifestRegistry.

Parameters

ParameterType
ounknown

Returns

o is Override<ManifestRegistry, NormalizedFields>


isNormalizedOs()

TypeScript
function isNormalizedOs(o): o is NormalizedOs

Defined in: index.ts:752

Type guard to check if a value is a NormalizedOs.

Parameters

ParameterType
ounknown

Returns

o is NormalizedOs


isObject()

TypeScript
function isObject(v): v is Record<string, unknown>

Defined in: index.ts:1213

Check if an unknown value is a plain object.

Parameters

ParameterType
vunknown

Returns

v is Record<string, unknown>


isPackument()

TypeScript
function isPackument(p): p is Packument

Defined in: index.ts:1584

Parameters

ParameterType
punknown

Returns

p is Packument


isPeerDependenciesMetaValue()

TypeScript
function isPeerDependenciesMetaValue(o): o is PeerDependenciesMetaValue

Defined in: index.ts:1281

Parameters

ParameterType
ounknown

Returns

o is PeerDependenciesMetaValue


isRecordStringManifest()

TypeScript
function isRecordStringManifest(o): o is Record<string, Manifest>

Defined in: index.ts:1265

Parameters

ParameterType
ounknown

Returns

o is Record<string, Manifest>


isRecordStringString()

TypeScript
function isRecordStringString(o): o is Record<string, string>

Defined in: index.ts:1224

Parameters

ParameterType
ounknown

Returns

o is Record<string, string>


isRecordStringT()

TypeScript
function isRecordStringT<T>(o, check): o is Record<string, T>

Defined in: index.ts:1238

Type Parameters

Type Parameter
T

Parameters

ParameterType
ounknown
check(o) => o is T

Returns

o is Record<string, T>


maybeBoolean()

TypeScript
function maybeBoolean(o): o is boolean

Defined in: index.ts:1278

Parameters

ParameterType
ounknown

Returns

o is boolean


maybeDist()

TypeScript
function maybeDist(a): a is undefined | Dist

Defined in: index.ts:1289

Parameters

ParameterType
aunknown

Returns

a is undefined | Dist


maybePeerDependenciesMetaSet()

TypeScript
function maybePeerDependenciesMetaSet(o): o is undefined | Record<string, PeerDependenciesMetaValue>

Defined in: index.ts:1270

Parameters

ParameterType
ounknown

Returns

o is undefined | Record<string, PeerDependenciesMetaValue>


maybeRecordStringString()

TypeScript
function maybeRecordStringString(o): o is undefined | Record<string, string>

Defined in: index.ts:1219

Parameters

ParameterType
ounknown

Returns

o is undefined | Record<string, string>


maybeString()

TypeScript
function maybeString(a): a is undefined | string

Defined in: index.ts:1286

Parameters

ParameterType
aunknown

Returns

a is undefined | string


normalizeBinPaths()

TypeScript
function normalizeBinPaths(manifest): undefined | Record<string, string>

Defined in: index.ts:839

Normalizes the bin paths.

Parameters

ParameterType
manifestPick<Manifest, "name" | "bin">

Returns

undefined | Record<string, string>


normalizeBugs()

TypeScript
function normalizeBugs(bugs): undefined | NormalizedBugs

Defined in: index.ts:530

Normalize bugs information to a NormalizedBugs consistent format.

Parameters

ParameterType
bugsunknown

Returns

undefined | NormalizedBugs


normalizeContributors()

TypeScript
function normalizeContributors(contributors, maintainers?): 
  | undefined
  | NormalizedContributorEntry[]

Defined in: index.ts:366

Normalize contributors and maintainers from various formats

Parameters

ParameterType
contributorsunknown
maintainers?unknown

Returns

| undefined | NormalizedContributorEntry[]


normalizeCpu()

TypeScript
function normalizeCpu(cpu): undefined | NormalizedCpu

Defined in: index.ts:681

Normalize CPU information to a NormalizedCpu consistent format.

Parameters

ParameterType
cpuunknown

Returns

undefined | NormalizedCpu


normalizeEngines()

TypeScript
function normalizeEngines(engines): undefined | NormalizedEngines

Defined in: index.ts:633

Normalize engines information to a NormalizedEngines consistent format.

Parameters

ParameterType
enginesunknown

Returns

undefined | NormalizedEngines


normalizeFunding()

TypeScript
function normalizeFunding(funding): undefined | NormalizedFunding

Defined in: index.ts:183

Normalize funding information to a consistent format.

Parameters

ParameterType
fundingunknown

Returns

undefined | NormalizedFunding


normalizeKeywords()

TypeScript
function normalizeKeywords(keywords): undefined | NormalizedKeywords

Defined in: index.ts:578

Normalize keywords information to a NormalizedKeywords consistent format.

Parameters

ParameterType
keywordsunknown

Returns

undefined | NormalizedKeywords


normalizeLibc()

TypeScript
function normalizeLibc(libc): undefined | NormalizedLibc

Defined in: index.ts:712

Normalize libc information to a NormalizedLibc consistent format.

Parameters

ParameterType
libcunknown

Returns

undefined | NormalizedLibc


normalizeManifest()

TypeScript
function normalizeManifest<T>(manifest, from?): SomeNormalizedManifest<T>

Defined in: index.ts:1342

Given a Manifest returns a NormalizedManifest that contains normalized author, bugs, funding, contributors, keywords and version fields.

Type Parameters

Type Parameter
T extends | Manifest | ManifestRegistry

Parameters

ParameterType
manifestT
from?string

Returns

SomeNormalizedManifest<T>


normalizeOs()

TypeScript
function normalizeOs(os): undefined | NormalizedOs

Defined in: index.ts:650

Normalize OS information to a NormalizedOs consistent format.

Parameters

ParameterType
osunknown

Returns

undefined | NormalizedOs


parsePerson()

TypeScript
function parsePerson(
   person, 
   writeAccess?, 
   isPublisher?): 
  | undefined
  | NormalizedContributorEntry

Defined in: index.ts:252

Parse a string or object into a normalized contributor.

Parameters

ParameterType
personunknown
writeAccess?boolean
isPublisher?boolean

Returns

| undefined | NormalizedContributorEntry


parseScope()

TypeScript
function parseScope(scoped): [undefined | string, string]

Defined in: index.ts:1793

Parse a scoped package name into its scope and name components.

Parameters

ParameterType
scopedstring

Returns

[undefined | string, string]


tarballFormat()

TypeScript
function tarballFormat(url): undefined | TarballFormat

Defined in: index.ts:1097

The TarballFormat a tarball URL (or a registry-client cache key, which is the URL) names, or undefined when the bytes can be sniffed.

The extension is the only signal there is: brotli bytes are opaque, and the response carries no Content-Encoding (a .tar.br is an artifact in its own right, not a transfer encoding of the .tgz). Query and fragment are ignored so a signed or cache-busted URL still reads correctly.

Parameters

ParameterType
urlstring

Returns

undefined | TarballFormat


Previous@vltpkg/typesNext@vltpkg/url-open

On this page

  • Type Aliases
  • BrotliAlternate
  • Bugs
  • ConditionalValue
  • ConditionalValueObject
  • DependencySaveType
  • DependencyTypeLong
  • DependencyTypeShort
  • Dist
  • EdgeLike
  • Exports
  • ExportsSubpaths
  • Funding
  • FundingEntry
  • GraphLike
  • Imports
  • Integrity
  • JSONField
  • KeyID
  • Keywords
  • Manifest
  • ManifestRegistry
  • NodeLike
  • NormalizedBin
  • NormalizedBugs
  • NormalizedBugsEntry
  • NormalizedContributorEntry
  • NormalizedContributors
  • NormalizedCpu
  • NormalizedEngines
  • NormalizedFields
  • NormalizedFunding
  • NormalizedFundingEntry
  • NormalizedKeywords
  • NormalizedLibc
  • NormalizedManifest
  • NormalizedManifestRegistry
  • NormalizedOs
  • Override<T, R>
  • Packument
  • PeerDependenciesMetaValue
  • Person
  • RefType
  • Repository
  • RevDoc
  • RevDocEntry
  • SomeNormalizedManifest<T>
  • TarballFormat
  • Variables
  • BROTLI_TARBALL_EXT
  • dependencyTypes
  • integrityRE
  • keyIDRE
  • longDependencyTypes
  • shortDependencyTypes
  • Functions
  • asError()
  • asIntegrity()
  • asKeyID()
  • asManifest()
  • asManifestRegistry()
  • asNormalizedManifest()
  • asNormalizedManifestRegistry()
  • asPackument()
  • assertIntegrity()
  • assertKeyID()
  • assertManifest()
  • assertManifestRegistry()
  • assertPackument()
  • assertRecordStringString()
  • assertRecordStringT()
  • brotliTarballName()
  • brotliTarballUrl()
  • expandNormalizedManifestSymbols()
  • fixManifestVersion()
  • integrityHex()
  • isBoolean()
  • isError()
  • isErrorWithCause()
  • isIntegrity()
  • isKeyID()
  • isManifest()
  • isManifestRegistry()
  • isNormalizedBugs()
  • isNormalizedBugsEntry()
  • isNormalizedContributorEntry()
  • isNormalizedContributors()
  • isNormalizedCpu()
  • isNormalizedEngines()
  • isNormalizedFunding()
  • isNormalizedFundingEntry()
  • isNormalizedKeywords()
  • isNormalizedLibc()
  • isNormalizedManifest()
  • isNormalizedManifestRegistry()
  • isNormalizedOs()
  • isObject()
  • isPackument()
  • isPeerDependenciesMetaValue()
  • isRecordStringManifest()
  • isRecordStringString()
  • isRecordStringT()
  • maybeBoolean()
  • maybeDist()
  • maybePeerDependenciesMetaSet()
  • maybeRecordStringString()
  • maybeString()
  • normalizeBinPaths()
  • normalizeBugs()
  • normalizeContributors()
  • normalizeCpu()
  • normalizeEngines()
  • normalizeFunding()
  • normalizeKeywords()
  • normalizeLibc()
  • normalizeManifest()
  • normalizeOs()
  • parsePerson()
  • parseScope()
  • tarballFormat()

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