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.
Type Parameters
Section titled “Type Parameters”T
The type returned after a successful parse.
Parameters
Section titled “Parameters”identifier
Section titled “identifier”The ContentIdentifier.
content
Section titled “content”Uint8Array
The content buffer.
instance
Section titled “instance”The instance where the function was called.
Returns
Section titled “Returns”MaybePromise
<T
| undefined
>
The parsed value or a promise that resolves with the parsed value. If performing some
validation which fails, instead return undefined
.