vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Type Aliases
  • 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>
  • Variables
  • dependencyTypes
  • integrityRE
  • keyIDRE
  • longDependencyTypes
  • shortDependencyTypes
  • Functions
  • asError()
  • asIntegrity()
  • asKeyID()
  • asManifest()
  • asManifestRegistry()
  • asNormalizedManifest()
  • asNormalizedManifestRegistry()
  • asPackument()
  • assertIntegrity()
  • assertKeyID()
  • assertManifest()
  • assertManifestRegistry()
  • assertPackument()
  • assertRecordStringString()
  • assertRecordStringT()
  • 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()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/types
  6. /
  7. Reference

Reference

Type Aliases

Bugs

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

Defined in: index.ts:410


ConditionalValue

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

Defined in: index.ts:63


ConditionalValueObject

TypeScript
type ConditionalValueObject = object;

Defined in: index.ts:59

Index Signature

TypeScript
[k: string]: ConditionalValue

DependencySaveType

TypeScript
type DependencySaveType = DependencyTypeShort | "implicit";

Defined in: index.ts:1515

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:1494

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:1503

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

NameType
fileCount?number
integrity?Integrity
shasum?string
signatures?object[]
tarball?string
unpackedSize?number

EdgeLike

TypeScript
type EdgeLike = object;

Defined in: index.ts:1554

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:70


ExportsSubpaths

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

Defined in: index.ts:66


Funding

TypeScript
type Funding = 
  | FundingEntry
  | FundingEntry[];

Defined in: index.ts:77


FundingEntry

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

Defined in: index.ts:75


GraphLike

TypeScript
type GraphLike = object;

Defined in: index.ts:1564

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:73


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:417


Manifest

TypeScript
type Manifest = object;

Defined in: index.ts:831

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) 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

ManifestRegistry

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

Defined in: index.ts:944

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:1591

Type declaration

NameType
bins?Record<string, string>
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:461

Normalized bin - always a record of string to string


NormalizedBugs

TypeScript
type NormalizedBugs = NormalizedBugsEntry[];

Defined in: index.ts:456

Normalized bugs - always an array of NormalizedBugsEntry


NormalizedBugsEntry

TypeScript
type NormalizedBugsEntry = object;

Defined in: index.ts:422

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:289

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:282

Normalized contributors - always an array of NormalizedContributorEntry.


NormalizedCpu

TypeScript
type NormalizedCpu = string[];

Defined in: index.ts:446

Normalized CPU list - always an array of strings


NormalizedEngines

TypeScript
type NormalizedEngines = Record<string, string>;

Defined in: index.ts:436

Normalized engines - always a record of string to string


NormalizedFields

TypeScript
type NormalizedFields = object;

Defined in: index.ts:913

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:91

Normalized funding information, an array of NormalizedFundingEntry.


NormalizedFundingEntry

TypeScript
type NormalizedFundingEntry = object;

Defined in: index.ts:82

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:431

Normalized keywords - always an array of strings


NormalizedLibc

TypeScript
type NormalizedLibc = string[];

Defined in: index.ts:451

Normalized libc list - always an array of strings


NormalizedManifest

TypeScript
type NormalizedManifest = Override<Manifest, NormalizedFields>;

Defined in: index.ts:929

A Manifest object that contains normalized fields.


NormalizedManifestRegistry

TypeScript
type NormalizedManifestRegistry = Override<ManifestRegistry, NormalizedFields>;

Defined in: index.ts:934

A ManifestRegistry object that contains normalized fields.


NormalizedOs

TypeScript
type NormalizedOs = string[];

Defined in: index.ts:441

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:963

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:53

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:395


RefType

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

Defined in: index.ts:974


Repository

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

Defined in: index.ts:403


RevDoc

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

Defined in: index.ts:994

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:979

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:952

Maps the manifest type to the equivalent normalized manifest type.

Type Parameters

Type Parameter
T

Variables

dependencyTypes

TypeScript
const dependencyTypes: Map<DependencyTypeLong, DependencyTypeShort>;

Defined in: index.ts:1543

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:1009


keyIDRE

TypeScript
const keyIDRE: RegExp;

Defined in: index.ts:1042


longDependencyTypes

TypeScript
const longDependencyTypes: Set<DependencyTypeLong>;

Defined in: index.ts:1521

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:1531

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

Functions

asError()

TypeScript
function asError(er, fallbackMessage): Error

Defined in: index.ts:1067

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:1013

Parameters

ParameterType
iunknown

Returns

`sha512-${string}`


