manifest.ts
Install with bun add @addonium/helpers. Zero runtime dependencies - works under Bun, Node 18+, and browsers.
manifest.ts
ManifestIssue
interface ManifestIssue.
isOpen(m: Pick<Manifest, "type">): boolean
function isOpen.
isLocked(m: Pick<Manifest, "type">): boolean
function isLocked.
supportsResource( m: Pick<Manifest, "resources">, r: Resource, ): boolean
function supportsResource.
validateManifest(input: unknown): ManifestIssue[]
Structural validation mirroring §5.1 + §16 (not a full JSON-Schema engine).
parseManifest(input: unknown): Manifest
Parse + validate; throws an Error listing all issues.
isSpecMajorCompatible(manifestVersion: string): boolean
Hosts should refuse manifests whose spec major they don't implement (§12.1).
defaultDistribution(m: Pick<Manifest, "distribution">): Array<"manifest" | "module">
function defaultDistribution.
storesData(m: Pick<Manifest, "storesData">): boolean
function storesData.