API Reference / fetchPacks · function
Function: fetchPacks()
function fetchPacks(
manifest,
entries,
fetchPack,
options?): Promise<LoadedPack[]>;
Fetch, verify, and decode packs. Resolves with the packs in the order given. Rejects with PackIntegrityError if any pack's length or SHA-256 differs from its manifest entry; a pack that fails is never decoded.
Only the entries passed are fetched, and each must be one the manifest lists, so a caller cannot be steered into fetching an arbitrary file.
Parameters
| Parameter | Type |
|---|---|
manifest | PackManifest |
entries | readonly PackManifestEntry[] |
fetchPack | PackFetch |
options | LoadPacksOptions |
Returns
Promise<LoadedPack[]>