Skip to content

maybeExternalizeBatch

function maybeExternalizeBatch(
batch,
config?,
onUpload?): Promise<VgiBatch>;

Defined in: src/external.ts:142

Maybe externalize a batch if it exceeds the threshold. Returns the original batch unchanged if below threshold or no config.

Parameter Type Description
batch VgiBatch -
config? | ExternalLocationConfig | null -
onUpload? (bytes) => void Called with the number of bytes actually uploaded. Counted here rather than at the call sites: this is the one function every externalised payload passes through, so the total cannot drift from reality by someone adding a new upload path.

Promise<VgiBatch>