BC-DCBOR TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Function asKeyValue

    • Returns the key-value pair if this is a 'keyvalue' variant.

      Parameters

      Returns [Cbor, Cbor] | undefined

      Tuple of [key, value] if keyvalue, undefined otherwise

      const element: WalkElement = { type: 'keyvalue', key: keyValue, value: valValue };
      const pair = asKeyValue(element); // Returns [keyValue, valValue]