/** * Package URL (purl) derivation for PackageLayer identities. * * A purl is a stable, ecosystem-qualified coordinate for a package — e.g. * `pkg:npm/@scope/name` or `pkg:pypi/requests`. PackageLayer carries no purl of * its own, so it is derived from the layer's `type` (which ecosystem) plus the * package `name`. The same derivation keys a package's own identity and the * identity of each declared dependency (a dependency lives in the same * ecosystem as the manifest that declares it), so the two are guaranteed to * match when joined. * * Note: the purl `type` component (npm/pypi/cargo/golang) is a different * vocabulary from the tool-detection `Ecosystem` (node/python/go/rust) in * ../strategies — they are intentionally not shared. */ import type { PackageLayer } from '../types/layer-types'; /** purl `type` component. */ export type PurlEcosystem = 'npm' | 'pypi' | 'cargo' | 'golang'; /** The purl `type` for a PackageLayer type, e.g. `'node'` -> `'npm'`. */ export declare function purlEcosystemForPackageType(packageType: PackageLayer['type']): PurlEcosystem; /** * Derive a purl from a package type + name. The name is used verbatim (npm * scope included), so a package's own purl and a purl built from a dependency * entry that names it resolve to the same string. Returns undefined for an * empty name so callers can skip un-keyable packages rather than emit a * malformed `pkg:npm/` coordinate. */ export declare function derivePurl(packageType: PackageLayer['type'], name: string | undefined): string | undefined; //# sourceMappingURL=purl.d.ts.map