Skip to content

ContentIdentifierSchemeParser

ContentIdentifierSchemeParser<T> = (identifier, content, instance) => MaybePromise<T | undefined>

Defined in: astrobase/src/cid/cid.ts:17

A handler function for parsing and validating a content identifier and content buffer pair.

T

The type returned after a successful parse.

ContentIdentifier

The ContentIdentifier.

Uint8Array

The content buffer.

Instance

The instance where the function was called.

MaybePromise<T | undefined>

The parsed value or a promise that resolves with the parsed value. If performing some validation which fails, instead return undefined.