asCid

@twine-protocol/twine-core v0.1.0Docs


twine-js / @twine-protocol/twine-core / asCid

Function: asCid()

asCid(val): null | CID<unknown, number, number, Version>

Convert something into a CID

Parameters

Parameter
Type
Description

val

any

The value to convert

Returns

null | CID<unknown, number, number, Version>

The CID or null if it could not be converted

Example

const cid = asCid('bafybeib3...')
const anotherCid = asCid(somePulse)

Defined in

packages/twine-core/src/conversion.ts:96

Last updated