@blockchaincommons/dcbor - v1.0.0-beta.1
    Preparing search index...

    Function asSingle

    • Returns the single CBOR element if this is a 'single' variant.

      Parameters

      • element: WalkElement

        The walk element to extract from

      Returns Cbor | undefined

      The CBOR value if single, undefined otherwise

      const element: WalkElement = { type: 'single', cbor: someCbor };
      const cbor = asSingle(element); // Returns someCbor