Skip to content

Modules | @vltpkg/pick-manifest

Type Aliases

ManiCheck<T>

type ManiCheck<T>: object;

Type Parameters

T extends Packumentish

Type declaration

deprecated
deprecated: boolean
mani
mani: PickManifestish<T>
platform
platform: boolean
prerelease
prerelease: boolean
version
version: Version

Defined in

index.ts:25


Manifestish

type Manifestish: Manifest | RevDocEntry;

Defined in

index.ts:21


Packumentish

type Packumentish: Packument | RevDoc;

Defined in

index.ts:22


PickManifestish<T>

type PickManifestish<T>: T extends RevDoc ? RevDocEntry : Manifest;

Type Parameters

T extends Packumentish

Defined in

index.ts:23


PickManifestOptions

type PickManifestOptions: object;

Type declaration

arch?
optional arch: NodeJS.Architecture;
before?
optional before: Date | number | string;
node-version?
optional node-version: string;
os?
optional os: NodeJS.Platform;
tag?
optional tag: string;

Defined in

index.ts:13

Functions

pickManifest()

function pickManifest<T>(
packument,
wanted,
opts,
): PickManifestish<T> | undefined

Choose the most appropriate manifest from a packument.

If before is set in the options, then the packument MUST be a full non-minified Packument object. Otherwise, a minified packument is fine.

Type Parameters

T extends Packumentish

Parameters

packument: T

wanted: string | Range | Spec

opts: PickManifestOptions = {}

Returns

PickManifestish<T> | undefined

Defined in

index.ts:118


platformCheck()

function platformCheck(mani, nodeVersion, wantOs?, wantArch?): boolean

Call with a manifest and the node version and process platform/arch to check whether a version is suitable for the current platform.

Parameters

mani: Manifestish

nodeVersion: string | Version

wantOs?: Platform

wantArch?: Architecture

Returns

boolean

Defined in

index.ts:75