asKeyID()

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

Defined in: index.ts:1046

Parameters

ParameterType
kunknown

Returns

`SHA256:${string}`


asManifest()

TypeScript
function asManifest(m, from?): Manifest

Defined in: index.ts:1198

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:1373

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:1356

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:1399

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:1471

Parameters

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

Returns

Packument


assertIntegrity()

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

Defined in: index.ts:1027

Parameters

ParameterType
iunknown

Returns

asserts i is `sha512-${string}`


assertKeyID()

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

Defined in: index.ts:1060

Parameters

ParameterType
kunknown

Returns

asserts k is `SHA256:${string}`


assertManifest()

TypeScript
function assertManifest(m): asserts m is Manifest

Defined in: index.ts:1449

Parameters

ParameterType
munknown

Returns

asserts m is Manifest


assertManifestRegistry()

TypeScript
function assertManifestRegistry(m): asserts m is ManifestRegistry

Defined in: index.ts:1454

Parameters

ParameterType
munknown

Returns

asserts m is ManifestRegistry


assertPackument()

TypeScript
function assertPackument(m): asserts m is Packument

Defined in: index.ts:1485

Parameters

ParameterType
munknown

Returns

asserts m is Packument


assertRecordStringString()

TypeScript
function assertRecordStringString(o): void

Defined in: index.ts:1105

Parameters

ParameterType
ounknown

Returns

void


assertRecordStringT()

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

Defined in: index.ts:1123

Type Parameters

Type Parameter
T

Parameters

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

Returns

asserts o is Record<string, T>


expandNormalizedManifestSymbols()

TypeScript
function expandNormalizedManifestSymbols(m): Override

Defined in: index.ts:1431

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:205

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:1037

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:1006

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:1076

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:1082

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:1010

Parameters

ParameterType
iunknown

Returns

i is `sha512-${string}`


isKeyID()

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

Defined in: index.ts:1043

Parameters

ParameterType
kunknown

Returns

k is `SHA256:${string}`


isManifest()

TypeScript
function isManifest(m): m is Manifest

Defined in: index.ts:1172

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:1190

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:546

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:530

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:306

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:330

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:746

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:720

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:192

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:173

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:591

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:763

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:1332

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:1390

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:729

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:1089

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:1460

Parameters

ParameterType
punknown

Returns

p is Packument


isPeerDependenciesMetaValue()

TypeScript
function isPeerDependenciesMetaValue(o): o is PeerDependenciesMetaValue

Defined in: index.ts:1157

Parameters

ParameterType
ounknown

Returns

o is PeerDependenciesMetaValue


isRecordStringManifest()

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

Defined in: index.ts:1141

Parameters

ParameterType
ounknown

Returns

o is Record<string, Manifest>


isRecordStringString()

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

Defined in: index.ts:1100

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:1114

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:1154

Parameters

ParameterType
ounknown

Returns

o is boolean


maybeDist()

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

Defined in: index.ts:1165

Parameters

ParameterType
aunknown

Returns

a is undefined | Dist


maybePeerDependenciesMetaSet()

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

Defined in: index.ts:1146

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:1095

Parameters

ParameterType
ounknown

Returns

o is undefined | Record<string, string>


maybeString()

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

Defined in: index.ts:1162

Parameters

ParameterType
aunknown

Returns

a is undefined | string


normalizeBinPaths()

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

Defined in: index.ts:816

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:507

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:343

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:658

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:610

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:160

Normalize funding information to a consistent format.

Parameters

ParameterType
fundingunknown

Returns

undefined | NormalizedFunding


normalizeKeywords()

TypeScript
function normalizeKeywords(keywords): undefined | NormalizedKeywords

Defined in: index.ts:555

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:689

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:1218

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:627

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:229

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:1661

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

Parameters

ParameterType
scopedstring

Returns

[undefined | string, string]


Previous@vltpkg/typesNext@vltpkg/url-open

On this page

  • Type Aliases
  • 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>
  • Variables
  • dependencyTypes
  • integrityRE
  • keyIDRE
  • longDependencyTypes
  • shortDependencyTypes
  • Functions
  • asError()
  • asIntegrity()
  • asKeyID()
  • asManifest()
  • asManifestRegistry()
  • asNormalizedManifest()
  • asNormalizedManifestRegistry()
  • asPackument()
  • assertIntegrity()
  • assertKeyID()
  • assertManifest()
  • assertManifestRegistry()
  • assertPackument()
  • assertRecordStringString()
  • assertRecordStringT()
  • 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()

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