Reference
Type Aliases
BrotliAlternate
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
| Name | Type | Description |
|---|---|---|
integrity? | Integrity | The alternate's own hash, if the registry sent one. |
tarball | string | The absolute URL of the .tar.br. |
Bugs
type Bugs =
| string
| {
email: string;
url: string;
};Defined in: index.ts:433
ConditionalValue
type ConditionalValue =
| ConditionalValue[]
| ConditionalValueObject
| string
| null;Defined in: index.ts:86
ConditionalValueObject
type ConditionalValueObject = object;Defined in: index.ts:82
Index Signature
[k: string]: ConditionalValueDependencySaveType
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
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
type DependencyTypeShort = "dev" | "optional" | "peer" | "peerOptional" | "prod";Defined in: index.ts:1627
Unique keys that define different types of dependencies relationship.
Dist
type Dist = object;Defined in: index.ts:40
The Manifest['dist'] field present in registry manifests
Type declaration
| Name | Type | Description |
|---|---|---|
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
type EdgeLike = object;Defined in: index.ts:1678
Type declaration
| Name | Type |
|---|---|
from | NodeLike |
name | string |
optional? | boolean |
peer? | boolean |
spec | SpecLikeBase |
to? | NodeLike |
type | DependencyTypeShort |
Exports
type Exports =
| Exclude<ConditionalValue, null>
| ExportsSubpaths;Defined in: index.ts:93
ExportsSubpaths
type ExportsSubpaths = { [path in "." | `./${string}`]?: ConditionalValue };Defined in: index.ts:89
Funding
type Funding =
| FundingEntry
| FundingEntry[];Defined in: index.ts:100
FundingEntry
type FundingEntry =
| string
| {
[key: string]: JSONField; type: string;
url: string;
};Defined in: index.ts:98
GraphLike
type GraphLike = object;Defined in: index.ts:1688
Type declaration
Imports
type Imports = Record<`#${string}`, ConditionalValue>;Defined in: index.ts:96
Integrity
type Integrity = `sha512-${string}`;Defined in: index.ts:34
sha512 SRI string
JSONField
type JSONField =
| JSONField[]
| boolean
| number
| string
| {}
| null
| undefined;Defined in: index.ts:24
anything that can be encoded in JSON
KeyID
type KeyID = `SHA256:${string}`;Defined in: index.ts:37
SHA256 key identifier
Keywords
type Keywords = string[] | string;Defined in: index.ts:440
Manifest
type Manifest = object;Defined in: index.ts:854
Type declaration
| Name | Type | Description |
|---|---|---|
acceptDependencies? | Record<string, string> | dependency ranges that are acceptable, but not forced |
author? | Person | the author of a package |
bin? | Record<string, string> | string | executable built and linked by this package |
bugs? | Bugs | where to go to file issues |
bundleDependencies? | string[] | names of dependencies included in the package tarball |
contributors? | Person[] | contributors to the package |
cpu? | string[] | string | supported CPU architectures this package can run on |
dependencies? | Record<string, string> | production dependencies, name:specifier |
deprecated? | string | a message indicating that this is not to be used |
description? | string | a short description of the package |
devDependencies? | Record<string, string> | development dependencies, name:specifier |
dist? | Dist | Only 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? | Exports | named subpath exports |
funding? | Funding | URLs that can be visited to fund this project |
gitHead? | string | the HEAD of the git repo this was published from only present in published packages |
gypfile? | boolean | npm puts this on published manifests |
hasInstallScript? | boolean | Set 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? | string | The homepage of the repository |
imports? | Imports | named #identifier imports |
keywords? | Keywords | search keywords |
libc? | string[] | string | supported libc implementations this package can run on (e.g. glibc, musl) |
license? | string | the license of the package |
main? | string | the main module, if exports['.'] is not set |
name? | string | The name of the package. optional because {} is a valid package.json |
optionalDependencies? | Record<string, string> | optional dependencies, name:specifier |
os? | string[] | string | supported 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? | boolean | whether the package is private |
repository? | Repository | where 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? | string | The version of the package. optional because {} is a valid package.json |
workspaces? | | string[] | { nohoist: string[]; packages: string[] | string; } | string | npm/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
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
| Name | Type |
|---|---|
maintainers? | unknown |
NodeLike
type NodeLike = object;Defined in: index.ts:1715
Type declaration
| Name | Type | Description |
|---|---|---|
bins? | Record<string, string> | - |
brotli? | boolean | This 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" | - |
confused | boolean | - |
dev | boolean | - |
edgesIn | Set<EdgeLike> | - |
edgesOut | Map<string, EdgeLike> | - |
graph | GraphLike | - |
id | DepID | - |
importer | boolean | - |
integrity? | string | null | - |
location? | string | - |
mainImporter | boolean | - |
manifest? | NormalizedManifest | null | - |
modifier? | string | - |
name? | string | null | - |
optional | boolean | - |
options | SpecOptions | - |
peerSetHash? | string | - |
platform? | object | - |
platform.cpu? | string[] | string | - |
platform.engines? | Record<string, string> | - |
platform.libc? | string[] | string | - |
platform.os? | string[] | string | - |
projectRoot | string | - |
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 | - |
workspaces | Map<string, EdgeLike> | undefined | - |
maybeSetConfusedManifest() | void | - |
setConfusedManifest() | void | - |
setResolved() | void | - |
toString() | string | - |
NormalizedBin
type NormalizedBin = Record<string, string>;Defined in: index.ts:484
Normalized bin - always a record of string to string
NormalizedBugs
type NormalizedBugs = NormalizedBugsEntry[];Defined in: index.ts:479
Normalized bugs - always an array of NormalizedBugsEntry
NormalizedBugsEntry
type NormalizedBugsEntry = object;Defined in: index.ts:445
Normalized bugs entry - always an object with type and url/email
Type declaration
| Name | Type |
|---|---|
email? | string |
type? | "email" | "link" |
url? | string |
NormalizedContributorEntry
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
| Name | Type |
|---|---|
[kIsPublisher]? | boolean |
[kWriteAccess]? | boolean |
email? | string |
isPublisher? | boolean |
name? | string |
url? | string |
writeAccess? | boolean |
NormalizedContributors
type NormalizedContributors = NormalizedContributorEntry[];Defined in: index.ts:305
Normalized contributors - always an array of NormalizedContributorEntry.
NormalizedCpu
type NormalizedCpu = string[];Defined in: index.ts:469
Normalized CPU list - always an array of strings
NormalizedEngines
type NormalizedEngines = Record<string, string>;Defined in: index.ts:459
Normalized engines - always a record of string to string
NormalizedFields
type NormalizedFields = object;Defined in: index.ts:948
Type declaration
| Name | Type |
|---|---|
author | | NormalizedContributorEntry | undefined |
bin | NormalizedBin | undefined |
bugs | NormalizedBugs | undefined |
contributors | | NormalizedContributors | undefined |
cpu | NormalizedCpu | undefined |
engines | NormalizedEngines | undefined |
funding | NormalizedFunding | undefined |
keywords | NormalizedKeywords | undefined |
libc | NormalizedLibc | undefined |
os | NormalizedOs | undefined |
NormalizedFunding
type NormalizedFunding = NormalizedFundingEntry[];Defined in: index.ts:114
Normalized funding information, an array of NormalizedFundingEntry.
NormalizedFundingEntry
type NormalizedFundingEntry = object;Defined in: index.ts:105
An object with url and optional additional properties
Type declaration
Index Signature
[key: string]: JSONField| Name | Type |
|---|---|
type? | string |
url | string |
NormalizedKeywords
type NormalizedKeywords = string[];Defined in: index.ts:454
Normalized keywords - always an array of strings
NormalizedLibc
type NormalizedLibc = string[];Defined in: index.ts:474
Normalized libc list - always an array of strings
NormalizedManifest
type NormalizedManifest = Override<Manifest, NormalizedFields>;Defined in: index.ts:964
A Manifest object that contains normalized fields.
NormalizedManifestRegistry
type NormalizedManifestRegistry = Override<ManifestRegistry, NormalizedFields>;Defined in: index.ts:969
A ManifestRegistry object that contains normalized fields.
NormalizedOs
type NormalizedOs = string[];Defined in: index.ts:464
Normalized OS list - always an array of strings
Override<T, R>
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
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
PeerDependenciesMetaValue
type PeerDependenciesMetaValue = object;Defined in: index.ts:76
An object used to mark some peerDeps as optional
Type declaration
| Name | Type |
|---|---|
optional? | boolean |
Person
type Person =
| string
| {
email: string;
name: string;
url: string;
};Defined in: index.ts:418
RefType
type RefType = "branch" | "head" | "other" | "pull" | "tag";Defined in: index.ts:1009
Repository
type Repository =
| string
| {
type: string;
url: string;
};Defined in: index.ts:426
RevDoc
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
| Name | Type | Description |
|---|---|---|
refs | Record<string, RevDocEntry> | all named things that can be cloned down remotely |
shas | Record<string, string[]> | all named shas referenced above |
versions | Record<string, RevDocEntry> | all semver-looking tags go in this record |
RevDocEntry
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
| Name | Type | Description |
|---|---|---|
rawRef | string | canonical full ref, like refs/tags/blahblah |
ref | string | ref as passed git locally |
sha | string | sha this references |
type | RefType | what type of ref this is: 'branch', 'tag', etc. |
SomeNormalizedManifest<T>
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
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
const BROTLI_TARBALL_EXT: ".tar.br" = '.tar.br';Defined in: index.ts:1086
Filename extension of a Brotli-recompressed tarball.
dependencyTypes
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
const integrityRE: RegExp;Defined in: index.ts:1044
keyIDRE
const keyIDRE: RegExp;Defined in: index.ts:1166
longDependencyTypes
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
const shortDependencyTypes: Set<DependencyTypeShort>;Defined in: index.ts:1655
A set of the short type keys used to represent dependency relationships.
Functions
asError()
function asError(er, fallbackMessage): ErrorDefined in: index.ts:1191
Convert an unknown value to an error.
Parameters
| Parameter | Type | Default value |
|---|---|---|
er | unknown | undefined |
fallbackMessage | string | 'Unknown error' |
Returns
Error
asIntegrity()
function asIntegrity(i): `sha512-${string}`Defined in: index.ts:1048
Parameters
| Parameter | Type |
|---|---|
i | unknown |
Returns
`sha512-${string}`
asKeyID()
function asKeyID(k): `SHA256:${string}`Defined in: index.ts:1170
Parameters
| Parameter | Type |
|---|---|
k | unknown |
Returns
`SHA256:${string}`
asManifest()
function asManifest(m, from?): ManifestDefined in: index.ts:1322
Given an unknown value, convert it to a Manifest.
Parameters
| Parameter | Type |
|---|---|
m | unknown |
from? | (...a) => any |
Returns
asManifestRegistry()
function asManifestRegistry(m, from?): ManifestRegistryDefined in: index.ts:1497
Given an unknown value, convert it to a ManifestRegistry.
Parameters
| Parameter | Type |
|---|---|
m | unknown |
from? | (...a) => any |
Returns
asNormalizedManifest()
function asNormalizedManifest(m, from?): OverrideDefined in: index.ts:1480
Given an unknown value, convert it to a NormalizedManifest.
Parameters
| Parameter | Type |
|---|---|
m | unknown |
from? | (...a) => any |
Returns
asNormalizedManifestRegistry()
function asNormalizedManifestRegistry(m, from?): OverrideDefined in: index.ts:1523
Given an unknown value, convert it to a NormalizedManifestRegistry.
Parameters
| Parameter | Type |
|---|---|
m | unknown |
from? | (...a) => any |
Returns
asPackument()
function asPackument(p, from?): PackumentDefined in: index.ts:1595
Parameters
| Parameter | Type |
|---|---|
p | unknown |
from? | (...a) => any |
Returns
assertIntegrity()
function assertIntegrity(i): asserts i is `sha512-${string}`Defined in: index.ts:1062
Parameters
| Parameter | Type |
|---|---|
i | unknown |
Returns
asserts i is `sha512-${string}`
assertKeyID()
function assertKeyID(k): asserts k is `SHA256:${string}`Defined in: index.ts:1184
Parameters
| Parameter | Type |
|---|---|
k | unknown |
Returns
asserts k is `SHA256:${string}`
assertManifest()
function assertManifest(m): asserts m is ManifestDefined in: index.ts:1573
Parameters
| Parameter | Type |
|---|---|
m | unknown |
Returns
asserts m is Manifest
assertManifestRegistry()
function assertManifestRegistry(m): asserts m is ManifestRegistryDefined in: index.ts:1578
Parameters
| Parameter | Type |
|---|---|
m | unknown |
Returns
asserts m is ManifestRegistry
assertPackument()
function assertPackument(m): asserts m is PackumentDefined in: index.ts:1609
Parameters
| Parameter | Type |
|---|---|
m | unknown |
Returns
asserts m is Packument
assertRecordStringString()
function assertRecordStringString(o): voidDefined in: index.ts:1229
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
void
assertRecordStringT()
function assertRecordStringT<T>(
o,
check,
wanted): asserts o is Record<string, T>Defined in: index.ts:1247
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
o | unknown |
check | (o) => o is T |
wanted | string |
Returns
asserts o is Record<string, T>
brotliTarballName()
function brotliTarballName(tgz): stringDefined 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
| Parameter | Type |
|---|---|
tgz | string |
Returns
string
brotliTarballUrl()
function brotliTarballUrl(tarball, alternates): undefined | BrotliAlternateDefined in: index.ts:1137
Parameters
| Parameter | Type |
|---|---|
tarball | undefined | string |
alternates | undefined | object[] |
Returns
undefined | BrotliAlternate
expandNormalizedManifestSymbols()
function expandNormalizedManifestSymbols(m): OverrideDefined in: index.ts:1555
Walks a normalized manifest and expands any symbols found
in the author and contributors fields.
Parameters
| Parameter | Type |
|---|---|
m | Override |
Returns
fixManifestVersion()
function fixManifestVersion<T>(manifest): TDefined in: index.ts:228
Given a version Normalize the version field in a manifest.
Type Parameters
| Type Parameter |
|---|
T extends | Manifest | ManifestRegistry |
Parameters
| Parameter | Type |
|---|---|
manifest | T |
Returns
T
integrityHex()
function integrityHex(i): undefined | stringDefined 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
| Parameter | Type |
|---|---|
i | unknown |
Returns
undefined | string
isBoolean()
function isBoolean(value): value is booleanDefined in: index.ts:1041
A type guard to check if a value is a boolean.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
value is boolean
isError()
function isError(er): er is ErrorDefined in: index.ts:1200
Check if a value is an error.
Parameters
| Parameter | Type |
|---|---|
er | unknown |
Returns
er is Error
isErrorWithCause()
function isErrorWithCause(er): er is Error & { cause: unknown }Defined in: index.ts:1206
Check if an error has a cause property.
Parameters
| Parameter | Type |
|---|---|
er | unknown |
Returns
er is Error & { cause: unknown }
isIntegrity()
function isIntegrity(i): i is `sha512-${string}`Defined in: index.ts:1045
Parameters
| Parameter | Type |
|---|---|
i | unknown |
Returns
i is `sha512-${string}`
isKeyID()
function isKeyID(k): k is `SHA256:${string}`Defined in: index.ts:1167
Parameters
| Parameter | Type |
|---|---|
k | unknown |
Returns
k is `SHA256:${string}`
isManifest()
function isManifest(m): m is ManifestDefined in: index.ts:1296
Is a given unknown value a valid Manifest object?
Returns true if so.
Parameters
| Parameter | Type |
|---|---|
m | unknown |
Returns
m is Manifest
isManifestRegistry()
function isManifestRegistry(m): m is ManifestRegistryDefined 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
| Parameter | Type |
|---|---|
m | unknown |
Returns
m is ManifestRegistry
isNormalizedBugs()
function isNormalizedBugs(o): o is NormalizedBugsDefined in: index.ts:569
Type guard to check if a value is a NormalizedBugs.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedBugs
isNormalizedBugsEntry()
function isNormalizedBugsEntry(o): o is NormalizedBugsEntryDefined in: index.ts:553
Type guard to check if a value is a NormalizedBugsEntry.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedBugsEntry
isNormalizedContributorEntry()
function isNormalizedContributorEntry(o): o is NormalizedContributorEntryDefined in: index.ts:329
Type guard to check if a value is a normalized contributor entry.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedContributorEntry
isNormalizedContributors()
function isNormalizedContributors(o): o is NormalizedContributorsDefined in: index.ts:353
Type guard to check if a value is a NormalizedContributors.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedContributors
isNormalizedCpu()
function isNormalizedCpu(o): o is NormalizedCpuDefined in: index.ts:769
Type guard to check if a value is a NormalizedCpu.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedCpu
isNormalizedEngines()
function isNormalizedEngines(o): o is NormalizedEnginesDefined in: index.ts:743
Type guard to check if a value is a NormalizedEngines.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedEngines
isNormalizedFunding()
function isNormalizedFunding(o): o is NormalizedFundingDefined in: index.ts:215
Type guard to check if a value is a NormalizedFunding.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedFunding
isNormalizedFundingEntry()
function isNormalizedFundingEntry(o): o is NormalizedFundingEntryDefined in: index.ts:196
Type guard to check if a value is a NormalizedFundingEntry.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedFundingEntry
isNormalizedKeywords()
function isNormalizedKeywords(o): o is NormalizedKeywordsDefined in: index.ts:614
Type guard to check if a value is a NormalizedKeywords.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedKeywords
isNormalizedLibc()
function isNormalizedLibc(o): o is NormalizedLibcDefined in: index.ts:786
Type guard to check if a value is a NormalizedLibc.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedLibc
isNormalizedManifest()
function isNormalizedManifest(o): o is Override<Manifest, NormalizedFields>Defined in: index.ts:1456
Type guard to check if a value is a NormalizedManifest.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is Override<Manifest, NormalizedFields>
isNormalizedManifestRegistry()
function isNormalizedManifestRegistry(o): o is Override<ManifestRegistry, NormalizedFields>Defined in: index.ts:1514
Type guard to check if a value is a NormalizedManifestRegistry.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is Override<ManifestRegistry, NormalizedFields>
isNormalizedOs()
function isNormalizedOs(o): o is NormalizedOsDefined in: index.ts:752
Type guard to check if a value is a NormalizedOs.
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is NormalizedOs
isObject()
function isObject(v): v is Record<string, unknown>Defined in: index.ts:1213
Check if an unknown value is a plain object.
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
v is Record<string, unknown>
isPackument()
function isPackument(p): p is PackumentDefined in: index.ts:1584
Parameters
| Parameter | Type |
|---|---|
p | unknown |
Returns
p is Packument
isPeerDependenciesMetaValue()
function isPeerDependenciesMetaValue(o): o is PeerDependenciesMetaValueDefined in: index.ts:1281
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is PeerDependenciesMetaValue
isRecordStringManifest()
function isRecordStringManifest(o): o is Record<string, Manifest>Defined in: index.ts:1265
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is Record<string, Manifest>
isRecordStringString()
function isRecordStringString(o): o is Record<string, string>Defined in: index.ts:1224
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is Record<string, string>
isRecordStringT()
function isRecordStringT<T>(o, check): o is Record<string, T>Defined in: index.ts:1238
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
o | unknown |
check | (o) => o is T |
Returns
o is Record<string, T>
maybeBoolean()
function maybeBoolean(o): o is booleanDefined in: index.ts:1278
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is boolean
maybeDist()
function maybeDist(a): a is undefined | DistDefined in: index.ts:1289
Parameters
| Parameter | Type |
|---|---|
a | unknown |
Returns
a is undefined | Dist
maybePeerDependenciesMetaSet()
function maybePeerDependenciesMetaSet(o): o is undefined | Record<string, PeerDependenciesMetaValue>Defined in: index.ts:1270
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is undefined | Record<string, PeerDependenciesMetaValue>
maybeRecordStringString()
function maybeRecordStringString(o): o is undefined | Record<string, string>Defined in: index.ts:1219
Parameters
| Parameter | Type |
|---|---|
o | unknown |
Returns
o is undefined | Record<string, string>
maybeString()
function maybeString(a): a is undefined | stringDefined in: index.ts:1286
Parameters
| Parameter | Type |
|---|---|
a | unknown |
Returns
a is undefined | string
normalizeBinPaths()
function normalizeBinPaths(manifest): undefined | Record<string, string>Defined in: index.ts:839
Normalizes the bin paths.
Parameters
| Parameter | Type |
|---|---|
manifest | Pick<Manifest, "name" | "bin"> |
Returns
undefined | Record<string, string>
normalizeBugs()
function normalizeBugs(bugs): undefined | NormalizedBugsDefined in: index.ts:530
Normalize bugs information to a NormalizedBugs consistent format.
Parameters
| Parameter | Type |
|---|---|
bugs | unknown |
Returns
undefined | NormalizedBugs
normalizeContributors()
function normalizeContributors(contributors, maintainers?):
| undefined
| NormalizedContributorEntry[]Defined in: index.ts:366
Normalize contributors and maintainers from various formats
Parameters
| Parameter | Type |
|---|---|
contributors | unknown |
maintainers? | unknown |
Returns
| undefined
| NormalizedContributorEntry[]
normalizeCpu()
function normalizeCpu(cpu): undefined | NormalizedCpuDefined in: index.ts:681
Normalize CPU information to a NormalizedCpu consistent format.
Parameters
| Parameter | Type |
|---|---|
cpu | unknown |
Returns
undefined | NormalizedCpu
normalizeEngines()
function normalizeEngines(engines): undefined | NormalizedEnginesDefined in: index.ts:633
Normalize engines information to a NormalizedEngines consistent format.
Parameters
| Parameter | Type |
|---|---|
engines | unknown |
Returns
undefined | NormalizedEngines
normalizeFunding()
function normalizeFunding(funding): undefined | NormalizedFundingDefined in: index.ts:183
Normalize funding information to a consistent format.
Parameters
| Parameter | Type |
|---|---|
funding | unknown |
Returns
undefined | NormalizedFunding
normalizeKeywords()
function normalizeKeywords(keywords): undefined | NormalizedKeywordsDefined in: index.ts:578
Normalize keywords information to a NormalizedKeywords consistent format.
Parameters
| Parameter | Type |
|---|---|
keywords | unknown |
Returns
undefined | NormalizedKeywords
normalizeLibc()
function normalizeLibc(libc): undefined | NormalizedLibcDefined in: index.ts:712
Normalize libc information to a NormalizedLibc consistent format.
Parameters
| Parameter | Type |
|---|---|
libc | unknown |
Returns
undefined | NormalizedLibc
normalizeManifest()
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
| Parameter | Type |
|---|---|
manifest | T |
from? | string |
Returns
normalizeOs()
function normalizeOs(os): undefined | NormalizedOsDefined in: index.ts:650
Normalize OS information to a NormalizedOs consistent format.
Parameters
| Parameter | Type |
|---|---|
os | unknown |
Returns
undefined | NormalizedOs
parsePerson()
function parsePerson(
person,
writeAccess?,
isPublisher?):
| undefined
| NormalizedContributorEntryDefined in: index.ts:252
Parse a string or object into a normalized contributor.
Parameters
| Parameter | Type |
|---|---|
person | unknown |
writeAccess? | boolean |
isPublisher? | boolean |
Returns
| undefined
| NormalizedContributorEntry
parseScope()
function parseScope(scoped): [undefined | string, string]Defined in: index.ts:1793
Parse a scoped package name into its scope and name components.
Parameters
| Parameter | Type |
|---|---|
scoped | string |
Returns
[undefined | string, string]
tarballFormat()
function tarballFormat(url): undefined | TarballFormatDefined 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
| Parameter | Type |
|---|---|
url | string |
Returns
undefined | TarballFormat